---+ Best Practice: Be careful with the use of inferencing in RDF Vocabularies *State:* Draft *Contact:* [[https://jazz.net/wiki/bin/view/Main/NickCrossley][Nick Crossley]] ---++ Scope This Best Practice discusses inappropriate usage of inferencing properties such as =rdfs:domain= and =rdfs:range= in RDF vocabularies. ---++ Recommendation RDFS contains terms such as =rdfs:domain= and =rdfs:range=, which go beyond mere vocabulary definition and enter into the world of ontologies. The primary difference between a vocabulary and an ontology is that an ontology includes inference rules which let you infer new information from given information - that is, add new triples to those stated, rather than constrain data to some schema. For more information on this, read [[https://pdfs.semanticscholar.org/be86/69c329e0b518271c89698f842424501c0773.pdf][OSLC Resource Shape - A language for defining constraints on Linked Data]]. In the light of this knowledge, be careful with the use of inferencing terms in vocabularies - they often do not mean what you might have thought they meant. In particular, do not use =rdfs:domain= or =rdfs:range= with multiple values when defining a vocabulary term for a property, since that infers the target of that property is of all mentioned types, not any one of them. ---++ Examples Here is an example snippet of an RDF vocabulary document: <verbatim> @prefix oslc: <http://open-services.net/ns/core#> . @prefix oslc_qm: <http://open-services.net/ns/qm#> . @prefix oslc_rm: <http://open-services.net/ns/rm#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . oslc_qm:validatesRequirement a rdf:Property ; rdfs:isDefinedBy oslc_qm: ; rdfs:label "validatesRequirement" ; rdfs:comment "Requirement that is validated by the Test Case." ; rdfs:range oslc_rm:Requirement ; rdfs:domain oslc_qm:TestScript, oslc_qm:TestCase ; oslc:inverseLabel "Validated By" . </verbatim> This states that the target of an =oslc_qm:validatesRequirement= property is _both_ an =oslc_qm:TestScript= _and_ an =oslc_qm:TestCase= - which is not what the author intended. It also implies that any resource using this property may be inferred to be an OSLC requirement - which could prevent reuse of this property for requirements from non-OSLC providers. In this case, the vocabulary term would be better defined without the use of =rdfs:range= and =rdfs:domain=. The shape for resources using this property *should* consider use of the =oslc:range= property to suggest likely target types for the values of the property. ---++ See Also * [[http://www.w3.org/TR/rdf-schema/][RDF Schema]] * [[https://pdfs.semanticscholar.org/be86/69c329e0b518271c89698f842424501c0773.pdf][OSLC Resource Shape - A language for defining constraints on Linked Data]]
This topic: LinkedData
>
WebHome
>
BestPractices
>
BeCarefulWithUseOfInferencingInVocabularies
History: r2 - 2019-09-09 - 15:26:15 - Main.ndjc
Copyright © by IBM and non-IBM 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
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more
here
.