[jira] [Closed] (JENA-1876) Parsing json-ld in Jena and type : rdfs:container does not come through as a statement

2020-04-01 Thread David (Jira)


 [ 
https://issues.apache.org/jira/browse/JENA-1876?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David closed JENA-1876.
---
Resolution: Not A Problem

I am seeing the [http://www.w3.org/2000/01/rdf-schema#container] come through 
as a String as the object of the triple for type predicates. Closing the issue 

> Parsing json-ld in Jena and type : rdfs:container does not come through as a 
> statement  
> 
>
> Key: JENA-1876
> URL: https://issues.apache.org/jira/browse/JENA-1876
> Project: Apache Jena
>  Issue Type: Bug
>  Components: Base
>Reporter: David
>Priority: Major
>
> I have a jsonld file that I am parsing using Jena. The file has @type @id 
> "rdfs:label" and "rdfs:comment" and also ranges and domains. I have a test 
> java program like this
> {noformat}
> Model m = ModelFactory.createDefaultModel();
> Reader fileReader = new FileReader(fileName);
> Model model = m.read(fileReader, null, "JSON-LD");
> StmtIterator it = model.listStatements();
> Set set = new HashSet<>();
> System.out.println("Labels");
> while (it.hasNext()) {
> Statement statement = it.next();
> {noformat}
>  It seems to pick up all the content but does not see the @type 
> statements with rdfs:container. How do I pick up these statements using this 
> parser?
> A fragment of the json-ld is \{ "@id": "aaa:bbb", "@type": [ "rdfs:container" 
> ], "rdfs:label": { "@language": "en", "@value": "" }, "rdfs:comment": \{ 
> "@language": "en", "@value": "." }, "rdfs:member": [ \{ "@id": 
> ":" }, \{ "@id": ":f" } ],
> When the type is rdfs:class - I get a statement coming through with predicate 
> "type" and the object as the RDFClass, but when the type is rdfs:container - 
> as in the above example I do not get a statement through. I was expecting a 
> statement to come through with the predicate of "type" and a subject with 
> localName of bbb and an object specifying the container class. I do not see 
> such a statement. How to I detect in the parser that the presence of the 
> rdfs:container? The presence of the container tag is very meaningful for our 
> parser. We are looking at alternative ways of representing this sort of 
> information in the model because of this issue.  
> I notice Jena has the concept of Container : 
> [https://jena.apache.org/documentation/javadoc/jena/org/apache/jena/rdf/model/Container.html].
>  I can see write orientated methods that refer to this.  



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


[jira] [Commented] (JENA-1877) Wrong results for non-optimized query

2020-04-01 Thread Andy Seaborne (Jira)


[ 
https://issues.apache.org/jira/browse/JENA-1877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17073126#comment-17073126
 ] 

Andy Seaborne commented on JENA-1877:
-

Simple example:

{code}
SELECT (bnode("A") as ?X) (bnode("A") as ?Y)
WHERE { }
{code}
The same string.
The query is the same as:
{code}
SELECT ?X ?Y
WHERE { 
BIND (bnode("A") as ?X)
BIND (bnode("A") as ?Y)
}
{code}
and each {{BIND}} creates a new row when it adds it variable/value binding.


> Wrong results for non-optimized query
> -
>
> Key: JENA-1877
> URL: https://issues.apache.org/jira/browse/JENA-1877
> Project: Apache Jena
>  Issue Type: Bug
>  Components: ARQ
>Affects Versions: Jena 3.14.0
>Reporter: Jeremy Coulon
>Priority: Major
> Attachments: bnode01.rq, data.ttl
>
>
> I noticed that the attached query gives correct results with:
> {noformat}
> ./bin/arq --data=data.ttl --query=bnode01.rq --explain --optimize=on
> {noformat}
> while it gives wrong results with:
> {noformat}
> ./bin/arq --data=data.ttl --query=bnode01.rq --explain 
> --optimize=off{noformat}
> Without optimization, ARQ algebra has 2 different 'extend' op with 
> 'bnode(?s)' expression.
> With optimization, ARQ algebra merges these ops into a single op 'extend'.
>  
> I tried debugging and I think that 'E_BNode.evalSpecial()' takes the same 
> 'binding' object for each call in optimized mode but different 'binding' 
> objects for non-optimized mode. This function relies on reference-equality.
>  
> [^data.ttl]
> [^bnode01.rq]



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


[jira] [Commented] (JENA-1877) Wrong results for non-optimized query

2020-04-01 Thread Andy Seaborne (Jira)


[ 
https://issues.apache.org/jira/browse/JENA-1877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17072994#comment-17072994
 ] 

Andy Seaborne commented on JENA-1877:
-

Hi - thanks for the report with details and analysis.

I think the non-optimized is right-by-the-spec. Section 18.2.4.4 "SELECT 
Expressions"  nests one "extend" for each expression in the SELECT clause. 
SPARQL itself does not have an n-ary (extend).

The built-in no-frills execution engine agrees with the not-optimized version. 
It can be accessed with command line {{--engine=ref}}; it does not scale or 
have great performance.

It is possible to control the individual optimizer steps.  {{--set 
arq:optMergeExtends=false}} will switch off the transformation that is involved.


> Wrong results for non-optimized query
> -
>
> Key: JENA-1877
> URL: https://issues.apache.org/jira/browse/JENA-1877
> Project: Apache Jena
>  Issue Type: Bug
>  Components: ARQ
>Affects Versions: Jena 3.14.0
>Reporter: Jeremy Coulon
>Priority: Major
> Attachments: bnode01.rq, data.ttl
>
>
> I noticed that the attached query gives correct results with:
> {noformat}
> ./bin/arq --data=data.ttl --query=bnode01.rq --explain --optimize=on
> {noformat}
> while it gives wrong results with:
> {noformat}
> ./bin/arq --data=data.ttl --query=bnode01.rq --explain 
> --optimize=off{noformat}
> Without optimization, ARQ algebra has 2 different 'extend' op with 
> 'bnode(?s)' expression.
> With optimization, ARQ algebra merges these ops into a single op 'extend'.
>  
> I tried debugging and I think that 'E_BNode.evalSpecial()' takes the same 
> 'binding' object for each call in optimized mode but different 'binding' 
> objects for non-optimized mode. This function relies on reference-equality.
>  
> [^data.ttl]
> [^bnode01.rq]



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


Re: JIRA and questions

2020-04-01 Thread ajs6f
+1. Maybe this could even be automated to a button on Jira? If not, perhaps
we can leave the template in our wiki.

Adam

On Wed, Apr 1, 2020, 7:59 AM Bruno P. Kinoshita
 wrote:

> +1
>
> Sent from Yahoo Mail on Android
>
>   On Wed, 1 Apr 2020 at 22:38, Andy Seaborne wrote:
>  This is another not-an-issue question but sent to JIRA. It is not a bug,
> it is a question about how to use Jena. It is also unanswerable because
> of lack of detail.
>
> It is also a stackoverflow question from yesterday.
>
> This is the 3rd one in a week (one was actually about another system
> anyway) calling something a bug that are really about how to use Jena.
>
> Questions are not bugs.
> Neither are they "urgent".
> Often, the questioner does not respond and we get floating JIRA issues.
>
> They aren't going to get answered on JIRA so I think we should quickly
> close them for fear of getting swamped, referring to them to users@ e.g.
> boiler plate like:
>
> -
> Hi there,
>
> This is a question and is best sent to the Jena users mailing list.
>
> us...@jena.apache.org.
>
> You need to subscribe first, then respond to the verification email,
> then send your question:
>
> For details:
> https://jena.apache.org/help_and_support/index.html
> -
>
> Andy
>
> On 01/04/2020 10:01, David (Jira) wrote:
> > David created JENA-1876:
> > ---
> >
> >  Summary: Parsing json-ld in Jena and type : rdfs:container
> does not come through as a statement
> >  Key: JENA-1876
> >  URL: https://issues.apache.org/jira/browse/JENA-1876
> >  Project: Apache Jena
> >Issue Type: Bug
> >Components: Base
> >  Reporter: David
> >
> >
> > I have a jsonld file that I am parsing using Jena. The file has @type
> @id "rdfs:label" and "rdfs:comment" and also ranges and domains. I have a
> test java program like this
> >
> > Model m = ModelFactory.createDefaultModel();
> >
> >
> >
> > {{Reader fileReader = new FileReader(fileName);
> >  Model model = m.read(fileReader, null, "JSON-LD");
> >  StmtIterator it = model.listStatements();
> >  Set set = new HashSet<>();
> >
> >  System.out.println("Labels");
> >  while (it.hasNext()) {
> >  Statement statement = it.next();}}
> >
> >  It seems to pick up all the content but does not see the @type
> statements with rdfs:container. How do I pick up these statements using
> this parser?
> >
> > A fragment of the json-ld is \{ "@id": "aaa:bbb", "@type": [
> "rdfs:container" ], "rdfs:label": { "@language": "en", "@value": "" },
> "rdfs:comment": \{ "@language": "en", "@value": "." }, "rdfs:member": [
> \{ "@id": ":" }, \{ "@id": ":f" } ],
> >
> > When the type is rdfs:class - I get a statement coming through with
> predicate "type" and the object as the RDFClass, but when the type is
> rdfs:container - as in the above example I do not get a statement through.
> I was expecting a statement to come through with the predicate of "type"
> and a subject with localName of bbb and an object specifying the container
> class. I do not see such a statement. How to I detect in the parser that
> the presence of the rdfs:container? The presence of the container tag is
> very meaningful for our parser. We are looking at alternative ways of
> representing this sort of information in the model because of this issue.
> >
> > I notice Jena has the concept of Container : [
> https://jena.apache.org/documentation/javadoc/jena/org/apache/jena/rdf/model/Container.html].
> I can see write orientated methods that refer to this.
> >
> >
> >
> > --
> > This message was sent by Atlassian Jira
> > (v8.3.4#803005)
> >
>
>


[jira] [Created] (JENA-1877) Wrong results for non-optimized query

2020-04-01 Thread Jeremy Coulon (Jira)
Jeremy Coulon created JENA-1877:
---

 Summary: Wrong results for non-optimized query
 Key: JENA-1877
 URL: https://issues.apache.org/jira/browse/JENA-1877
 Project: Apache Jena
  Issue Type: Bug
  Components: ARQ
Affects Versions: Jena 3.14.0
Reporter: Jeremy Coulon
 Attachments: bnode01.rq, data.ttl

I noticed that the attached query gives correct results with:
{noformat}
./bin/arq --data=data.ttl --query=bnode01.rq --explain --optimize=on
{noformat}
while it gives wrong results with:
{noformat}
./bin/arq --data=data.ttl --query=bnode01.rq --explain --optimize=off{noformat}
Without optimization, ARQ algebra has 2 different 'extend' op with 'bnode(?s)' 
expression.

With optimization, ARQ algebra merges these ops into a single op 'extend'.

 

I tried debugging and I think that 'E_BNode.evalSpecial()' takes the same 
'binding' object for each call in optimized mode but different 'binding' 
objects for non-optimized mode. This function relies on reference-equality.

 

[^data.ttl]

[^bnode01.rq]



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


Re: JIRA and questions

2020-04-01 Thread Bruno P. Kinoshita
+1

Sent from Yahoo Mail on Android 
 
  On Wed, 1 Apr 2020 at 22:38, Andy Seaborne wrote:   This is 
another not-an-issue question but sent to JIRA. It is not a bug, 
it is a question about how to use Jena. It is also unanswerable because 
of lack of detail.

It is also a stackoverflow question from yesterday.

This is the 3rd one in a week (one was actually about another system 
anyway) calling something a bug that are really about how to use Jena.

Questions are not bugs.
Neither are they "urgent".
Often, the questioner does not respond and we get floating JIRA issues.

They aren't going to get answered on JIRA so I think we should quickly 
close them for fear of getting swamped, referring to them to users@ e.g. 
boiler plate like:

-
Hi there,

This is a question and is best sent to the Jena users mailing list.

us...@jena.apache.org.

You need to subscribe first, then respond to the verification email, 
then send your question:

For details:
https://jena.apache.org/help_and_support/index.html
-

    Andy

On 01/04/2020 10:01, David (Jira) wrote:
> David created JENA-1876:
> ---
> 
>              Summary: Parsing json-ld in Jena and type : rdfs:container does 
>not come through as a statement
>                  Key: JENA-1876
>                  URL: https://issues.apache.org/jira/browse/JENA-1876
>              Project: Apache Jena
>            Issue Type: Bug
>            Components: Base
>              Reporter: David
> 
> 
> I have a jsonld file that I am parsing using Jena. The file has @type @id 
> "rdfs:label" and "rdfs:comment" and also ranges and domains. I have a test 
> java program like this
> 
> Model m = ModelFactory.createDefaultModel();
> 
>  
> 
> {{    Reader fileReader = new FileReader(fileName);
>      Model model = m.read(fileReader, null, "JSON-LD");
>      StmtIterator it = model.listStatements();
>      Set set = new HashSet<>();
> 
>      System.out.println("Labels");
>      while (it.hasNext()) {
>          Statement statement = it.next();}}
> 
>  It seems to pick up all the content but does not see the @type 
> statements with rdfs:container. How do I pick up these statements using this 
> parser?
> 
> A fragment of the json-ld is \{ "@id": "aaa:bbb", "@type": [ "rdfs:container" 
> ], "rdfs:label": { "@language": "en", "@value": "" }, "rdfs:comment": \{ 
> "@language": "en", "@value": "." }, "rdfs:member": [ \{ "@id": 
> ":" }, \{ "@id": ":f" } ],
> 
> When the type is rdfs:class - I get a statement coming through with predicate 
> "type" and the object as the RDFClass, but when the type is rdfs:container - 
> as in the above example I do not get a statement through. I was expecting a 
> statement to come through with the predicate of "type" and a subject with 
> localName of bbb and an object specifying the container class. I do not see 
> such a statement. How to I detect in the parser that the presence of the 
> rdfs:container? The presence of the container tag is very meaningful for our 
> parser. We are looking at alternative ways of representing this sort of 
> information in the model because of this issue.
> 
> I notice Jena has the concept of Container : 
> [https://jena.apache.org/documentation/javadoc/jena/org/apache/jena/rdf/model/Container.html].
>  I can see write orientated methods that refer to this.
> 
> 
> 
> --
> This message was sent by Atlassian Jira
> (v8.3.4#803005)
> 
  


JIRA and questions

2020-04-01 Thread Andy Seaborne
This is another not-an-issue question but sent to JIRA. It is not a bug, 
it is a question about how to use Jena. It is also unanswerable because 
of lack of detail.


It is also a stackoverflow question from yesterday.

This is the 3rd one in a week (one was actually about another system 
anyway) calling something a bug that are really about how to use Jena.


Questions are not bugs.
Neither are they "urgent".
Often, the questioner does not respond and we get floating JIRA issues.

They aren't going to get answered on JIRA so I think we should quickly 
close them for fear of getting swamped, referring to them to users@ e.g. 
boiler plate like:


-
Hi there,

This is a question and is best sent to the Jena users mailing list.

us...@jena.apache.org.

You need to subscribe first, then respond to the verification email, 
then send your question:


For details:
https://jena.apache.org/help_and_support/index.html
-

Andy

On 01/04/2020 10:01, David (Jira) wrote:

David created JENA-1876:
---

  Summary: Parsing json-ld in Jena and type : rdfs:container does 
not come through as a statement
  Key: JENA-1876
  URL: https://issues.apache.org/jira/browse/JENA-1876
  Project: Apache Jena
   Issue Type: Bug
   Components: Base
 Reporter: David


I have a jsonld file that I am parsing using Jena. The file has @type @id "rdfs:label" 
and "rdfs:comment" and also ranges and domains. I have a test java program like this

Model m = ModelFactory.createDefaultModel();

  


{{Reader fileReader = new FileReader(fileName);
 Model model = m.read(fileReader, null, "JSON-LD");
 StmtIterator it = model.listStatements();
 Set set = new HashSet<>();

 System.out.println("Labels");
 while (it.hasNext()) {
 Statement statement = it.next();}}

 It seems to pick up all the content but does not see the @type statements 
with rdfs:container. How do I pick up these statements using this parser?

A fragment of the json-ld is \{ "@id": "aaa:bbb", "@type": [ "rdfs:container" ], "rdfs:label": { "@language": "en", "@value": "" }, "rdfs:comment": \{ 
"@language": "en", "@value": "." }, "rdfs:member": [ \{ "@id": ":" }, \{ "@id": ":f" } ],

When the type is rdfs:class - I get a statement coming through with predicate "type" and 
the object as the RDFClass, but when the type is rdfs:container - as in the above example I do not 
get a statement through. I was expecting a statement to come through with the predicate of 
"type" and a subject with localName of bbb and an object specifying the container class. 
I do not see such a statement. How to I detect in the parser that the presence of the 
rdfs:container? The presence of the container tag is very meaningful for our parser. We are looking 
at alternative ways of representing this sort of information in the model because of this issue.

I notice Jena has the concept of Container : 
[https://jena.apache.org/documentation/javadoc/jena/org/apache/jena/rdf/model/Container.html].
 I can see write orientated methods that refer to this.



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



[jira] [Comment Edited] (JENA-1876) Parsing json-ld in Jena and type : rdfs:container does not come through as a statement

2020-04-01 Thread Andy Seaborne (Jira)


[ 
https://issues.apache.org/jira/browse/JENA-1876?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17072567#comment-17072567
 ] 

Andy Seaborne edited comment on JENA-1876 at 4/1/20, 9:24 AM:
--

This is 
https://stackoverflow.com/questions/60948678/using-jena-to-parse-json-ld-file-i-am-not-seeing-the-rdfscontainer-informatio

This is a question  you may get on better emailing us...@jena.apache.org . See 
https://jena.apache.org/help_and_support/index.html for subscribing.

You'll need to show the JSON-LD in full for it to make sense.

rdfs:Container (NB capital "C") is the superclass of rdf:Bag, rdf:Seq, rdf:Alt. 

Applications get a bag by using {{Resource.as(Bag.class)}}. 
The RDF must have the right triples e.g. a bag member is using property 
{{rdf:_1}] etc.



was (Author: andy.seaborne):
This is 
https://stackoverflow.com/questions/60948678/using-jena-to-parse-json-ld-file-i-am-not-seeing-the-rdfscontainer-informatio?noredirect=1#comment107849155_60948678

This is a question  you may get on better emailing us...@jena.apache.org . See 
https://jena.apache.org/help_and_support/index.html for subscribing.

You'll need to show the JSON-LD in full for it to make sense.

rdfs:Container (NB capital "C") is the superclass of rdf:Bag, rdf:Seq, rdf:Alt. 

Applications get a bag by using {{Resource.as(Bag.class)}}. 
The RDF must have the right triples e.g. a bag member is using property 
{{rdf:_1}] etc.


> Parsing json-ld in Jena and type : rdfs:container does not come through as a 
> statement  
> 
>
> Key: JENA-1876
> URL: https://issues.apache.org/jira/browse/JENA-1876
> Project: Apache Jena
>  Issue Type: Bug
>  Components: Base
>Reporter: David
>Priority: Major
>
> I have a jsonld file that I am parsing using Jena. The file has @type @id 
> "rdfs:label" and "rdfs:comment" and also ranges and domains. I have a test 
> java program like this
> {noformat}
> Model m = ModelFactory.createDefaultModel();
> Reader fileReader = new FileReader(fileName);
> Model model = m.read(fileReader, null, "JSON-LD");
> StmtIterator it = model.listStatements();
> Set set = new HashSet<>();
> System.out.println("Labels");
> while (it.hasNext()) {
> Statement statement = it.next();
> {noformat}
>  It seems to pick up all the content but does not see the @type 
> statements with rdfs:container. How do I pick up these statements using this 
> parser?
> A fragment of the json-ld is \{ "@id": "aaa:bbb", "@type": [ "rdfs:container" 
> ], "rdfs:label": { "@language": "en", "@value": "" }, "rdfs:comment": \{ 
> "@language": "en", "@value": "." }, "rdfs:member": [ \{ "@id": 
> ":" }, \{ "@id": ":f" } ],
> When the type is rdfs:class - I get a statement coming through with predicate 
> "type" and the object as the RDFClass, but when the type is rdfs:container - 
> as in the above example I do not get a statement through. I was expecting a 
> statement to come through with the predicate of "type" and a subject with 
> localName of bbb and an object specifying the container class. I do not see 
> such a statement. How to I detect in the parser that the presence of the 
> rdfs:container? The presence of the container tag is very meaningful for our 
> parser. We are looking at alternative ways of representing this sort of 
> information in the model because of this issue.  
> I notice Jena has the concept of Container : 
> [https://jena.apache.org/documentation/javadoc/jena/org/apache/jena/rdf/model/Container.html].
>  I can see write orientated methods that refer to this.  



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


[jira] [Commented] (JENA-1876) Parsing json-ld in Jena and type : rdfs:container does not come through as a statement

2020-04-01 Thread Andy Seaborne (Jira)


[ 
https://issues.apache.org/jira/browse/JENA-1876?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17072567#comment-17072567
 ] 

Andy Seaborne commented on JENA-1876:
-

This is 
https://stackoverflow.com/questions/60948678/using-jena-to-parse-json-ld-file-i-am-not-seeing-the-rdfscontainer-informatio?noredirect=1#comment107849155_60948678

This is a question  you may get on better emailing us...@jena.apache.org . See 
https://jena.apache.org/help_and_support/index.html for subscribing.

You'll need to show the JSON-LD in full for it to make sense.

rdfs:Container (NB capital "C") is the superclass of rdf:Bag, rdf:Seq, rdf:Alt. 

Applications get a bag by using {{Resource.as(Bag.class)}}. 
The RDF must have the right triples e.g. a bag member is using property 
{{rdf:_1}] etc.


> Parsing json-ld in Jena and type : rdfs:container does not come through as a 
> statement  
> 
>
> Key: JENA-1876
> URL: https://issues.apache.org/jira/browse/JENA-1876
> Project: Apache Jena
>  Issue Type: Bug
>  Components: Base
>Reporter: David
>Priority: Major
>
> I have a jsonld file that I am parsing using Jena. The file has @type @id 
> "rdfs:label" and "rdfs:comment" and also ranges and domains. I have a test 
> java program like this
> {noformat}
> Model m = ModelFactory.createDefaultModel();
> Reader fileReader = new FileReader(fileName);
> Model model = m.read(fileReader, null, "JSON-LD");
> StmtIterator it = model.listStatements();
> Set set = new HashSet<>();
> System.out.println("Labels");
> while (it.hasNext()) {
> Statement statement = it.next();
> {noformat}
>  It seems to pick up all the content but does not see the @type 
> statements with rdfs:container. How do I pick up these statements using this 
> parser?
> A fragment of the json-ld is \{ "@id": "aaa:bbb", "@type": [ "rdfs:container" 
> ], "rdfs:label": { "@language": "en", "@value": "" }, "rdfs:comment": \{ 
> "@language": "en", "@value": "." }, "rdfs:member": [ \{ "@id": 
> ":" }, \{ "@id": ":f" } ],
> When the type is rdfs:class - I get a statement coming through with predicate 
> "type" and the object as the RDFClass, but when the type is rdfs:container - 
> as in the above example I do not get a statement through. I was expecting a 
> statement to come through with the predicate of "type" and a subject with 
> localName of bbb and an object specifying the container class. I do not see 
> such a statement. How to I detect in the parser that the presence of the 
> rdfs:container? The presence of the container tag is very meaningful for our 
> parser. We are looking at alternative ways of representing this sort of 
> information in the model because of this issue.  
> I notice Jena has the concept of Container : 
> [https://jena.apache.org/documentation/javadoc/jena/org/apache/jena/rdf/model/Container.html].
>  I can see write orientated methods that refer to this.  



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


[jira] [Updated] (JENA-1876) Parsing json-ld in Jena and type : rdfs:container does not come through as a statement

2020-04-01 Thread Andy Seaborne (Jira)


 [ 
https://issues.apache.org/jira/browse/JENA-1876?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andy Seaborne updated JENA-1876:

Description: 
I have a jsonld file that I am parsing using Jena. The file has @type @id 
"rdfs:label" and "rdfs:comment" and also ranges and domains. I have a test java 
program like this

{noformat}
Model m = ModelFactory.createDefaultModel();
Reader fileReader = new FileReader(fileName);
Model model = m.read(fileReader, null, "JSON-LD");
StmtIterator it = model.listStatements();
Set set = new HashSet<>();

System.out.println("Labels");
while (it.hasNext()) {
Statement statement = it.next();
{noformat}

 It seems to pick up all the content but does not see the @type statements 
with rdfs:container. How do I pick up these statements using this parser?

A fragment of the json-ld is \{ "@id": "aaa:bbb", "@type": [ "rdfs:container" 
], "rdfs:label": { "@language": "en", "@value": "" }, "rdfs:comment": \{ 
"@language": "en", "@value": "." }, "rdfs:member": [ \{ "@id": ":" 
}, \{ "@id": ":f" } ],

When the type is rdfs:class - I get a statement coming through with predicate 
"type" and the object as the RDFClass, but when the type is rdfs:container - as 
in the above example I do not get a statement through. I was expecting a 
statement to come through with the predicate of "type" and a subject with 
localName of bbb and an object specifying the container class. I do not see 
such a statement. How to I detect in the parser that the presence of the 
rdfs:container? The presence of the container tag is very meaningful for our 
parser. We are looking at alternative ways of representing this sort of 
information in the model because of this issue.  

I notice Jena has the concept of Container : 
[https://jena.apache.org/documentation/javadoc/jena/org/apache/jena/rdf/model/Container.html].
 I can see write orientated methods that refer to this.  

  was:
I have a jsonld file that I am parsing using Jena. The file has @type @id 
"rdfs:label" and "rdfs:comment" and also ranges and domains. I have a test java 
program like this

Model m = ModelFactory.createDefaultModel();

 

{{Reader fileReader = new FileReader(fileName);
Model model = m.read(fileReader, null, "JSON-LD");
StmtIterator it = model.listStatements();
Set set = new HashSet<>();

System.out.println("Labels");
while (it.hasNext()) {
Statement statement = it.next();}}

 It seems to pick up all the content but does not see the @type statements 
with rdfs:container. How do I pick up these statements using this parser?

A fragment of the json-ld is \{ "@id": "aaa:bbb", "@type": [ "rdfs:container" 
], "rdfs:label": { "@language": "en", "@value": "" }, "rdfs:comment": \{ 
"@language": "en", "@value": "." }, "rdfs:member": [ \{ "@id": ":" 
}, \{ "@id": ":f" } ],

When the type is rdfs:class - I get a statement coming through with predicate 
"type" and the object as the RDFClass, but when the type is rdfs:container - as 
in the above example I do not get a statement through. I was expecting a 
statement to come through with the predicate of "type" and a subject with 
localName of bbb and an object specifying the container class. I do not see 
such a statement. How to I detect in the parser that the presence of the 
rdfs:container? The presence of the container tag is very meaningful for our 
parser. We are looking at alternative ways of representing this sort of 
information in the model because of this issue.  

I notice Jena has the concept of Container : 
[https://jena.apache.org/documentation/javadoc/jena/org/apache/jena/rdf/model/Container.html].
 I can see write orientated methods that refer to this.  


> Parsing json-ld in Jena and type : rdfs:container does not come through as a 
> statement  
> 
>
> Key: JENA-1876
> URL: https://issues.apache.org/jira/browse/JENA-1876
> Project: Apache Jena
>  Issue Type: Bug
>  Components: Base
>Reporter: David
>Priority: Major
>
> I have a jsonld file that I am parsing using Jena. The file has @type @id 
> "rdfs:label" and "rdfs:comment" and also ranges and domains. I have a test 
> java program like this
> {noformat}
> Model m = ModelFactory.createDefaultModel();
> Reader fileReader = new FileReader(fileName);
> Model model = m.read(fileReader, null, "JSON-LD");
> StmtIterator it = model.listStatements();
> Set set = new HashSet<>();
> System.out.println("Labels");
> while (it.hasNext()) {
> Statement statement = it.next();
> {noformat}
>  It seems to pick up all the content but does not see the @type 
> statements with rdfs:container. How do I pick up these statements using this 
> parser?
> A 

[jira] [Created] (JENA-1876) Parsing json-ld in Jena and type : rdfs:container does not come through as a statement

2020-04-01 Thread David (Jira)
David created JENA-1876:
---

 Summary: Parsing json-ld in Jena and type : rdfs:container does 
not come through as a statement  
 Key: JENA-1876
 URL: https://issues.apache.org/jira/browse/JENA-1876
 Project: Apache Jena
  Issue Type: Bug
  Components: Base
Reporter: David


I have a jsonld file that I am parsing using Jena. The file has @type @id 
"rdfs:label" and "rdfs:comment" and also ranges and domains. I have a test java 
program like this

Model m = ModelFactory.createDefaultModel();

 

{{Reader fileReader = new FileReader(fileName);
Model model = m.read(fileReader, null, "JSON-LD");
StmtIterator it = model.listStatements();
Set set = new HashSet<>();

System.out.println("Labels");
while (it.hasNext()) {
Statement statement = it.next();}}

 It seems to pick up all the content but does not see the @type statements 
with rdfs:container. How do I pick up these statements using this parser?

A fragment of the json-ld is \{ "@id": "aaa:bbb", "@type": [ "rdfs:container" 
], "rdfs:label": { "@language": "en", "@value": "" }, "rdfs:comment": \{ 
"@language": "en", "@value": "." }, "rdfs:member": [ \{ "@id": ":" 
}, \{ "@id": ":f" } ],

When the type is rdfs:class - I get a statement coming through with predicate 
"type" and the object as the RDFClass, but when the type is rdfs:container - as 
in the above example I do not get a statement through. I was expecting a 
statement to come through with the predicate of "type" and a subject with 
localName of bbb and an object specifying the container class. I do not see 
such a statement. How to I detect in the parser that the presence of the 
rdfs:container? The presence of the container tag is very meaningful for our 
parser. We are looking at alternative ways of representing this sort of 
information in the model because of this issue.  

I notice Jena has the concept of Container : 
[https://jena.apache.org/documentation/javadoc/jena/org/apache/jena/rdf/model/Container.html].
 I can see write orientated methods that refer to this.  



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


[jira] [Commented] (JENA-1864) Inconsistent Turtle serializers

2020-04-01 Thread Viresh Gupta (Jira)


[ 
https://issues.apache.org/jira/browse/JENA-1864?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17072431#comment-17072431
 ] 

Viresh Gupta commented on JENA-1864:


Great

> Inconsistent Turtle serializers
> ---
>
> Key: JENA-1864
> URL: https://issues.apache.org/jira/browse/JENA-1864
> Project: Apache Jena
>  Issue Type: Bug
>Affects Versions: Jena 3.14.0
> Environment: My Configuration:
> OS: Ubuntu 18.04
> java version "1.8.0_111"
> javac 1.8.0_242
> Jena Version: 3.14.0
>Reporter: Viresh Gupta
>Assignee: Andy Seaborne
>Priority: Major
> Fix For: Jena 3.15.0
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> The turtle serializers provided for default model in Jena don't work as 
> expected. Moreover, the docs lack on which methods to use in which case.
> I found the following methods that seem to work:
>  # model.write()  (A.ttl)
>  # RDFWriter   (B.ttl)
>  # RDFDataMgr  (C.ttl)
> I'm providing a minimum working example along with the outputs using a sample 
> turtle file from Turtle specifications (ggoblin.ttl – Example 1 from 
> [https://www.w3.org/TR/turtle/|https://www.w3.org/TR/turtle/#sec-examples]) 
> in a gist: [https://gist.github.com/virresh/5a28dc3adb1f40bf9070e2cb4ecfa90d]
>  
> The issue:
>  # "@base" directive is not printed when writing with the TURTLE_BLOCK and 
> TURTLE_FLAT format in RDFWriter
>  #  There is no way to provide "@base" inside the RDFDataMgr. Expected output 
> was something like <#spiderman>
>  # RDFDataMgr doesn't respect the prefix supplied, e.g I manually added 
> prefix "@base", however, the output (C.ttl) still converts the relative 
> entities into their absolute form, whereas I expected it to do something like 
> base:#spiderman at the very least
>  
> I'll be happy to help with the issue if it doesn't fall into the "wont-fix" 
> category.



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