Jan Martin Keil created JENA-2169:
-------------------------------------

             Summary: Dataset interface should support blank node labels for 
graphs
                 Key: JENA-2169
                 URL: https://issues.apache.org/jira/browse/JENA-2169
             Project: Apache Jena
          Issue Type: Improvement
            Reporter: Jan Martin Keil


The Recommendations [RDF 1.1 
TriG|https://www.w3.org/TR/trig/#sec-graph-statements] and [RDF 1.1 
N-Quads|https://www.w3.org/TR/n-quads/#simple-triples] permit blank nodes as 
graph labels in datasets. However, this is not supported in Apache Jena. To add 
support for blank node labels, the interface 
{color:#0747a6}{{org.apache.jena.query.Dataset}}{color} and it's implementing 
classes would need new methods corresponding to the following methods:
 * {color:#0747a6}{{public Model getNamedModel(String uri)}}{color} -> e.g. 
{color:#0747a6}{{public Model getLabeledModel(Resource label)}}{color}
 * {color:#0747a6}{{public Dataset addNamedModel(String uri, Model 
model);}}{color} -> e.g. {color:#0747a6}{{public Dataset 
addLabeledModel(Resource label, Model model);}}{color}
 * {color:#0747a6}{{public Dataset removeNamedModel(String uri);}}{color} -> 
e.g. {color:#0747a6}{{public Dataset removeLabeledModel(Resource 
label);}}{color}
 * {color:#0747a6}{{public Dataset replaceNamedModel(String uri, Model 
model);}}{color} -> e.g. {color:#0747a6}{{public Dataset 
replaceLabelesModel(Resource label, Model model);}}{color}
 * {color:#0747a6}{{public Iterator<String> listNames()}}{color} -> e.g. 
{color:#0747a6}{{public Iterator<Resource> listGraphLabels()}}{color}

This has real *use cases*: If labeled graphs are used to track the provenance 
of statements, as e.g. proposed in the Working Group Note [Data on the Web Best 
Practices: Data Quality Vocabulary|https://www.w3.org/TR/vocab-dqv/], minting 
an URL is not always appropriate. The current *workaround* is to mint a IRI, 
e.g. based on an UUID.
 However, there might also be *drawbacks*: The [SPARQL 1.1 
Recomendation|https://www.w3.org/TR/sparql11-query/#rGraphRef] permits only 
IRIs as graph labels. Graphs with blank node labels might become inaccessible 
within SPARQL. But that is probably (didn't test it yet) the same situation as 
after importing TriG or N-Quads files with blank node graph labels. (A 
shortcoming of SPARQL 1.1 worth to put on [https://github.com/w3c/sparql-12]?)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to