Best Practice: Make RDF Vocabulary Documents Available For Use in Queries

State: Approved

Contact: Nick Crossley


This Best Practice recommends that RDF vocabulary documents be made available for use with queries to improve the user experience. RDF vocabulary documents are useful both to report builders and at query execution time. Report builders can use vocabulary documents to improve user-assistance. Queries can use vocabulary documents to provide human-readable labels for URIs.

This Best Practice is closely related to Best Practice: Publish RDF Vocabularies which discuss how to publish vocabularies.


RDF representations use URIs for types, properties, enumerated values, etc. However, URIs are not suitable as user-selectable query input parameters or as displayable output values. RDF vocabulary documents contain readable labels (rdfs:label) and comments (rdfs:comment) that describe URIs. The user experience can therefore be improved by using vocabulary URI labels and comments both on input and output.

Linked Data applications that generate RDF vocabularies should treat these like any other type of resource that they host and enable them to be indexed by query engines, e.g. by including the RDF vocabulary resources in a Tracked Resource Set.

For example, Rational Team Concert (RTC) lets project area administrators add custom attributes and enumerated values to work item definitions. If the adminstrator does not provide external vocabulary URIs for these custom elements, RTC will generate local vocabulary URIs. These local vocabulary URIs should be described in RDF vocabulary documents, and these documents should be included in the Tracked Resource Set (TRS) for the project area so that applications such as Lifecycle Query Engine (LQE) can index them and make them available to SPARQL queries, both at report building time and at query execution time.

Query engines, e.g. the Lifecycle Query Engine, should provide some additional administrative mechanism to index commonly used RDF vocabularies that would not normally be indexed.


For example, the following SPARQL query returns a list of all the defined type URIs, along with their labels and comments. This query result could be used to populate a drop down list that lets the user select the desired type:

PREFIX rdfs: <>

SELECT ?type, ?label, ?comment
   ?type a rdfs:Class; 
      rdfs:label ?label; 
      rdfs:comment ?comment 

See Also

This topic: LinkedData > WebHome > BestPractices > IndexRdfVocabularies
History: r4 - 2015-10-14 - 00:30:50 - Main.ndjc
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Contributions are governed by our Terms of Use
Ideas, requests, problems regarding TWiki? Send feedback