7

in RDF a statement is represented with S,P and O; In OWL the owl:ObjectProperty represents the predicate logic.

 (S) (P) (O)   
  I like dog

<owl:Class rdf:about="Person" />
<owl:NamedIndividual rdf:about="I">
    <rdf:type rdf:resource="Person"/>
    <like rdf:resource="Dog"/>
</owl:NamedIndividual>

<owl:Class rdf:about="Pet" />
<owl:NamedIndividual rdf:about="Dog">
    <rdf:type rdf:resource="Pet"/>
</owl:NamedIndividual>

<owl:ObjectProperty rdf:about="like">
    <rdfs:domain>
        <owl:Restriction>
            <owl:onProperty rdf:resource="like"/>
            <owl:someValuesFrom rdf:resource="Person"/>
        </owl:Restriction>
    </rdfs:domain>
    <rdfs:range>
        <owl:Restriction>
            <owl:onProperty rdf:resource="like"/>
            <owl:someValuesFrom rdf:resource="Pet"/>
        </owl:Restriction>
    </rdfs:range>
</owl:ObjectProperty>

But how about to describe "the degree" I like dogs? How can I give a property or value to a predicate? One solution I got is to extend one (S,P,O) statement to 3 statements. For example,

(S)             (P)        (O) 
 Person       isSrcOf    LikeRelation
 Pet          isTargetOf LikeRelation
 LikeRelation hasValue   [0~100]

It should work but obviously it will let ontology 3 times bigger :(

I appreciate any suggestion!

rnd_nr_gen
  • 2,203
  • 3
  • 36
  • 55

4 Answers4

7

I wouldn't use RDF reification, not in this case and almost not in any case. RDF reification just makes the things always more complicated. As you commented it will inflate your ontology, but not just that, it'll also make your ontology very difficult for applying OWL reasoning.

I've dealt with the same scenario that you've presented and most of times I've ended up with the following design.

(S) (P) [ (P) (O) (P) (O)]
I like [ 'what I like' Dog , 'how much I like it' 'a lot']

Class: LikeLevel //it represents class of things a person likes with a degree factor.

ObjectProperty: likeObject
    Domain: LikeLevel
    Range: Pet //(or Thing)

ObjectProperty: likeScale
    Domain: LikeLevel
    Range: xsd:int //(or an enumeration class i.e: 'nothing', 'a bit', 'very much',...)

ObjectProperty: like
    Domain: Person
    Range: LikeLevel

If you want to represent some instance data with this model (in RDF/Turtle syntax):

:I :like [ a :LikeLevel; 
   :likeObject :dogs;
   :likeScale 5.7] . 

In this case I'm creating a blank node for the object LikeLevel but you could create a ground object as well, sometimes you might want/need to avoid bNodes. In that case:

:I :like :a0001 .
:a0001 a :LikeLevel; 
   :likeObject :dogs;
   :likeScale 5.7.

This design can be consider a light case of reification, the main difference with RDF reification is that keeps the ontology design in the user's model.

Manuel Salvadores
  • 16,287
  • 5
  • 37
  • 56
  • 6
    Despite what you claim, your answer still effectively uses reification by *reifying* the `like` relationship to a first-order entity called `LikeLevel` (a _concept_), allowing you to attach attributes to the relationship itself, like the object (`Pet`) and 'scale' (integer value). This is generally the correct approach, and is called _reification_. –  Sep 10 '10 at 00:00
  • Also, your claim that reification (in this case) makes it difficult to perform OWL reasoning is _incorrect_. Note that reification doesn't only apply to the transformation of RDF triples s-p-o to the three triples r-s, r-p, r-o, which does in fact makes OWL reasoning difficult, but *not* in this circumstance where the only reification is of a single property in the model. –  Sep 10 '10 at 00:01
  • 2
    @rati you might be right what I have done could be considered reification as in the general term reification for computer science. But is not pure RDF reification, where rdf:subject, rdf:predicate and rdf:object are used (see http://www.w3.org/TR/rdf-mt/#ReifAndCont). I meant that reasoning is difficult to perform when using RDF reification, mostly because one should always consider a level of indirection/abstraction that is out of the user's data model. As opposite my solution keeps the design in the user's data model. – Manuel Salvadores Sep 10 '10 at 08:23
  • @rati @elgcom answer edited to explicitly state RDF reification. – Manuel Salvadores Sep 10 '10 at 08:27
  • 1
    @msalvadores; I agree that _RDF reification_ is completely inappropriate in this case, and that your solution here applies _property reification in the OWL TBox_ to correctly address the problem. (+1) –  Sep 10 '10 at 09:05
  • @sharky @elgcom @rati just to follow up on this question I think is worth looking at these two recent discussions from the semantic web email list. http://lists.w3.org/Archives/Public/semantic-web/2010Sep/0202.html http://lists.w3.org/Archives/Public/semantic-web/2010Sep/0155.html – Manuel Salvadores Sep 28 '10 at 08:43
2

Your suggestion is a valid one; it is called reification and is the standard way of representing properties inherent to a relationship between two items in an ontology or RDF graph, where statements are made in a pairwise manner between items - it is a limitation of the data model itself that makes reification necessary sometimes.

If you're worried that reification will inflate your ontology, you could try the following instead, but are generally less desirable and come with their own problems:

  1. Create specific properties, such as somewhatLikes, doesntLike, loves; this may be suitable if you have a limited set of alternatives, and don't mind creating the extra properties. This becomes tedious and cumbersome (and I'd go so far as to suggest incorrect) if you intend to encode the 'degree of likeness' with an integer (or any wide range of alternatives) - following this approach, you'd have properties like likes0, likes1, ..., likes99, likes100. This method would also preclude querying, for example, all dogs that a person likes within a range of degree values, which is possible in SPARQL with the reification approach you've specified, but not with this approach.
  2. Attach the likesDogs property to the Person instance, if the assertion can be made against the person onto all types/instances of Dog, and not individual instances. This will, of course, be dependent of what you're trying to capture here; if it's the latter, then this also won't be appropriate.

Good luck!

1

I think @msalvadores gets it wrong.

Let's forget about the dogs and likes. What we are really doing here is:

a x b
axb y c
axb z d

where axb is the identifier of the a x b statement, a, b, c, d are subjects or objects and x, y, z are predicates. What we need is binding the a, x, b resources to the axb statement somehow.

This is how reification does it:

axb subject a
axb predicate x
axb object b

which I think is very easy to understand.

Let's check what msalvadores does:

:I :like [ a :LikeLevel; 
   :likeObject :dogs;
   :likeScale 5.7] . 

we can easily translate this to axb terms

a x w
w type AxbSpecificObjectWrapper
w object b
w y c

which is just mimicking reification with low quality tools and more effort (you need a wrapper class and define an object property). The a x w statement does not makes sense to me; I like a like level, which objects are dogs???

But how about to describe "the degree" I like dogs?

There are 2 ways to do this as far as I can tell with my very limited RDF knowledge.

1.) use reification

stmt_1
    a LikeStatement
    subject I
    predicate like
    object dogs
    how_much "very much"

2.) instantiate a predicate class

I like_1 dogs
like_1
    a Like
    how_much "very much"

It depends on your taste and your actual vocab which one you choose.

How can I give a property or value to a predicate?

I don't think you understand the difference between a predicate and a statement. A great example about it is available here: Simple example of reification in RDF

Tolkien wrote Lord of the rings
Wikipedia said that

The statement here:

that: [Tolkien, wrote, LotR]

If we are making statements about the statement, we write something like this:

[Wikipedia, said, that]

If we are making statements about the predicate then we write something like this:

[Wikipedia, said, wrote]

I think there is a big difference. Reification is about making statements about statements not about predicates...

Community
  • 1
  • 1
inf3rno
  • 24,976
  • 11
  • 115
  • 197
0

A sentence from Jena's document just catch my eye.

...OWL Full allows ... state the following .... construction:

<owl:Class rdf:ID="DigitalCamera">
  <rdf:type owl:ObjectProperty />
</owl:Class>
..

does OWL Full really allow an ObjectProperty be a Class as well? If an ObjectProperty could be a Class, and could have individuals then I could describe a statement with

S_individual P_individual O_individual

and I could have further properties on P_individual. Is it right? or am I missing some points?

since the following RDF is valid, a corresponding OWL should be achievable.

<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:j.0="http://somewhere/" > 

  <rdf:Description rdf:about="http://somewhere/Dog_my_dog">
    <j.0:name>Lucky</j.0:name>
  </rdf:Description>
  <rdf:Description rdf:about="http://somewhere/like_dog">
    <j.0:degree>80</j.0:degree>
  </rdf:Description>

  <rdf:Description rdf:about="http://somewhere/Cat_my_cat">
    <j.0:name>Catty</j.0:name>
  </rdf:Description>
  <rdf:Description rdf:about="http://somewhere/like_cat">
    <j.0:degree>86</j.0:degree>
  </rdf:Description>

  <rdf:Description rdf:about="http://somewhere/Person_I">
    <j.0:name>Bob</j.0:name>
    <j.0:like_dog rdf:resource="http://somewhere/Dog_my_dog"/>
    <j.0:like_cat rdf:resource="http://somewhere/Cat_my_cat"/>
  </rdf:Description>

</rdf:RDF>
rnd_nr_gen
  • 2,203
  • 3
  • 36
  • 55
  • RDF/XML syntax is very difficult to read I recommend you to write your posts and comments using RDF/Turtle or Manchester Syntax. They are much easier to understand/. – Manuel Salvadores Sep 09 '10 at 15:47
  • what happens if catty likes dogs with a different degree than bob ? Your degree of confidence is attached to the property therefore you would not be able to have different degrees. Apart from that you'd need to have multiple properties for everything that a person might like. – Manuel Salvadores Sep 09 '10 at 15:51
  • @msalvadores: so the idea is letting predicate "Like" as a Class, and declaring its individual for every "Like"-relation. Can I have a Bnode for a "predicate" in RDF? – rnd_nr_gen Sep 09 '10 at 16:22
  • @msalvadores: of course I am not sure the idea is a good practice. In my application the "relation" (e.g. like) is much important than subject or object. Therefore I would like to model them so that I can easily traverse or query those relations. – rnd_nr_gen Sep 09 '10 at 16:32
  • bNodes as predicates ? I don't think so. You wouldn't be able to reference them. – Manuel Salvadores Sep 10 '10 at 09:00
  • Suppose you have an owl:ObjectProperty instance named . Can't you have another instance where rdfs:subClassOf ? Then give the root () some properties that would be given to all of the instances (that have rdfs:subClassOf ) that are skos:narrowerTransitive to in a sense (or descendants)? You could have LIKE DEGREES given that way. Then you just choose which property in that property tree of owl:ObjectProperty instances (that share the same rdf:Property instances) for customization. – JustBeingHelpful Dec 16 '13 at 07:36
  • Isn't that legal and much cleaner than having a huge graph of instances from @msalvadores answer? – JustBeingHelpful Dec 16 '13 at 07:41