Francis M. Bacon
Francis M. Bacon

Reputation: 705

How to say this class should have this property in RDF?

I'm trying to read the RDF specs. I know what classes, properties and all that are.

But the spec does not seem to provide a way for me to say, for instance, that an object of type Person should have a first name, last name, etc. The spec seems to suggest that is out of scope of RDF.

Yet, when I look at Person in the FOAF database, they list all these properties the a person should have. Whats going on? How are they associating these properties with their Person class? Is it just natural language?

Upvotes: 1

Views: 299

Answers (2)

Joshua Taylor
Joshua Taylor

Reputation: 85873

enridaga's answer hits the major points of this. Just a few more comments though.

When I look at Person in the FOAF database, it lists all these properties that a Person should have.

No, it doesn't. It lists a bunch of properties that have foaf:Person (or a subclass of foaf:Person) as a domain. That means that if these properties are used with some resource as a subject, then that subject is a foaf:Person. E.g., from

<https://stackoverflow.com/users/1281433/> foaf:lastName "Taylor"@en

we can infer that the user (me!) is a foaf:Person. enridaga's answer described this, too. It may be instructive to note that the FOAF documentation says Properties include: before listing a bunch of properties with domain Person.

Whats going on? How are they associating these properties with their Person class? Is it just natural language?

No, it's the rdfs:domain property. RDFS doesn't specify any way to say that some resource must have a value for some property (aside from actually asserting a triple about that resource and property). In OWL, you can have axioms of the form (first in DL syntax, then in Manchester syntax):

Person ⊑ ∃knows.Person)
Person SubClassOf (knows some Person)

This says that every Person knows at least one Person. However, this is a logical axiom, not a data validation rule. This means that if you know something's a Person, then you know that somewhere there's a Person that that something knows. It doesn't say what it is, and it doesn't say that it has to be explicitly asserted somewhere. I.e., it's not a logical inconsistency if a given knowledgebase doesn't tell you what person some person knows.

Upvotes: 3

enridaga
enridaga

Reputation: 641

The RDF specification does not enforce any constraint on the properties that instances of a class must have. RDFS includes ways to "declare" the domain and range of a property. In other words. It allows to specify that, if a given resource has a given property then it is of a certain type:

foaf:knows a rdf:Property ;
           rdfs:domain foaf:Person .

<enridaga> foaf:knows <alexdma> .

From the above, it can be inferred that:

<enridaga> rdf:type foaf:Person .

OWL specifies more fine grained methods to express features of classes and properties. However, all these specifications refer to ways to "specify" features. It is up to concrete programs to exploit them, and materialize inferrable triples or eventually perform constraint checks.

The FOAF documentation you refer to lists the properties that declare foaf:Person as the domain class of the relation.

Upvotes: 4

Related Questions