Re: JSON-LD writer always casts @language tags to lower-case

2022-03-06 Thread Holger Knublauch
Thank you, Andy. This is good to know. I can confirm that switching to 
JSON-LD 1.1 no longer converts the language tags.


(Which is quite surprising, because only the 1.1 spec states that 
language tags MAY get lower-cased, so this feels quite inverted).


Do you (or other JSON-LD experts) know why 1.0 is still the default, or 
why anyone would prefer 1.0 over 1.1 these days? 1.0 seems to have been 
superseded by 1.1, see https://github.com/w3c/json-ld-wg/issues/154


I guess for the time being we could add an option for our users to 
switch between 1.0 and 1.1.


Holger


On 2022-03-04 8:10 pm, Andy Seaborne wrote:

Jena uses
  jsonld-java for JSON-LD 1.0
  titanium-json-ld for JSON-LD 1.1.
(The default is JSON-LD 1.0.)


jsonld-java lowercases
titanium-json-ld does not.

Is it an option for jsonld-java and jena just does not set it?

Please confirm: The graph are isomorphic. c.f. bnodes.

FWIW:
RDFParser has options for lowercase, canonical (such as "en-GB") or 
"as is" for ingesting RDF.


    Andy

On 04/03/2022 04:23, Holger Knublauch wrote:
The JSON-LD writer converts language tags to lower-case, e.g. "en-US" 
becomes "en-us".


The code is in JsonLdApi:L664 and I guess it follows the recommendation

 https://www.w3.org/TR/json-ld-api/#h-note-17

And the RDF 1.1 spec itself states that the value space of language 
tags is lower case.


But syntactically that is a MAY and it means that RDF graphs cannot 
be correctly round-tripped via JSON-LD.

>
Could there be a flag to switch this off? The other serializations 
also do preserve the casing AFAIK, and when you add a triple to a 
Jena Graph also no such transformations are taking place.


Thanks
Holger




Re: count the number of RDF triples

2022-03-06 Thread Andy Seaborne




On 06/03/2022 15:06, Hashim Khan wrote:

Hi,
  I need to know, how can I count the number of RDF triples in a graph
using jena?


Model.size()

https://jena.apache.org/documentation/javadoc/jena/org/apache/jena/rdf/model/Model.html#size()

In SPARQL, use COUNT.

Andy


count the number of RDF triples

2022-03-06 Thread Hashim Khan
Hi,
 I need to know, how can I count the number of RDF triples in a graph
using jena?

Best Regards,
-- 
*Hashim Khan*


Re: Can Fuseki SHACL-validate data before inserting them into the graph?

2022-03-06 Thread Moritz Orth
Thank both of you very much. I’ll have a look at Processor, looks very 
interesting at first sight!

Best regards
Moritz

> Am 06.03.2022 um 10:27 schrieb Martynas Jusevičius :
> 
> Processor can validate request payloads against SPIN and SHACL. The
> constraints are defined as part of the LDT ontology.
> https://github.com/AtomGraph/Processor
> 
> On Sat, 5 Mar 2022 at 19.35, Andy Seaborne  wrote:
> 
>> 
>> 
>> On 04/03/2022 17:24, Moritz Orth wrote:
>>> Hello everyone,
>>> 
>>> I’m currently playing around with SHACL in Jena and just asked myself:
>> Can Fuseki validate data against SHACL shapes prior to inserting them into
>> the graph, refusing to add them when they don’t conform with the shapes?
>> 
>> No, not currently.
>> 
>> Andy
>> 
>>> 
>>> The docs under https://jena.apache.org/documentation/shacl/index.html <
>> https://jena.apache.org/documentation/shacl/index.html> show that
>> something like this is possible using the Java API directly, using
>> GraphValidation.update(). Fuseki allows for creating a SHACL validation
>> report after inserting some data, however I cannot see a possibility to
>> achieve this kind of transaction rollback behaviour that I do with the API.
>>> 
>>> Is there some kind of operation mode for Fuseki that allows you to
>> specify some SHACL shapes on startup, and then validate all triple
>> insertion requests against those shapes?
>>> 
>>> Thanks in advance for some guidance on the topic.
>>> 
>>> Best regards
>>> Moritz
>>> 
>>> 
>> 



Re: Can Fuseki SHACL-validate data before inserting them into the graph?

2022-03-06 Thread Martynas Jusevičius
Processor can validate request payloads against SPIN and SHACL. The
constraints are defined as part of the LDT ontology.
https://github.com/AtomGraph/Processor

On Sat, 5 Mar 2022 at 19.35, Andy Seaborne  wrote:

>
>
> On 04/03/2022 17:24, Moritz Orth wrote:
> > Hello everyone,
> >
> > I’m currently playing around with SHACL in Jena and just asked myself:
> Can Fuseki validate data against SHACL shapes prior to inserting them into
> the graph, refusing to add them when they don’t conform with the shapes?
>
> No, not currently.
>
>  Andy
>
> >
> > The docs under https://jena.apache.org/documentation/shacl/index.html <
> https://jena.apache.org/documentation/shacl/index.html> show that
> something like this is possible using the Java API directly, using
> GraphValidation.update(). Fuseki allows for creating a SHACL validation
> report after inserting some data, however I cannot see a possibility to
> achieve this kind of transaction rollback behaviour that I do with the API.
> >
> > Is there some kind of operation mode for Fuseki that allows you to
> specify some SHACL shapes on startup, and then validate all triple
> insertion requests against those shapes?
> >
> > Thanks in advance for some guidance on the topic.
> >
> > Best regards
> > Moritz
> >
> >
>