rdf - In an ontology, how to define a property's value as a datetime -


when writing ontology , want create class , property relating time/date, assume you'll have structurally (psuedo code):

class:project   label: project  property:duedate   label: expected completion time , date of project   domain: project   range: datetime (?) 

i've googled around , found owl-time ontology, use case confusing me because looks i'm supposed define quite few things. on right track here?

you haven't mentioned how you're constructing ontology. if you're writing owl hand (e.g., functional syntax), you'd 1 way; if you're writing rdf, you'll (you'd write rdf encoding of owl axiom). easiest way see how these done defining ontology using protégé, or similar graphical editor, , @ resulting code. assume since used term datetime, you're @ data property values should literals of datatype xsd:datetime.

in protégé

in protégé you'd this:

enter image description here

in owl functional syntax

the syntax data property range axioms given in 9.3.5 data property range owl 2 web ontology language structural specification , functional-style syntax (second edition). when save ontology in functional syntax, this:

prefix(xsd:=<http://www.w3.org/2001/xmlschema#>) prefix(owl:=<http://www.w3.org/2002/07/owl#>) prefix(xml:=<http://www.w3.org/xml/1998/namespace>) prefix(rdf:=<http://www.w3.org/1999/02/22-rdf-syntax-ns#>) prefix(rdfs:=<http://www.w3.org/2000/01/rdf-schema#>)   ontology(<http://stackoverflow.com/q/21486301/1281433/projects>  declaration(class(<http://stackoverflow.com/q/21486301/1281433/projects#project>)) declaration(dataproperty(<http://stackoverflow.com/q/21486301/1281433/projects#duedate>)) datapropertydomain(<http://stackoverflow.com/q/21486301/1281433/projects#duedate> <http://stackoverflow.com/q/21486301/1281433/projects#project>) datapropertyrange(<http://stackoverflow.com/q/21486301/1281433/projects#duedate> xsd:datetime) ) 

the important axiom

datapropertyrange(<http://stackoverflow.com/q/21486301/1281433/projects#duedate> xsd:datetime) 

in rdf

owl can serialized in rdf, , rdf can serialized in number of ways. here's ontology looks in turtle serialization of rdf, , in rdf/xml serialization:

@prefix :      <http://stackoverflow.com/q/21486301/1281433/projects#> . @prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> . @prefix owl:   <http://www.w3.org/2002/07/owl#> . @prefix xsd:   <http://www.w3.org/2001/xmlschema#> . @prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .  <http://stackoverflow.com/q/21486301/1281433/projects>               owl:ontology .  :project      owl:class .  :duedate           owl:datatypeproperty ;         rdfs:domain  :project ;         rdfs:range   xsd:datetime . 

the important triple, of course,

:duedate rdfs:range xsd:datetime 
<rdf:rdf     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"     xmlns="http://stackoverflow.com/q/21486301/1281433/projects#"     xmlns:owl="http://www.w3.org/2002/07/owl#"     xmlns:xsd="http://www.w3.org/2001/xmlschema#"     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">   <owl:ontology rdf:about="http://stackoverflow.com/q/21486301/1281433/projects"/>   <owl:class rdf:about="http://stackoverflow.com/q/21486301/1281433/projects#project"/>   <owl:datatypeproperty rdf:about="http://stackoverflow.com/q/21486301/1281433/projects#duedate">     <rdfs:domain rdf:resource="http://stackoverflow.com/q/21486301/1281433/projects#project"/>     <rdfs:range rdf:resource="http://www.w3.org/2001/xmlschema#datetime"/>   </owl:datatypeproperty> </rdf:rdf> 

it's still same triple that's important here, in format it's written as:

  <owl:datatypeproperty rdf:about="http://stackoverflow.com/q/21486301/1281433/projects#duedate">     <rdfs:range rdf:resource="http://www.w3.org/2001/xmlschema#datetime"/>   </owl:datatypeproperty> 

Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -