R3000
(R3000)
March 27, 2019, 5:19pm
1
My CSV looks like that:
sender,recipient,subject
u1,u10,"first-subject"
u2,u12,"second-subject"
u1,u12,"third-subject"
I am struggling to create a mapping ttl that would capture both row 2 and row 4. Currently I have:
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix sm: <tag:stardog:api:mapping:> .
:User-{recipient} a :Recipient ;
rdfs:label"{recipient}" .
:User-{sender} a :Sender ;
rdfs:label"{subject} sent by {sender}" ;
:subject "{subject}" ;
:recipient :User-{recipient} .
Attached picture shows created tripples and obviously a missing one: "fist-subject sent by u1"
jess
(Jess Balint)
March 27, 2019, 5:24pm
2
Hi Radu,
That looks odd indeed. If you duplicate the first line with data, are the proper triples generated?
Jess
R3000
(R3000)
March 27, 2019, 5:28pm
3
Yes - when duplicating the fist (i.e. second row)
sender,recipient,subject
u1,u10,"first-subject"
u1,u10,"first-subject"
u2,u12,"second-subject"
u1,u12,"third-subject"
No triples are added:
Successfully imported 0 triples into Test3
jess
(Jess Balint)
March 27, 2019, 5:35pm
4
What is the result of using data export
to export this database in Turtle format?
R3000
(R3000)
March 27, 2019, 5:41pm
5
Here it is:
@prefix stardog: <tag:stardog:api:> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
:User-u1 a :Sender ;
rdfs:label "first-subject sent by u1" , "third-subject sent by u1" ;
:subject "third-subject" , "first-subject" ;
:recipient :User-u12 , :User-u10 .
:User-u12 a :Recipient ;
rdfs:label "u12" .
:User-u2 a :Sender ;
rdfs:label "second-subject sent by u2" ;
:subject "second-subject" ;
:recipient :User-u12 .
:User-u10 a :Recipient ;
rdfs:label "u10" .
jess
(Jess Balint)
March 27, 2019, 5:42pm
6
Looks like your graphical output is not showing both of these labels.
R3000
(R3000)
March 27, 2019, 5:43pm
7
Indeed
Thank you - now i now how to export to ttl
R3000
(R3000)
March 27, 2019, 8:00pm
8
Is it possible to run a sparql update and convert the following:
rdfs:label "first-subject sent by u1" , "third-subject sent by u1"
;
to
rdfs:label "first-subject sent by u1 , third-subject sent by u1" ;
?
jess
(Jess Balint)
March 27, 2019, 8:08pm
9
Try this:
delete { ?node rdfs:label ?label }
insert { ?node rdfs:label ?newLabel }
where {
{ select ?node (group_concat(?label) as ?newLabel) {
?node rdfs:label ?label
} group by ?node }
?node rdfs:label ?label
}
R3000
(R3000)
March 28, 2019, 3:32pm
10
Jess,
Ok in the ttl export I see it by why is this query select * where{?s ?p ?o} not returning this label at all?
"third-subject sent by u1"
Thanks,
Radu
jess
(Jess Balint)
March 28, 2019, 3:38pm
11
Did you run the update statement? What labels are being returned?
R3000
(R3000)
March 28, 2019, 3:40pm
12
I ran it and the export looks like that now:
:User-u1 a :Sender ;
rdfs:label "first-subject sent by u1" ;
:subject "first-subject" ;
:recipient :User-u12 , :User-u10 .
:User-u12 a :Recipient ;
rdfs:label "u12" .
:User-u2 a :Sender ;
rdfs:label "second-subject sent by u2" ;
:subject "second-subject" ;
:recipient :User-u12 .
:User-u10 a :Recipient ;
rdfs:label "u10" .
R3000
(R3000)
March 28, 2019, 3:57pm
13
Never mind - it worked:
:User-u1 a :Sender ;
rdfs:label "first-subject sent by u1 third-subject sent by u1" ;
:subject "third-subject" , "first-subject" ;
:recipient :User-u12 , :User-u10 .
:User-u12 a :Recipient ;
rdfs:label "u12" .
:User-u2 a :Sender ;
rdfs:label "second-subject sent by u2" ;
:subject "second-subject" ;
:recipient :User-u12 .
:User-u10 a :Recipient ;
rdfs:label "u10" .
Visualization looks accurate now:
Thank you!
1 Like
system
(system)
Closed
April 11, 2019, 3:58pm
14
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.