On 4/09/2020 02:39, Andy Seaborne wrote:
On 03/09/2020 00:40, Holger Knublauch wrote:
On 3/09/2020 07:44, Andy Seaborne wrote:
On 28/08/2020 02:12, [email protected] wrote:
I have have used the following to work around legacy issues with
RDF1.0/1.1:
JenaRuntime.isRDF11 = false;
This might be a good place to allow for a
JenaRuntime.isRDFStar = false;
The JenaRuntime.isRDF11 flag switches the semantics of Jena between
RDF 1.0 and RDF 1.1 (xsd:string, rdf:langString).
So it does not throw exceptions or reject any data or go wrong.
Presumably JenaRuntime.isRDFStar would cause an exception and crash
the "existing code" application? Or is the suggestion something
different to handle "new data, old code".
I think it would suffice if such a flag would be honored by the
parser(s), as an RDF* file is not a valid Turtle file by default.
Getting such RDF* triples into the system is what we would need to
prevent, and parsing would be the only way.
The best way for that is to add a StreamRDF to the parsing process.
This is much better than hardwiring a specific case. e.g.
* you may wish to translate to TQ RDF* format
* decide between warning and error and where to send messages
* decide between skip triples, substitute a term or throw a parser error
* allow RDF* terms in some places and not others.
* have better, more specific, reporting messages
* change what to do over time.
I certainly plan to migrate away from our hackish internal RDF*
representation to the official one from Jena. For this transition to
happen I believe an implementation of the syntax shortcuts currently
discussed on the rdf-star w3c mailing list {| ... |} or similar would be
required.
Holger
(SHACL is also a possibility but not for bulk data)
Andy
Holger
Andy
Cheers,
Claus
Quoting Holger Knublauch <[email protected]>:
It's good to see the recently introduced RDF* features in Jena.
But as someone with a lot of existing Jena code, this low-level
change poses a number of challenges. For example we have many of
places with variations of
if(rdfNode.isResource()) { if(rdfNode.isURIResource()) { } else {
// Here we now assume it's a blank node, yet this is no longer
true // and they node may also be a triple node } } else { // Must
be a literal - this hasn't changed }
which now need to be changed to handle rdfNode.isStmtResource()
too. And it should of course do so in a meaningful way.
I guess properly adjusting our code base will take many months,
and it will require a lot of testing and iterating.
In the meantime, is there a flag that we can set to deactivate
RDF* support in the parsers and SPARQL*? The page
https://jena.apache.org/documentation/rdfstar/ only states "it is
active by default in Fuseki" but doesn't show an API to do the
same programmatically.
Could you also give some background on the implications on TDB? I
guess if such new nodes end up in a database, then this database
can no longer work with older Jena versions?
Thanks
Holger