Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I mix ontologies that describe the same object (using rdfa?)

Imagine I start using an ontology because it provides some useful vocabulary to describe an object I'm interested in, e.g. FOAF to describe a Person (me). I immediately run into two problems. I come across another ontology that also has vocabulary describing a Person.

Issue 1: Some of these terms are functionally equivalent or related, but I don't want to be bothered wrapping both ontologies around the same object,

<span property="foaf:name"><span property="dc:creator">Carl Boettiger</span></span>

Because that's cumbersome and seems to ignore the entire idea of linked data, which should presumably be smart enough to know that a dc:creator is also a foaf:person. So what's the correct way to to do this? How can I confirm the relationship between these objects (e.g. presumably not all foaf:person should be dc:creator. Is it said somewhere on the Semantic Web that dc:creator is a subset of foaf:person? Do I need to link to such a statement somehow? Can you point me to where?

Issue 2: The vocabulary in one ontology isn't sufficient for my purposes, so I need to use the vocabulary from another one. For instance, FOAF, to my knowledge, doesn't provide me a way to state my organization, location, or role (which GoogleSnippets seems to think are required fields to be a valid person). So I go and find a handy ontology, say the one that Google suggests, http://rdf.data-vocabulary.org, which has these terms. Now again I have the closely related problem of making sure that the two ontologies agree on what a person is:

<div typeof="foaf:Person">
  <span property="foaf:name">Carl Boettiger</span> is a <span property="v:role"> graduate student </span>
</div>

v:role has it's own idea of what it belongs to, a typeof="v:Person. Do I need to add this typeof declaration as well? Do I then need to do something to say it is the same as foaf:Person, and indeed that v:role and foaf:name both describe the same thing (me)?

Many thanks for clarifying my befuddlement.

like image 388
cboettig Avatar asked Oct 19 '12 23:10

cboettig


1 Answers

Be aware that foaf:Person is a type or class which in RDFa is expressed via the @typeof attribute. dc:creator, foaf:name, v:role on the other hand are properties which are placed in the @property attribute in RDFa. Typically you start by typing your object in your HTML (e.g. a Person) and then you give its attributes like name or role via properties. Types are usually starting with an upercase (foaf:Person), while properties start with a lowercase (foaf:name).

Issue 1: instead of adding a new span element for each new property, you can put all the properties inside the same property attribute separate with a space:

<span property="foaf:name dc:creator">Carl Boettiger</span>

Is it said somewhere on the Semantic Web that dc:creator is a subset of foaf:person?

First, the example is not really adequate, dc:creator being a property and foaf:Person a type, but let's imagine we're talking about foaf:Agent and foaf:Person, the foaf specification states that foaf:Person is a subclass of foaf:Agent: http://xmlns.com/foaf/spec/#term_Person - Vocabularies might define such relations. There are also cross vocabulary mappings which sometimes define the relations between classes and properties from various vocabs.

Do I need to link to such a statement somehow?

no, you typically don't have to do that.

Issue 2: note that http://rdf.data-vocabulary.org is deprecated in favor of the schema.org vocabulary: http://schema.org/docs/full.html and http://schema.rdfs.org/

Do I need to add this typeof declaration as well? Do I then need to do something to say it is the same as foaf:Person, and indeed that v:role and foaf:name both describe the same thing (me)?

In general when publishing data in HTML, you don't try to state equivalences between vocabularies, instead you publish with all the vocabulary terms that you think will be useful for the applications consuming your data, and it's easy to do so in RDFa since you can embed multiple types and properties inside a given @typeof or @property attribute.

<div typeof="foaf:Person v:Person">
  <span property="foaf:name v:name">Carl Boettiger</span> is a <span property="v:role"> graduate student </span>
</div>

Note that you can test your RDFa markup at http://rdfa.info/play/

like image 56
scor Avatar answered Sep 20 '22 12:09

scor