I'm using triples in my document properties, and my queries work great when
I'm working with the query console, either via a SPARQL query or a XQuery
with sem:sparql.

When I query with the Java API, though, I don't get any results for triples
stored in properties, only in documents.

My query is:

String sparqlSelect = "SELECT (COUNT(?p) as ?pCount) WHERE { ?s ?p ?o .}"
SPARQLQueryDefinition qdef1 = sparqlMgr.newQueryDefinition(sparqlSelect)
JsonNode jsonStrResults = sparqlMgr.executeSelect(qdef1, new
JacksonHandle()).get()

That returns a much smaller number then I expect.

I can reproduce the exact results with XQuery by setting the sem:store
option to "documents"

xquery version "1.0-ml";
import module namespace sem = "http://marklogic.com/semantics"; at
"/MarkLogic/semantics.xqy";
let $query := "SELECT (COUNT(?p) as ?pCount) WHERE { ?s ?p ?o .}"
return sem:sparql($query, (), (), sem:store("document"))

If I remove all the options from the sem:sparql, or change sem:store to
"any" I get a larger number, one that includes the unmanaged triples stored
in properties.

Can anyone tell me how to set the equivalent in the Java API so that I can
search all the triples, not just those in the documents?  I'm open to
making database configuration changes if that's required.

Thanks,

      Steve
_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to