My ontology is book classification library. I have problems in this. I want to build a book classification ontology by protégé 4.1, this classification has 14 categories, beside the sibling classes Author, book, Isbn. Individuals in book class are book’s subject(about 600 subjects) , and individuals in author class are name’s author and also isbn class. then I'm confused in object properties and datatype properties. if hasEdition is in properties in my ontology then i say that every book in class book have relation with edition class. so i use object properties but individual in this class(edition class) is integer<9. then how can tell it? is it datatype or object? and can use object properties vs datatype properties? (a same name)
相关问题
- Calculate the depth of subclass in the OWL ontolog
- owl:someValuesFrom vs. owl:minCardinalilty
- map owl to neo4j (java example)
- merge equivalent classes using owl API
- OWL RDF/TTL Make an instance member of class based
相关文章
- Meaning of owl:hasValue?
- Jena Fuseki assembler file + TDB + OWL reasoner
- RDFS: same property for multiple domains
- OWL ObjectProperty loading as annotation in Protég
- owl - protege not inferring correctly? how to defi
- Which Triplestore for rapid semantic web developme
- why protege doesn't infer a data property in t
- Conversion from OWLOntology to Jena Model in Java
On Object and Datatype Properties
In Protégé there are are different tabs for creating Object Properties and Datatype Properties. If a property should relate individuals to individuals, then it needs to be an object property, and if it relates individuals to literals, then it needs to be a datatype property.
If you have a property
hasEdition
whose domain isBook
, then the question becomes what the range should be. If you expect triples like:where the value are literals, then
hasEdition
should be a datatype property. If, on the other hand, you have a classEdition
with some particular individuals, e.g.,so that you can have
then
hasEdition
should be an object property.If you need to look at the RDF serialization and determine which types the properties are, you should query for the classes
owl:ObjectProperty
andowl:DatatypeProperty
(and, for the sake of completeness,owl:AnnotationProperty
). That is, depending on whetherhasEdition
is an object property or a datatype property you would see:or
Deciding which to use
Whether you want a
hasEdition
property to be a datatype property or an object property really depends on what kind of data you're going to be storing, and that depends on your application. If you're just representing simple information like"first"
,"second"
, etc., then you probably want to use a datatype property that relates a book to its edition. This is probably a good route if you're representing books in the abstract, i.e, not individual instances of books (as opposed to a bookseller's inventory system, which would be be concerned with individual instances of books).If, on the other hand, what you're actually representing are instances of books. E.g., if you're a bookseller and have in stock 25 copies of Semantic Web for the Working Ontologist and 27 copies of Programming the Semantic Web), then you might actually be interested in representing individual editions of books, on which the title, ISBN, and the like would probably be stored on the edition, not the book individual.
This is just an opinion, and you really do have a lot of flexibility in choosing your data model. It typically takes some experience to get nice data models, and experience takes time. Even so, you've got good tools for manipulating and transforming the data, so you can experiment with different representations, and map from one to the other.
An example of the consequences of choosing one or the other
I suggest you take a look at the RDF Primer. Resources and literals are distinct types of things. Resources are anonymous or identified by an IRI, and can be the subjects of statements (and thus be member of classes, by virtue of the statement
Literals, such as the string
"Herman Melville
" cannot be the subjects of sentences, and so cannot be members of classes. With authors as resources (individuals), you can doIn this case,
hasAuthor
is an object property andhasName
is a datatype property.On the other hand, you can make
hasAuthor
a datatype property and instead doIf you do this, though, then you don't have a convenient way to add any additional information about the author, since the literal
"Herman Melville"@en
cannot be the subject of a triple, so you can't for instance, saywhereas in the first case, you could say
It's really just a matter of how you want to be able to query your data. In the case that
hasAuthor
is an object property, I can write a query like this to find books written by authors who lived at Arrowhead:or even more concisely (but equivalently):
On the otherhand, if
hasAuthor
is a datatype property that relates a book to the name of its author, we can still have anAuthor
class whose instances are related to their names by thehasName
property, but it makes querying the data a bit more complicated, since thehasAuthor
property is forcing a layer of indirection (get the name of the author of the book, then find the author who has that name), so we have queries like:This query can't be simplified so nicely. It really comes down to how you want to be able to query your data, and what's convenient for you. Note that some queries that you can write in SPARQL are much harder to write as OWL DL expressions. When
hasAuthor
is an object property, the class of books whose authors lived at Arrowhead with is given by the expression:which simply is the class of things that have an author that lived at Arrowhead. If
hasAuthor
is a datatype property, it is much more difficult, if not impossible to write such an expression, because you need to find two things (a book and an author) that have the same literal value (the string that is the author's name).