Re: Question about RDF collections
Thank you all for your help ! On 22 September 2016 at 14:20, Nikolaos Beredimaswrote: > Just remember that there is no ordering in this. > > [Document_A] --contains--> [Paragraph_1] > [Document_A] --contains--> [Paragraph_2] > [Document_B] --contains--> [Paragraph_2] > > is equivalent to > > [Document_A] --contains--> [Paragraph_2] > [Document_B] --contains--> [Paragraph_2] > [Document_A] --contains--> [Paragraph_1] > > > On Thu, Sep 22, 2016 at 3:14 PM, Laurent Rucquoy < > laurent.rucq...@telemis.com> wrote: > > > I have a "Document" resource which could contain many "Paragraph" > > resources. > > A same "Paragraph" resource could also be contained by different > "Document" > > resources. > > > > What is the most relevant model to translate such a case in RDF ? > > I have two solutions: > > > > Solution 1 (using RDF collections) > > [Document_A] --contains--> ( [Paragraph_1], [Paragraph_2] ) > > [Document_B] --contains--> ( [Paragraph_2] ) > > > > or > > > > Solution 2 (defining the same predicate several times on the same > subject) > > [Document_A] --contains--> [Paragraph_1] > > [Document_A] --contains--> [Paragraph_2] > > [Document_B] --contains--> [Paragraph_2] > > > > > > I think that the Solution 1 requires complex and resource-consuming > SPARQL > > update. > > So to keep it simple, I would choose the Solution 2. But, I don't know if > > it's safe and if it's a good practice to define the same predicate > several > > times on the same subject ? > > > > Thank you in advance for your help. > > > > Regards, > > Laurent > > >
Re: Question about RDF collections
Just remember that there is no ordering in this. [Document_A] --contains--> [Paragraph_1] [Document_A] --contains--> [Paragraph_2] [Document_B] --contains--> [Paragraph_2] is equivalent to [Document_A] --contains--> [Paragraph_2] [Document_B] --contains--> [Paragraph_2] [Document_A] --contains--> [Paragraph_1] On Thu, Sep 22, 2016 at 3:14 PM, Laurent Rucquoy < laurent.rucq...@telemis.com> wrote: > I have a "Document" resource which could contain many "Paragraph" > resources. > A same "Paragraph" resource could also be contained by different "Document" > resources. > > What is the most relevant model to translate such a case in RDF ? > I have two solutions: > > Solution 1 (using RDF collections) > [Document_A] --contains--> ( [Paragraph_1], [Paragraph_2] ) > [Document_B] --contains--> ( [Paragraph_2] ) > > or > > Solution 2 (defining the same predicate several times on the same subject) > [Document_A] --contains--> [Paragraph_1] > [Document_A] --contains--> [Paragraph_2] > [Document_B] --contains--> [Paragraph_2] > > > I think that the Solution 1 requires complex and resource-consuming SPARQL > update. > So to keep it simple, I would choose the Solution 2. But, I don't know if > it's safe and if it's a good practice to define the same predicate several > times on the same subject ? > > Thank you in advance for your help. > > Regards, > Laurent >
Re: Question about RDF collections
It is not only safe, but completely normal and used much, much more frequently than solution 1. Remember, RDF is a graph, so you can connect resource nodes however you like. Collection could be useful here if you want to maintain the ordering of Paragraphs in a Document. On Thu, Sep 22, 2016 at 2:14 PM, Laurent Rucquoywrote: > I have a "Document" resource which could contain many "Paragraph" resources. > A same "Paragraph" resource could also be contained by different "Document" > resources. > > What is the most relevant model to translate such a case in RDF ? > I have two solutions: > > Solution 1 (using RDF collections) > [Document_A] --contains--> ( [Paragraph_1], [Paragraph_2] ) > [Document_B] --contains--> ( [Paragraph_2] ) > > or > > Solution 2 (defining the same predicate several times on the same subject) > [Document_A] --contains--> [Paragraph_1] > [Document_A] --contains--> [Paragraph_2] > [Document_B] --contains--> [Paragraph_2] > > > I think that the Solution 1 requires complex and resource-consuming SPARQL > update. > So to keep it simple, I would choose the Solution 2. But, I don't know if > it's safe and if it's a good practice to define the same predicate several > times on the same subject ? > > Thank you in advance for your help. > > Regards, > Laurent
Re: Question about RDF collections
On Thu, Sep 22, 2016 at 8:14 AM, Laurent Rucquoywrote: > But, I don't know if > it's safe and if it's a good practice to define the same predicate several > times on the same subject ? It's absolutely fine. That's how, e.g., DBpedia stores abstracts in different languages: article dbpedia-owl:abstract "abstract in english"@en . article dbpedia-owl:abstract "abstract in french"@fr . article dbpedia-owl:abstract "abstract in italian"@it . -- Joshua Taylor, http://www.cs.rpi.edu/~tayloj/
Question about RDF collections
I have a "Document" resource which could contain many "Paragraph" resources. A same "Paragraph" resource could also be contained by different "Document" resources. What is the most relevant model to translate such a case in RDF ? I have two solutions: Solution 1 (using RDF collections) [Document_A] --contains--> ( [Paragraph_1], [Paragraph_2] ) [Document_B] --contains--> ( [Paragraph_2] ) or Solution 2 (defining the same predicate several times on the same subject) [Document_A] --contains--> [Paragraph_1] [Document_A] --contains--> [Paragraph_2] [Document_B] --contains--> [Paragraph_2] I think that the Solution 1 requires complex and resource-consuming SPARQL update. So to keep it simple, I would choose the Solution 2. But, I don't know if it's safe and if it's a good practice to define the same predicate several times on the same subject ? Thank you in advance for your help. Regards, Laurent