Stable turtle serialization

2022-07-13 Thread Sebastian Trueg

Hello,

trying to consistently get nice git diffs for my turtle files I want to 
normalize pull requests. To that end I simply re-write the turtle files 
via RDFDataMgr. Sadly the result is not stable, at least the order of 
some objects changes from run to run.


Is there a way to ensure that serializing the same set of triples 
(parsed from different formats) always results in the exact same output?


I found https://github.com/buda-base/jena-stable-turtle but that seems 
to not be compatible with 4.5.0.


Thanks,
Sebastian



Re: Cannot invoke "String.equals(Object)" because "prefix" is null

2022-07-13 Thread Martynas Jusevičius
On a further look I can see that Relation::backwards returns null
because "http://www.w3.org/2001/XMLSchema#; is not in the cols map.
https://github.com/apache/jena/blob/main/jena-core/src/main/java/org/apache/jena/rdfxml/xmloutput/impl/Relation.java#L204

That's where my investigation ends, I'm afraid...

On Wed, Jul 13, 2022 at 5:51 PM Martynas Jusevičius
 wrote:
>
> I can see that this.getPrefixFor( value ) returns null, where value is
> "http://www.w3.org/2001/XMLSchema#;.
> https://github.com/apache/jena/blob/main/jena-core/src/main/java/org/apache/jena/rdfxml/xmloutput/impl/BaseXMLWriter.java#L229
>
> No idea why though.
>
> On Wed, Jul 13, 2022 at 5:03 PM Martynas Jusevičius
>  wrote:
> >
> > Hi,
> >
> > Never seen this exception before and not sure yet what causes it:
> >
> > java.lang.NullPointerException: Cannot invoke "String.equals(Object)"
> > because "prefix" is null
> > org.apache.jena.rdfxml.xmloutput.impl.BaseXMLWriter.checkLegalPrefix(BaseXMLWriter.java:845)
> > org.apache.jena.rdfxml.xmloutput.impl.BaseXMLWriter.setNsPrefix(BaseXMLWriter.java:324)
> > org.apache.jena.rdfxml.xmloutput.impl.BaseXMLWriter.primeNamespace(BaseXMLWriter.java:232)
> > org.apache.jena.rdfxml.xmloutput.impl.BaseXMLWriter.setupNamespaces(BaseXMLWriter.java:482)
> > org.apache.jena.rdfxml.xmloutput.impl.BaseXMLWriter.write(BaseXMLWriter.java:466)
> > org.apache.jena.rdfxml.xmloutput.impl.BaseXMLWriter.write(BaseXMLWriter.java:456)
> > com.atomgraph.linkeddatahub.server.io.ValidatingModelProvider.write(ValidatingModelProvider.java:129)
> >
> > Any hints?


Re: Cannot invoke "String.equals(Object)" because "prefix" is null

2022-07-13 Thread Martynas Jusevičius
I can see that this.getPrefixFor( value ) returns null, where value is
"http://www.w3.org/2001/XMLSchema#;.
https://github.com/apache/jena/blob/main/jena-core/src/main/java/org/apache/jena/rdfxml/xmloutput/impl/BaseXMLWriter.java#L229

No idea why though.

On Wed, Jul 13, 2022 at 5:03 PM Martynas Jusevičius
 wrote:
>
> Hi,
>
> Never seen this exception before and not sure yet what causes it:
>
> java.lang.NullPointerException: Cannot invoke "String.equals(Object)"
> because "prefix" is null
> org.apache.jena.rdfxml.xmloutput.impl.BaseXMLWriter.checkLegalPrefix(BaseXMLWriter.java:845)
> org.apache.jena.rdfxml.xmloutput.impl.BaseXMLWriter.setNsPrefix(BaseXMLWriter.java:324)
> org.apache.jena.rdfxml.xmloutput.impl.BaseXMLWriter.primeNamespace(BaseXMLWriter.java:232)
> org.apache.jena.rdfxml.xmloutput.impl.BaseXMLWriter.setupNamespaces(BaseXMLWriter.java:482)
> org.apache.jena.rdfxml.xmloutput.impl.BaseXMLWriter.write(BaseXMLWriter.java:466)
> org.apache.jena.rdfxml.xmloutput.impl.BaseXMLWriter.write(BaseXMLWriter.java:456)
> com.atomgraph.linkeddatahub.server.io.ValidatingModelProvider.write(ValidatingModelProvider.java:129)
>
> Any hints?


Cannot invoke "String.equals(Object)" because "prefix" is null

2022-07-13 Thread Martynas Jusevičius
Hi,

Never seen this exception before and not sure yet what causes it:

java.lang.NullPointerException: Cannot invoke "String.equals(Object)"
because "prefix" is null
org.apache.jena.rdfxml.xmloutput.impl.BaseXMLWriter.checkLegalPrefix(BaseXMLWriter.java:845)
org.apache.jena.rdfxml.xmloutput.impl.BaseXMLWriter.setNsPrefix(BaseXMLWriter.java:324)
org.apache.jena.rdfxml.xmloutput.impl.BaseXMLWriter.primeNamespace(BaseXMLWriter.java:232)
org.apache.jena.rdfxml.xmloutput.impl.BaseXMLWriter.setupNamespaces(BaseXMLWriter.java:482)
org.apache.jena.rdfxml.xmloutput.impl.BaseXMLWriter.write(BaseXMLWriter.java:466)
org.apache.jena.rdfxml.xmloutput.impl.BaseXMLWriter.write(BaseXMLWriter.java:456)
com.atomgraph.linkeddatahub.server.io.ValidatingModelProvider.write(ValidatingModelProvider.java:129)

Any hints?


Re: group_concat and parameters

2022-07-13 Thread Andy Seaborne




On 12/07/2022 11:41, robert.ba...@tiscali.it wrote:
   


hi,

about the group_concat function I found many posts where we
talk about the following parameters:

* ROW_LIMIT
* PRE
*
SUFFIX


Those are AnzoGraph extensions.



for instance:
group_concat (? chapterTitle; separator = " "; pre
= " "; suffix = " ")

Are they also available in fuseki?


Fuseki supports all of the SPARQL 1.1 spec:

'GROUP_CONCAT'
 '(' 'DISTINCT'? Expression ( ';' 'SEPARATOR' '=' String ? ')'

Andy



thanks