On 22/01/12 20:43, Benson Margulies wrote:
What I can share from the top of my head is the following. Perhaps I
can do a better job than usual of explaining myself. More likely, in
the process of explaining myself I'll solve the problem.
So, based on an input, I construct a statement, which is sitting in
stmt. By convention, if this statement exists, it is reified. All the
time disappears into the listReifiedStatements call below.
The problem for me is that the URI for an existing reified statement
can't be derived from the data available at this point as this code is
written. If I used my hashing idea to derive it instead of deriving it
from ephemeral information, I wouldn't need to call
listReifiedStatements! In other words, if I go on using 'real'
reification, but use the hash trick to derive the URI, I think all
will be swell. No need for partial reification or other abuses.
ReifiedStatement rstmt = null;
if (model.contains(stmt)) {
RSIterator reit = model.listReifiedStatements(stmt);
rstmt = reit.nextRS();
} else {
model.add(stmt);
String reUrl = RdfUtils.relationshipUri(docId, ordinal);
rstmt = model.createReifiedStatement(reUrl, stmt);
}
Maybe model.listReifiedStatements is considering too general a case , or
is just plain slow.
What about, assuming only complete reifications:
SELECT ?id { ?id rdf:subject SUBJ }
which can be an API call
model.listSubjectsWithProperty(rdf:subject, SUBJECT)
or
SELECT ?id {
?id rdf:subject SUBJ ;
rdf:predicate PRED ;
rdf:object OBJ
}
Andy