commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (COMMONSRDF-55) Stream of Jena quads use wrong IRI for default graph
Date Mon, 06 Feb 2017 14:23:42 GMT


ASF GitHub Bot commented on COMMONSRDF-55:

Github user stain commented on the issue:
    The thing is a Commons RDF `JenaQuad` has in a way two feet into Jena - the underlying
Jena `Quad` as well as the underlying `Node` instances (which would be wrapped as `RDFTerm`
    So the challenge is that it's also possible to make a Commons RDF `JenaQuad` using both
adapting a quad from Jena (as when being retrieved from the Dataset), as well as composed
from `RDFTerm` instances with the `JenaRDF.createQuad(g,s,p,o)` method -- such constructing
will currently keep fields for the Commons RDF wrappers of the `RDFTerm`s optional(g),s,p,o,
and only make the underlying Jena-backed `Quad` on-demand on first call to [asJenaQuad](
    Commons RDF methods like `.equals()` and `.hashCode()` then use the individual graph/subject/predicate/object
`RDFTerm` fields which are always initialized - thus from the Commons RDF side in a way the
Quad object is ready-already, while it's Jena-nature might be incomplete until needed (e.g.
being added to a Dataset).
    Currently the constructor from a JenaQuad will unwrap to create the [RDFTerm g/s/p/o](
-- with this PR this would check Quad.isDefaultGraph() before unwrapping the graph name.
    It could in theory be done the other way, to keep the Jena-backed org.apache.jena.sparql.core.Quad
as the master backend field, and rather generate the `RDFTerm` wrappers on demand, in which
case first call to `getGraphName()` would simply check `isDefaultGraph()` -- but it would
make it trickier to keep `AbstractQuadLike` common for both `Quad` and `Triple`, as Jena's
`Quad` does not have a common superclass with Jena's `Triple`, there would be two alternate
fields for the master (or a more complicated abstract class hierarchy).

> Stream of Jena quads use wrong IRI for default graph
> ----------------------------------------------------
>                 Key: COMMONSRDF-55
>                 URL:
>             Project: Apache Commons RDF
>          Issue Type: Bug
>          Components: jena
>    Affects Versions: 0.3.0
>            Reporter: Stian Soiland-Reyes
>            Assignee: Stian Soiland-Reyes
>             Fix For: 1.0.0
> See
> {code}
> org.apache.commons.rdf.jena.DatasetJenaTest
> streamLanguageTagsCaseInsensitive(org.apache.commons.rdf.jena.DatasetJenaTest)  Time
elapsed: 0.012 sec  <<< FAILURE!
> java.lang.AssertionError: expected:<<> <>
"Hello"@EN-GB <urn:x-arq:DefaultGraph>.> but was:<<>
<> "Hello"@en-GB .>
> {code}
> Jena uses the IRI `<urn:x-arq:DefaultGraph>` internally to represent the default
graph within datasets - we need to recognize that on the way out of a ``
and possibly in the `asQuad(JenaQuad)` converter and replace it with `Optional.empty()` so
the default graph appears the same across implementations.
> The `AbstractDatasetTest`  should be augmented to do more tests on the default graph,
including `.stream()`, `.iterate()`, `.contains()` and `.remove()`1.

This message was sent by Atlassian JIRA

View raw message