Re: D2RQ and Revelytix semantics

Richard,


On Tue, Jul 27, 2010 at 6:38 AM, Richard Cyganiak <richard@cyganiak.de>wrote:

> Juan,
>
>
> On 27 Jul 2010, at 02:00, Juan Sequeda wrote:
>
>> D2RQ is *mostly* database-instance-only. If one uses an auto-generated
>>> mapping, one can optionally enable the generation of class and property
>>> definitions for the auto-generated class/property URIs. When the mapping
>>> author customizes the mapping and replaces the auto-generated URIs with
>>> URIs
>>> from shared vocabularies/ontologies, then these definitions are no longer
>>> needed.
>>>
>>
>> So this is where I think we need to clarify. AFAICT, ClassMap and
>> PropertyMap does the following
>>
>> ClassMap: x -> Class
>> PropertyMap: y -> Property (where it can be a datatype or object property)
>>
>
> Here's an example D2RQ ClassMap that maps to a shared vocabulary:
>
>    map:UserClassMap a d2rq:ClassMap;
>        d2rq:uriPattern "http://example.com/user/@@USER.ID@@";
>        d2rq:class foaf:Person;
>        .
>
> This means: The output RDF graph contains an RDF triple of the shape
>
>    <http://example.com/user/XXX> a foaf:Person .
>
> for each distinct value in the USER.ID column, where XXX is replaced with
> the respective value of USER.ID. That's all.
>
>
>  The database-instance-only mapping does not declare a class or property at
>> all.
>>
>
> What do you mean by "declaring" a class or property? You don't "declare"
> classes and properties in RDF, RDFS or OWL, the notion doesn't exist
> anywhere in the specs, so it's perhaps better to avoid the word "declare"
> here.
>

Yes, you are right. Apologies for confusion.

>
> Note that in the RDF Semantics [1],
>
>    ?s ?p ?o .
>
> implies
>
>    ?p a rdf:Property .
>
> and
>
>    ?s a ?o .
>
> imples
>
>    ?o a rdfs:Class .
>
> So, *every* RDF statement "declares" a property, and *every* rdf:type
> statement "declares" a class, because the use of a URI in the predicate
> position, or as an rdf:type, implicitly makes that URI a property or class,
> respectively.
>
> The difference between your "instance-only" and "instance-plus-schema"
> approaches is wether *additional* RDFS/OWL statements about the
> property/class, beyond the implicit typing as a property/class, are
> generated. Such as domain/range/quantity and the like.
>

I think there is a confusion. What you have just explained is about the
semantics of RDF... which is the output of a RDB2RDF system. The mapping
language should obviously not alter these semantics. However, this has
nothing to do with the semantics of the mapping language itself.

So what does a ClassMap and a PropertyBridge actually mean then?

In Revelytix there is the following :

:StudentCM a map:ClassMap
 map:source  db:Student;
 map:subjectString “http://.../student#Student<s_id>";
 map:class ex:Student

note that the ClassMap StudentCM has a source which is db:Student. The way I
understand this is that the relation db:Student is a class and we then get
RDF triples such as

http://.../student#Student<s_id> rdf:type ex:Student

which means that these are all instances of the ontological class
ex:Student. This to me means that ClassMap acts as a predicate that maps a
relation to an ontological class.

In D2RQ I don't see that you have the equivalent of a map:source. However,
the meaning of ClassMap is the same, I presume.

So the semantics of ClassMap and PropertyBridge are different than the
semantics of RDF. When I mean that we *declare* classes and properties, I
meant, we *declare* ClassMaps (classes) and PropertyBridges (properties)

Hope this clarifies what I meant

>
> Note that in the case of a mapping to shared vocabularies such as FOAF,
> your "instance-plus-schema" approach would generate statements about
> foaf:Person that contradict the FOAF spec, which is highly undesirable.


This is something to discuss then. I haven't thought about this yet. Could
you give an example.

>
>
>  For example, Triplify outputs triples without defining that something
>> is a class or something else is a property in the mapping language (SQL).
>>
>
> This is not true, see above. The triples generated by Triplify imply that
> certain URIs are classes and properties, thanks to RDF Semantics.
>

See above :)


>
> Best,
> Richard
>
> [1] http://www.w3.org/TR/rdf-mt/
>
>
>
>
>> However, a class and property definition does appear in
>> the database-instance-and-schema mapping.
>>
>>
>>
>>>
>>> There is no way to formally prove this because both
>>>
>>>> languages don't have existing defined semantics (right?)
>>>>
>>>>
>>> The semantics of the D2RQ language is defined by the implementation, and
>>> documented in the manual ;-)
>>>
>>> If you talk about *formally* defined semantics, you're right it doesn't
>>> have it.
>>>
>>
>>
>> Yes, I meant, that the semantics aren't formally defined.
>>
>>
>>>
>>> - Revelytix language has different ways of saying the same thing for sake
>>>
>>>> of
>>>> query optimization ( right?). (I personally believe this is something we
>>>> should avoid. Language and implementation details should be separate...
>>>> just
>>>> look at SQL)
>>>>
>>>>
>>> In D2RQ there are a number of instances where one can say the same thing
>>> in
>>> different ways. This is mostly for author convenience -- syntactic sugar.
>>>
>>>
>> Yes, we definitely need to have syntactic sugar, but I think (IMO) that
>> different syntaxes shouldn't imply issues in implementation
>>
>>
>>> Best,
>>> Richard
>>>
>>>
>>>
>>>
>>>
>>>  Looking forward to Alex's presentation tomorrow!
>>>>
>>>>
>>>> [1]
>>>>
>>>>
>>>> http://www.w3.org/2001/sw/rdb2rdf/wiki/Database-Instance-Only_and_Database-Instances-and-Schema_Mapping
>>>>
>>>> Juan Sequeda
>>>> +1-575-SEQ-UEDA
>>>> www.juansequeda.com
>>>>
>>>>
>>>
>>>
>

Received on Tuesday, 27 July 2010 12:02:22 UTC