rdf - SPARQL insert query not inserting -
when run sparql update:
insert { graph <n4> { ?s foaf:firstname ?o } } { graph <n1> { ?s foaf:familyname ?o . ?o foaf:familyname ?x } }
although syntactically fine, no results. because ?s
insert clause can not bound ?s
, ?o
simultaneously?
your query syntactically fine sparql, patterns match probably, in cases, aren't legal rdf. in particular, it's unlikely pattern:
?s foaf:familyname ?o . ?o foaf:familyname ?x
will ever match data. value of ?o
string, rdf literal, , literals cannot subjects of triples in rdf, it's unlikely ?o foaf:familyname ?x
can ever match. since means no triples match part of query, there's nothing insert. i'd suggest first run
select ?s ?o { graph <n1> { ?s foaf:familyname ?o . ?o foaf:familyname ?x } }
to see values of ?s
, ?o
available insert. expect won't see results, , that's why you're not inserting triples n4
.
as particular question asked,
is because
?s
insert clause can not bound?s
,?o
simultaneously?
there's no issue simultaneous bindings. part of query produces (possibly empty) set of results, each of binds ?s
, ?o
, , ?x
. then, each solution, values of ?s
, ?o
used construct triple value-of-s foaf:firstname value-of-o
, of triples inserted n4
. nothing getting inserted n4
because set of results empty (for reasons described above).
Comments
Post a Comment