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

Data types in the vocabulary #96

Open
marcverhagen opened this issue May 30, 2019 · 2 comments
Open

Data types in the vocabulary #96

marcverhagen opened this issue May 30, 2019 · 2 comments

Comments

@marcverhagen
Copy link
Contributor

The 1.3.0 snapshot has a new data type name Datatype#list_uri, see the Token type for an example. Until now, the type listed for the values of properties were things like String, Integer, String or URI, List of URI, List of IDs,Set of IDs, List of Strings, and maybe a few I missed. The new Datatype#list_uri is a datatype defined in the vocabulary and is associated with a URI which is printed here since the link is broken (this is somewhat simplified):

<xs:schema 
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    attributeFormDefault="unqualified"
    elementFormDefault="qualified">
    <xs:simpleType name="list_uri" id="list_uri">
        <xs:restriction>
            <xs:simpleType>
                <xs:list itemType="xs:anyURI"/>
            </xs:simpleType>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="string_list" id="string_list">
        <xs:restriction>
            <xs:simpleType>
                <xs:list itemType="xs:string"/>
            </xs:simpleType>
        </xs:restriction>
    </xs:simpleType>
</xs:schema>

The reason appears to be that this is needed for generating RDF schema. Some general remarks and questions on this for discussion:

  • Do we really want to use Datatype#list_uri instead of List of URI (which may be should be List of URIs so it is consistent with List of IDs. I do not find it very user-friendly.
  • If we do use something like http://vocab.lappsgrid.org/Datatype#list_uri we could still call it List of URIs but use the link as well. This way we have the explicit definition but it the vocabulary will still show a more friendly name.
  • If we have one for http://vocab.lappsgrid.org/Datatype#list_uri don't we then also need URIs for all others (http://vocab.lappsgrid.org/Datatype#string etcetera)?
  • With or without those datatypes, it would perhaps be nice to associate some explicit meaning to the types, perhaps a list defined somewhere.
@ksuderman
Copy link

I think we discussed this during a tech call, but just to capture the reasoning here.

The reason for the Datatype#list_uri is as you assumed, we need an XML Schema type for the RDF representations and "List of URI" is not a Schema datatype like "List of IDs" (xs:IDREFS) is. However, is is easy enough to define our own XS types and Datatype#list_uri (and Datatype#string_list) is defined at the bottom of the lapps.vocabulary file. The Vocabulary DSL processor uses those definitions to generate the XML Schemas for the types that can then be deployed to vocab.lappsgrid.org. I have modified the DSL processor to recognize "List of URI" as a synonym for Datatype#list_uri, but such synonyms required modifying, recompiling, and redeploying the DSL processor. Whereas new datatypes can be used right away simply by defining them in the lapps.vocabulary file without any changes to the DSL processor.

@ksuderman
Copy link

I have tweaked the Vocabulary DSL so that human readable aliases can be defined for XML Schema types that are defined. This allows authors to use things like "List of URI" or "List of Strings" in the documentation/DSL that are translated into the correct XML Schema definitions in the RDF.

The main changes to the vocabulary files are:

  1. Move the Datatype definitions to the file Datatypes.schema.
  2. include the Datatypes.schema file at the top of the lapps.vocabulary.
  3. Add human readable aliases for the XML Schema types defined.

The Datatypes.schema file is just an XML Schema that uses Groovy MarkupBuilder syntax instead of XML. Refer to the XML Schema Datatype documentation (or any good XML Schema tutorial) for the elements and attributes that are allowed in XML Schema.

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

2 participants