Hi I'm composing an ontology and my purpose is to extend foaf:Person by adding new properties to it What is the best way to do so: Is it by:

Defining a new subclass of foaf:Person called my:Person and make it a domain of the new properties

Or by directly making foaf:Person the domain of my new properties?

Thanks

asked 08 Jan '12, 02:15

Mutaz's gravatar image

Mutaz
161124
accept rate: 0%

edited 08 Jan '12, 16:50

tobyink's gravatar image

tobyink ♦
5.2k312


There is no need to create a new class. That's kind of the whole reason the Semantic Web uses URIs as identifiers - it allows terms defined in one ontology to be directly reused in another.

permanent link

answered 08 Jan '12, 04:12

tobyink's gravatar image

tobyink ♦
5.2k312
accept rate: 26%

So you mean I only need to define my new properties on the domain foaf:Person? In this case why sioc:UserAccount is subclassing foaf:OnlineAccount? They could do the same and make foaf:OnlineAccount the domain of the new properties instead of defining sioc:UserAccount and make it the domain. Could you please explain what the difference is?

(08 Jan '12, 04:42) Mutaz Mutaz's gravatar image

sioc:UserAccount has a narrower meaning than foaf:OnlineAccount. sioc:UserAccount is defined as "a user account in an online community site" whereas foaf:OnlineAccount also covers accounts at banking sites, e-commerce sites, etc, which are arguably not online communities. Personally though, I would never cite SIOC as an example of good practice in schema design.

(08 Jan '12, 05:29) tobyink ♦ tobyink's gravatar image

Please check the answer

(08 Jan '12, 06:05) Mutaz Mutaz's gravatar image

So I understand if I want to add domainName to sioc:Site I should do the following:

<owl:DatatypeProperty rdf:about="http://example.com/ont#domainName">
<rdfs:domain rdf:resource="http://rdfs.org/sioc/ns#Site"/>
<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
</owl:DatatypeProperty>

Without the need for subclassing sioc:Site, right? Does this affect inferencing and applying semantic web technologies in the future versus defining my own subclasses and having them in the property domain?

permanent link

answered 08 Jan '12, 05:59

Mutaz's gravatar image

Mutaz
161124
accept rate: 0%

edited 08 Jan '12, 06:00

Yes, that should be fine. For OWL inferencing, you may also want to add a triple along the lines of { http://example.com/ont# owl:imports http://rdfs.org/sioc/ns# . }

(08 Jan '12, 06:25) tobyink ♦ tobyink's gravatar image

Thanks a bunch

(08 Jan '12, 06:35) Mutaz Mutaz's gravatar image

While you don't have to create a new class, you still CAN do so by giving some semantic constraints. So, going with your example of my:Person being a subclass of foaf:Person, let's say that you want each instance of my:Person to have a property my:hasFather with both (local) domain and range being my:Person. By "local", I mean that the range (and likewise the domain) is not a global feature of the property my:hasFather (something that you would express by an rdfs:range axiom), but it will only be inferrable for instances of class my:Person - the property my:hasFather may alternatively be used for things outside the class my:Person (such as animals), in which case the range of the property will be undetermined, unless specified elsewhere. You can get this behavior by the following subclass axioms:

(1)

# every my:Person is a foaf:Person
my:Person rdfs:subClassOf foaf:Person .

# every my:Person has exactly one father
# (not what you were asking for, but it makes some sense)
my:Person rdfs:subClassOf [
    owl:onProperty my:hasFather ;
    owl:cardinality "1"^^xsd:nonNegativeInteger ] .

# local range of my:hasFather: 
# the father of a my:Person is himself a my:Person
my:Person rdfs:subClassOf [
    owl:onProperty my:hasFather ;
    owl:allValuesFrom my:Person ] .

# local domain (what you were asking for!): 
# expressed by inverse property!
my:Person rdfs:subClassOf [
    owl:onProperty [ owl:inverseOf my:hasFather ] ;
    owl:allValuesFrom my:Person ] .

So, say you have within your data the triple

(2) my:alfred my:hasFather my:bob .

you will not immediately learn that my:alfred or my:bob are instances of my:Person. However, if you have the additional triple

(3a) my:alfred rdf:type my:Person .

then you will learn that my:bob is also a my:Person, as this is the local range of my:hasFather with regard to class my:Person. And, likewise, if you have the additional triple

(3b) my:bob rdf:type my:Person .

then you will learn that my:alfred is also a my:Person, as this is the local domain of my:hasFather with regard to class my:Person.

Things you should avoid:

  • Although quite obvious, it should be stated anyways: Do not make class foaf:Person a subclass of any of the given restriction class expressions (neither the owl:cardinality nor the owl:allValuesFrom expressions), as this would change the intended meaning of class foaf:Person: Suddenly, every foaf:Person will have some my:hasFather relationship!

  • Less obvious: Also do not make those restriction class expressions subclasses of foaf:Person, with the idea to have them "in the middle" between foaf:Person and my:Person, as this would have the semantic side effect that every individual that can be inferred to have either exactly one or zero(!) properties my:hasFather will become a foaf:Person.

permanent link

answered 09 Jan '12, 10:08

Michael%20Schneider's gravatar image

Michael Schn... ♦
6.2k1712
accept rate: 34%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×632
×93
×79
×29
×3

question asked: 08 Jan '12, 02:15

question was seen: 21,132 times

last updated: 09 Jan '12, 10:08