Why no, an n:m table expresses relationships between the records of two other 
tables, so its most natural mapping is to one *triple* per row;  and that's 
indeed what D2RQ's generate-mapping does.

Best,
Richard


On 27 Apr 2012, at 04:55, Diogo Patrão wrote:

> Hi Richard
> 
> Thanks, that was really helpful!
> 
> In a rdb, a n to m table would be mapped to blank nodes; think of a table 
> with only two columns, person-id-1 and person-id-2, both are the "multiple 
> primary key" and its rows would be translated to rdf as follows:
> 
> 
> 
> John :knows Paul
> John :knows George
> George :knows Paul
> 
> Am I doing it right?:)
> 
> 
> --
> Diogo F.C. Patrão
> 
> 
> Em 26/04/2012, às 18:55, Richard Cyganiak <[email protected]> escreveu:
> 
>> Hi Diogo,
>> 
>> On 26 Apr 2012, at 21:46, Diogo Patrão wrote:
>>> Like, when you have an assertion saying that "every member of class A with 
>>> property p equals to something is also a member of class B", this assertion 
>>> wou
>>> D be a blank node?
>> 
>> A blank node is an existential quantifier. It says, “something exists”, 
>> without mentioning a name or identifier for the thing.
>> 
>> For example, consider this RDF triple (without blank nodes):
>> 
>> :Alice :knows :Bob .
>> 
>> It consists of three URIs (abbreviated as prefixed names here). It means: 
>> “There is some thing named with the identifier :Alice. There is some thing 
>> named with the identifier :Bob. There is also some relationship named with 
>> the identifier :knows, and :Alice and :Bob are in that relationship.” (And 
>> hopefully you have some additional RDF triples that explain what those two 
>> things and the relationship are.)
>> 
>> Now consider this RDF triple (with blank node):
>> 
>> :Alice :knows _:Bob .
>> 
>> It means: “There is some thing named with the identifier :Alice. There is 
>> also some relationship named with the identifier :knows. :Alice is in that 
>> relationship to something.”
>> 
>> The fact that the blank node is labelled “Bob” doesn't affect its meaning. 
>> The label only serves to connect multiple mentions of the same blank node in 
>> the same RDF file.
>> 
>> This has funny consequences such as this one:
>> 
>> :Alice :knows _:Bob .
>> :Alice :knows _:Charlie .
>> 
>> How many people does Alice know, according to this RDF graph? The answer is: 
>> At least one. Because it essentially just redundantly repeats the same thing 
>> twice: “Alice is in the :knows relationship to something. Alice is in the 
>> :knows relationship to something.” You can drop one of the triples without 
>> changing the meaning of the RDF graph.
>> 
>>> Richard, would you give an example of usage of blank nodes in d2r?
>> 
>> Given that most databases record information about things for which we have 
>> strong and explicit identifiers (the primary keys), I cann't really see so 
>> many situations where you'd merely want to assert the existence of 
>> “something” and not name it with a URI based on the identifier.
>> 
>> But there can of course always be various situations where the use of blank 
>> nodes is convenient or useful or justified or advantageous.
>> 
>> All the best,
>> Richard
>> 
>> 
>> 
>>> 
>>> --
>>> Diogo F.C. Patrão
>>> 
>>> 
>>> Em 26/04/2012, às 17:33, Richard Cyganiak <[email protected]> escreveu:
>>> 
>>>> Zach,
>>>> 
>>>> Blank node labels in RDF carry no meaning. Systematically renaming all 
>>>> blank nodes doesn't change anything. It is very common for RDF tools to 
>>>> freely change blank node labels. In the case of D2RQ, the blank node 
>>>> labels that you specify in the mapping are retained throughout the engine, 
>>>> but the Jena/ARQ serializers rename them when generating output.
>>>> 
>>>> If the actual label is important to you, then don't use a blank node.
>>>> 
>>>> (In fact, don't use blank nodes at all, unless you know what you're doing. 
>>>> Almost no one understands them.)
>>>> 
>>>> Best,
>>>> Richard
>>>> 
>>>> 
>>>> On 26 Apr 2012, at 20:45, Zach Schweinfurth wrote:
>>>> 
>>>>> I have been working on some blank node mappings for the sp2 database. My 
>>>>> mappings are below. As best I can tell d2r seems to be ignoring the 
>>>>> table.column I specified for the relevant d2rq:bNodeIdColumns property. 
>>>>> The values for the Person.stringid column are values such as Paul_Edroes.
>>>>> 
>>>>> When I run, SELECT ?resourceid WHERE { ?resourceid a 
>>>>> <http://xmlns.com/foaf/0.1/Person> }  limit 10, to test the below 
>>>>> mapping, I am getting results back in that look like
>>>>> 
>>>>> _:b0, _:b1, etc. Based on the mapping, I was expecting the blank nodes to 
>>>>> look something like _:Paul_Edroes, etc.
>>>>> 
>>>>> Is the column specified in the d2rq:bNodeIdColumns used to create the 
>>>>> blank nodes? If so, is there something incorrect with my mapping that is 
>>>>> causing my blank nodes to be formed incorrectly?
>>>>> 
>>>>> Thanks.
>>>>> 
>>>>> 
>>>>> Mapping:
>>>>> 
>>>>> :Person_BlankNode_Map
>>>>>  a d2rq:ClassMap ;
>>>>>  d2rq:bNodeIdColumns "Person.stringid" ;
>>>>>  d2rq:class foaf:Person ;
>>>>>  d2rq:dataStorage :SP2_Database ;
>>>>> .
>>>>> -- 
>>>>> 
>>>>> Zach
>>>>> 
>>>>> ------------------------------------------------------------------------------
>>>>> Live Security Virtual Conference
>>>>> Exclusive live event will cover all the ways today's security and 
>>>>> threat landscape has changed and how IT managers can respond. Discussions 
>>>>> will include endpoint security, mobile security and the latest in malware 
>>>>> threats. 
>>>>> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/_______________________________________________
>>>>> d2rq-map-devel mailing list
>>>>> [email protected]
>>>>> https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel
>>>> 
>>>> 
>>>> ------------------------------------------------------------------------------
>>>> Live Security Virtual Conference
>>>> Exclusive live event will cover all the ways today's security and 
>>>> threat landscape has changed and how IT managers can respond. Discussions 
>>>> will include endpoint security, mobile security and the latest in malware 
>>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>>>> _______________________________________________
>>>> d2rq-map-devel mailing list
>>>> [email protected]
>>>> https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel
>>> 
>>> ------------------------------------------------------------------------------
>>> Live Security Virtual Conference
>>> Exclusive live event will cover all the ways today's security and 
>>> threat landscape has changed and how IT managers can respond. Discussions 
>>> will include endpoint security, mobile security and the latest in malware 
>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>>> _______________________________________________
>>> d2rq-map-devel mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel
>> 
> 
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> d2rq-map-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
d2rq-map-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel

Reply via email to