Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why are simpleTypes prefixed with '@' ? #19

Open
redaktor opened this issue Mar 4, 2015 · 3 comments
Open

Why are simpleTypes prefixed with '@' ? #19

redaktor opened this issue Mar 4, 2015 · 3 comments

Comments

@redaktor
Copy link

redaktor commented Mar 4, 2015

E.g.

<xs:attribute name="countryCode" type="xs:string"/>

becomes

"@countryCode": {
    "type": "string"
}
@fnogatz
Copy link
Owner

fnogatz commented Mar 4, 2015

At the end it should not:

<xs:complexType>
  <xs:attribute name="countryCode" type="xs:string" />
</xs:complexType>

becomes

{
    "properties": {
        "countryCode": {
            "type": "string"
        }
    },
    "type": "object"
}

as you would expect. There's a test specified for this scenario too.

FYI: While processing the XSD all attributes are prefixed with an @ for being able to handle the following situation:

<xs:complexType>
  <xs:all>
    <xs:element name="countryCode" type="xs:string" />
  </xs:all>
  <xs:attribute name="countryCode" type="xs:string" />
</xs:complexType>

Though the Prolog predicate remove_at_from_property_names/2 will remove any unnecessary @-prefix.

@redaktor
Copy link
Author

redaktor commented Mar 5, 2015

I tested with the Schemas in PRISM - it is a namespace absolutely not following 5-star-data or linked data. But it is used in popular OWL ontologies.
They have got XML Schemas which you can download in a .zip here ;) :
http://www.idealliance.org/specifications/prism-metadata-initiative/prism

@fnogatz
Copy link
Owner

fnogatz commented Mar 5, 2015

I already read your other issue and posts on the json-schema mailing list. I will have a look at the PRISM schemas this weekend :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant