[Fedora-commons-users] Sparql CONSTRUCT query with blank node fails

Subject:   [Fedora-commons-users] Sparql CONSTRUCT query with blank node fails (more for this subject)
From:   Egbert Gramsbergen <E dot F dot Gramsbergen at tudelft dot nl> (more from this sender)
Date:   May 17, 2010 06:05

The following query:

PREFIX dc:   <http://purl.org/dc/elements/1.1/>
PREFIX dct:  <http://purl.org/dc/terms/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
CONSTRUCT {
  ?x dct:creator [foaf:name ?z].
}
WHERE
{
  ?x dc:creator ?z.
}

gives an error
java.lang.IllegalArgumentException: Failed to constrain all variables: $*0 not constrained in WHERE or GIVEN clauses
at org.mulgara.query.Query.(Query.java:176)

Also, when I spell out the blank node:

PREFIX dc:   <http://purl.org/dc/elements/1.1/>
PREFIX dct:  <http://purl.org/dc/terms/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
CONSTRUCT {
  ?x dct:creator _:c.
  _:c foaf:name ?z.
}
WHERE
{
  ?x dc:creator ?z.
}

the same error
java.lang.IllegalArgumentException: Failed to constrain all variables: $_:c not constrained in WHERE or GIVEN clauses.

As far as I can see, this is all legal Sparql, http://www.w3.org/TR/rdf-sparql-query/

Any suggestions?




------------------------------------------------------------------------------

_______________________________________________
Fedora-commons-users mailing list
Fedora-commons-users at lists dot sourceforge dot net
https://lists.sourceforge.net/lists/listinfo/fedora-commons-users
Entire Thread (Showing 4 of 6)