Hi All

Can I just confirm my understanding of rdf:type.

I can, in RDF, define an instance of an RDFS class with URI 'myclassuri' as follows (RDF/XML):

 <rdf:Description rdf:about="mysubjecturi">
    ... Some Properties ...
    <rdf:type rdf:resource="myclassuri"/>
 </rdf:Description>

And then define an instance of this class, as the property of a subject, as follows:

 <rdf:Description rdf:about="myinstanceuri">
    <mysubjecturi rdf:resource="mysecondinstanceuri"/>
 </rdf:Description>

Correct? However, if I then do this, with another set of triples:

 <rdf:Description rdf:about="mythirdinstanceuri">
     <myinstanceuri rdf:resource="someotheruri"/>
 </rdf:Description>

Whilst this does define a valid set of triples, the property 'myinstanceuri' is invalid, because it does not have an rdf:type. Is this correct? i.e. it is not an object property defined with an rdf:type (either an RDFS property or an OWL property) and so cannot reference the subject with URI 'someotheruri'.

Is this correct?

Thank you for clarification

asked 01 Feb '13, 13:37

Markos101's gravatar image

Markos101
312
accept rate: 0%

edited 01 Feb '13, 13:46

Signified's gravatar image

Signified ♦
24.0k1623

@Markos101, welcome to the site! You might find the pointers at this link helpful:

http://answers.semanticweb.com/questions/14494/welcome-to-answerssemanticwebcom

In terms of highlighting syntax in posts, there's a number of options. My preferred method is to prefix syntax lines with four spaces (I'll edit this question for you).

I should add, the preview might hide XML tags (a bug in the platform), but they'll appear in the output. No need for entity escaping.

(01 Feb '13, 13:45) Signified ♦ Signified's gravatar image

@Signified - thanks for editing my post! I'll take a read of the notes.

(01 Feb '13, 14:02) Markos101 Markos101's gravatar image

First off, if you're new to RDF, please try to avoid RDF/XML as much as possible. It really is the worst syntax to look. Instead, try to look at examples involving N-Triples and/or Turtle. These syntaxes reveal the triple-nature of the RDF model, which is key to understanding it.

Also, I think it's always good practice to use examples in your examples whenever possible. :) That is, generally avoid using A or mysubjecturi ... instead use drinksWith or encounters or some concrete example. Your intent and your own understanding of an issue becomes a lot clearer then.

In any case,

I can, in RDF, define an instance of an RDFS class with URI 'myclassuri' as follows (RDF/XML):

Correct.

And then define an instance of this class, as the property of a subject, as follows:

Yes, you can do this. The implication then is that mysubjecturi is of type rdf:Property.

However, if I then do this, with another set of triples ... Whilst this does define a valid set of triples, the property 'myinstanceuri' is invalid, because it does not have an rdf:type.

RDF essentially has an Open World Assumption (OWA), which means that it never complains when data are missing where instead, it tries to fill in that missing data through semantics. In this case, the triples you provide are not formally a problem. In this case, myinstanceuri will be implied to be of type rdf:Property. It is never a problem on an RDF level to be missing any type of data (other than perhaps a datatype on a literal).

(On an OWL level, the issue is different. OWL has some expectations that you declare object-properties and datatype-properties and classes explicitly as such. However, that's a separate issue which is specific to OWL, not to RDF.)

Can I just confirm my understanding of rdf:type.

... your examples are a bit confusing in that you create a class whose instance is a property on a subject whose class ... I dunno. I got lost in the middle. There's nothing formally wrong with your examples, but they're sufficiently strange that I wonder if maybe you're still confused in some aspect of rdf:type and classes.

permanent link

answered 01 Feb '13, 14:03

Signified's gravatar image

Signified ♦
24.0k1623
accept rate: 37%

edited 01 Feb '13, 14:04

@Signified - thanks for that helpful answer.

I think your answer that it is implied that myinstanceuri is of type rdf:Property clears up my confusion, and the thing that driving me round in never ending circles of thought!

So, actually (and I'll use the same examples for clarity for now) given:

<rdf:Description rdf:about="myinstanceuri">
    <mysubjecturi rdf:resource="mysecondinstanceuri"/>
</rdf:Description>

And

 <rdf:Description rdf:about="mythirdinstanceuri">
     <myinstanceuri rdf:resource="someotheruri"/>
 </rdf:Description>

Implies:

 <rdf:Description rdf:about="myinstanceuri">
     <mysubjecturi rdf:resource="mysecondinstanceuri"/>
     <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
 </rdf:Description>

That clears it up - I didn't get the implication you highlight.

Appreciate your point on RDF/XML - only I'm writing a parser for RDF/XML at the moment, and it needs to take these implications into account. This confusion came up whilst I was considering what triples to generate from the rdf:Description container given the above kind of scenario.

(01 Feb '13, 14:20) Markos101 Markos101's gravatar image

(Converted above to a comment since it's not an answer to the original question.)

Sure no problem. That implication is given in the RDF semantics document and is supported by the rule rdf1.

http://www.w3.org/TR/rdf-mt/#RDFRules

And you have my commiserations on having to write an RDF/XML parser. (I also wrote one a while back.)

(01 Feb '13, 14:37) Signified ♦ Signified's gravatar image
1

I share Signified's advice in the beginning of his answer, his confirmation in the middle part, and his confusion at the end. :-)

(02 Feb '13, 16:07) Michael Schn... ♦ Michael%20Schneider's gravatar image

@Markos101 Is there a particular reason you are writing an RDF/XML parser? Is there not an existing one for your chosen platform/language?

(03 Feb '13, 16:14) Rob Vesse ♦ Rob%20Vesse's gravatar image
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:

×877

question asked: 01 Feb '13, 13:37

question was seen: 762 times

last updated: 03 Feb '13, 16:14