Re: Disabling BNode UID generation

2022-02-04 Thread Shaw, Ryan



> On Feb 4, 2022, at 4:03 PM, Andy Seaborne  wrote:
> 
> Ryan,
> 
> Please, could you show example code that illustrates what you are seeing?  
> Presumably it isn't a mix in one parser run because it looks like "Annn" come 
> from a different place than UUIDs Ids.

--
package test;

import java.nio.file.Path;
import java.nio.file.Paths;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.riot.RDFDataMgr;
import org.apache.jena.shared.impl.JenaParameters;

public class Test {

public static void main(String[] args) {
JenaParameters.disableBNodeUIDGeneration = true;

Path path = Paths.get(args[0]);
Model model = RDFDataMgr.loadModel(path.toString());
model.getGraph().stream().forEach(System.out::println);
}
}
--

When I run the above on the following input:

--
PREFIX : 

PREFIX iso8601: 
PREFIX owl: 
PREFIX rdf: 
PREFIX rdfs: 
PREFIX time: 
PREFIX xsd: 

:when1
  a [
  a owl:Class ;
  owl:equivalentClass [
  owl:intersectionOf (
  time:Instant
  [
a owl:Restriction ;
owl:allValuesFrom [
owl:unionOf (
[
  owl:intersectionOf (
  time:DateTimeDescription
  [
a owl:Restriction ;
owl:onProperty time:year ;
owl:someValuesFrom [
a rdfs:Datatype ;
owl:onDatatype xsd:integer ;
owl:withRestrictions (
[
  xsd:minInclusive 1984
]
  )
  ]
  ]
)
]
[
  owl:intersectionOf (
  time:GeneralDateTimeDescription
  [
owl:complementOf [
a owl:Restriction ;
owl:hasValue iso8601:Gregorian ;
owl:onProperty time:hasTRS
  ]
  ]
)
]
  )
  ] ;
owl:onProperty time:inDateTime
  ]
)
]
] ;
  rdfs:label "1984 or some later year" ;
.
--

I get:

--
231b263db2bfddb58dfa9937b3b7c3a0 @owl:withRestrictions A12
231b263db2bfddb58dfa9937b3b7c3a0 @owl:onDatatype xsd:integer
231b263db2bfddb58dfa9937b3b7c3a0 @rdf:type rdfs:Datatype
8c6c72efd28cd325bc71b79a849faaa1 @xsd:minInclusive 
"1984"^^http://www.w3.org/2001/XMLSchema#integer
A14 @rdf:rest A17
A14 @rdf:first 820826bd52ee5a08eb7622801e144c6e
https://periodo.github.io/edtf-ontology/cases/level-2/range/on-or-after/when1 
@rdfs:label "1984 or some later year"
https://periodo.github.io/edtf-ontology/cases/level-2/range/on-or-after/when1 
@rdf:type 132cb499d890d8900be00c8642b044d4
A13 @rdf:rest rdf:nil
A13 @rdf:first faf2ba604cbef59a8f51d8c9242632f3
A18 @rdf:rest rdf:nil
A18 @rdf:first 5fdb8fff2b57077c0eeb04c51a5c81f9
132cb499d890d8900be00c8642b044d4 @owl:equivalentClass 
f36891f02e7b41fedf7ff3f1328aa1a5
132cb499d890d8900be00c8642b044d4 @rdf:type owl:Class
A12 @rdf:rest rdf:nil
A12 @rdf:first 8c6c72efd28cd325bc71b79a849faaa1
ce14b1c198fa8523fcc9cd87b6675ed7 @owl:onProperty 
http://www.w3.org/2006/time#hasTRS
ce14b1c198fa8523fcc9cd87b6675ed7 @owl:hasValue 
http://www.opengis.net/def/uom/ISO-8601/0/Gregorian
ce14b1c198fa8523fcc9cd87b6675ed7 @rdf:type owl:Restriction
faf2ba604cbef59a8f51d8c9242632f3 @owl:someValuesFrom 
231b263db2bfddb58dfa9937b3b7c3a0
faf2ba604cbef59a8f51d8c9242632f3 @owl:onProperty 
http://www.w3.org/2006/time#year
faf2ba604cbef59a8f51d8c9242632f3 @rdf:type owl:Restriction
7689913c074aeda41f891ce04e89887f @owl:complementOf 
ce14b1c198fa8523fcc9cd87b6675ed7
5fdb8fff2b57077c0eeb04c51a5c81f9 @owl:onProperty 
http://www.w3.org/2006/time#inDateTime
5fdb8fff2b57077c0eeb04c51a5c81f9 @owl:allValuesFrom 

Re: Disabling BNode UID generation

2022-02-04 Thread Andy Seaborne

Ryan,

Please, could you show example code that illustrates what you are 
seeing?  Presumably it isn't a mix in one parser run because it looks 
like "Annn" come from a different place than UUIDs Ids.


Which version of Jena are you running?

Andy

On 04/02/2022 19:09, Shaw, Ryan wrote:

Hello,

I am trying to experiment with generating diffable N-Triples or flat Turtle 
files.

I was hoping that I could do this by setting 
JenaParameters.disableBNodeUIDGeneration to true, so that blank nodes would be 
assigned IDs in increasing order as the parser created them. But it seems that 
only some methods of blank node creation respect this setting. When I parse 
Turtle with BNode UID generation disabled, I get a mix of `ANNN` (incremented, 
as expected) and random UUID BNode IDs. When I parse N-Triples I get all random 
UUIDs.

Is there any way to tap into the parsing pipeline to ensure that all BNode IDs 
are deterministically (ideally incrementally) generated?

Thanks,
Ryan


Re: Disabling BNode UID generation

2022-02-04 Thread Martynas Jusevičius
Hi Ryan,

Isn't it easier to skolemize the bnodes into URIs that you control?

If you only have URIs, then you could even hash the graph with SPARQL:
https://stackoverflow.com/questions/65798817/how-to-generate-a-hash-of-an-rdf-graph-using-sparql
It works but probably doesn't scale that well.

Martynas

On Fri, Feb 4, 2022 at 8:09 PM Shaw, Ryan  wrote:
>
> Hello,
>
> I am trying to experiment with generating diffable N-Triples or flat Turtle 
> files.
>
> I was hoping that I could do this by setting 
> JenaParameters.disableBNodeUIDGeneration to true, so that blank nodes would 
> be assigned IDs in increasing order as the parser created them. But it seems 
> that only some methods of blank node creation respect this setting. When I 
> parse Turtle with BNode UID generation disabled, I get a mix of `ANNN` 
> (incremented, as expected) and random UUID BNode IDs. When I parse N-Triples 
> I get all random UUIDs.
>
> Is there any way to tap into the parsing pipeline to ensure that all BNode 
> IDs are deterministically (ideally incrementally) generated?
>
> Thanks,
> Ryan


Disabling BNode UID generation

2022-02-04 Thread Shaw, Ryan
Hello,

I am trying to experiment with generating diffable N-Triples or flat Turtle 
files. 

I was hoping that I could do this by setting 
JenaParameters.disableBNodeUIDGeneration to true, so that blank nodes would be 
assigned IDs in increasing order as the parser created them. But it seems that 
only some methods of blank node creation respect this setting. When I parse 
Turtle with BNode UID generation disabled, I get a mix of `ANNN` (incremented, 
as expected) and random UUID BNode IDs. When I parse N-Triples I get all random 
UUIDs.

Is there any way to tap into the parsing pipeline to ensure that all BNode IDs 
are deterministically (ideally incrementally) generated?

Thanks,
Ryan

Re: Howto address a named graph with a geosparql server in an existing persistent store

2022-02-04 Thread Erik Bijsterbosch
Update feedback:

Derby home setting is not necessary when setting the SIS_DATA variable.
Hence this is the cleaned up startup sequence in the docker entrypoint.sh:

# SiS_DATA set in docker-compose.yaml
export SIS_HOME=${SIS_DATA}/..

export START=`echo ${JAVA_HOME}/bin/java $JAVA_OPTIONS  -classpath
${SIS_HOME}/lib/:"${FUSEKI_DIR}/${FUSEKI_JAR}":${SIS_HOME}/lib/derby-10.14.2.0.jar
org.apache.jena.fuseki.geosparql.Main "$@"`
echo ${START}
exec ${START}




Op vr 4 feb. 2022 om 09:54 schreef Erik Bijsterbosch <
e.bijsterbo...@gmail.com>:

>
> We successfully loaded two demo sets with CRS  wgs84 and CRS 27700.
> So the geodetic EPSG dataset is used well.
> The problem must be in our srs uri's then and we will investigate our
> datasets and etl/minting on the schema's used.
>
> Attaching to fuseki
> fuseki| /fuseki/databases/SIS/apache-sis-1.1/data/
> fuseki| /opt/java-minimal/bin/java -Xmx24g -Xms24g
> -Dderby.system.home=/fuseki/databases/SIS/apache-sis-1.1/data/Databases
> -classpath
> /fuseki/databases/SIS/apache-sis-1.1/data/sis-embedded-data-1.1.jar:/fuseki/jena-fuseki-geosparql-4.4.0.jar
> org.apache.jena.fuseki.geosparql.Main -t /fuseki/databases/DB2-5 --tdb2
> --rdf_file /fuseki/store/geosparql_test.rdf --dataset dst
> --default_geometry --inference
> fuseki| WARNING: sun.reflect.Reflection.getCallerClass is not
> supported. This will impact performance.
> fuseki| [2022-02-04 08:59:49] INFO  Main:: Arguments
> Received: [-t, /fuseki/databases/DB2-5, --tdb2, --rdf_file,
> /fuseki/store/geosparql_test.rdf, --dataset, dst, --default_geometry,
> --inference]
> fuseki| [2022-02-04 08:59:49] INFO  DatasetOperations :: Server
> Configuration: port=3030, datsetName=dst, loopbackOnly=true,
> updateAllowed=false, inference=true, applyDefaultGeometry=true,
> validateGeometryLiteral=false, convertGeoPredicates=false,
> removeGeoPredicates=false, queryRewrite=true,
> tdbFile=/fuseki/databases/DB2-5,
> fileGraphFormats=[FileGraphFormat{rdfFile=/fuseki/store/geosparql_test.rdf,
> graphName=, rdfFormat=Turtle/pretty}], fileGraphDelimiters=[],
> indexEnabled=true, indexSizes=[-1, -1, -1], indexExpiries=[5000, 5000,
> 5000], spatialIndexFile=null, tdb2=true, help=false
> fuseki| [2022-02-04 08:59:49] INFO  DatasetOperations :: TDB Dataset:
> /fuseki/databases/DB2-5, TDB2: true
> fuseki| [2022-02-04 08:59:50] INFO  DatasetOperations :: Reading RDF -
> Started - File: /fuseki/store/geosparql_test.rdf, Graph Name: , RDF Format:
> Turtle/pretty
> fuseki| [2022-02-04 08:59:51] INFO  DatasetOperations :: Reading RDF -
> Completed - File: /fuseki/store/geosparql_test.rdf, Graph Name: , RDF
> Format: Turtle/pretty
> fuseki| [2022-02-04 08:59:51] INFO  GeoSPARQLOperations :: Applying
> hasDefaultGeometry - Completed
> fuseki| [2022-02-04 08:59:51] INFO  GeoSPARQLOperations :: Applying
> GeoSPARQL Schema - Started
> fuseki| [2022-02-04 08:59:51] INFO  GeoSPARQLOperations :: GeoSPARQL
> schema applied to graph: default
> fuseki| [2022-02-04 08:59:51] INFO  GeoSPARQLOperations :: Applying
> GeoSPARQL Schema - Completed
> fuseki| [2022-02-04 08:59:51] INFO  GeoSPARQLOperations :: Find Mode
> SRS - Started
> fuseki| [2022-02-04 08:59:51] INFO  GeoSPARQLOperations :: Find Mode
> SRS - Completed
> fuseki| [2022-02-04 08:59:51] INFO  SpatialIndex::
> Feature-hasGeometry-Geometry statements found.
> fuseki| [2022-02-04 08:59:51] INFO  SpatialIndex:: Saving Spatial
> Index - Started: /fuseki/databases/DB2-5/spatial.index
> fuseki| [2022-02-04 08:59:51] INFO  SpatialIndex:: Saving Spatial
> Index - Completed: /fuseki/databases/DB2-5/spatial.index
> fuseki| [2022-02-04 08:59:51] INFO  GeosparqlServer :: GeoSPARQL
> Server: Running - Port: 3030, Dataset: /dst, Loopback Only: true,  Allow
> Update: false
> fuseki| [2022-02-04 08:59:51] INFO  Server  :: Start Fuseki
> (http=3030)
>
> Op do 3 feb. 2022 om 19:48 schreef Erik Bijsterbosch <
> e.bijsterbo...@gmail.com>:
>
>> The work around from https://sis.apache.org/javafx.html
>>
>> Op do 3 feb. 2022 om 19:46 schreef Erik Bijsterbosch <
>> e.bijsterbo...@gmail.com>:
>>
>>> Hi Andy,
>>>
>>> We advanced a few steps but now we're having trouble using the (full)
>>> geodetic EPSG dataset.
>>>
>>> $ docker-compose stop fuseki; docker-compose rm -f fuseki;
>>> docker-compose up fuseki
>>> Stopping fuseki ... done
>>> Going to remove fuseki
>>> Removing fuseki ... done
>>> Creating fuseki ... done
>>> Attaching to fuseki
>>> fuseki| /opt/java-minimal/bin/java -Xmx24g -Xms24g
>>> -Dderby.system.home=/fuseki/databases/SIS/apache-sis-1.1/data/Databases
>>> -classpath
>>> /fuseki/databases/SIS/apache-sis-1.1/lib/sis-referencing-1.1.jar:/fuseki/jena-fuseki-geosparql-4.4.0.jar
>>> org.apache.jena.fuseki.geosparql.Main -t /fuseki/databases/DB2-4 --tdb2
>>> --rdf_file /fuseki/store/ligplaats.trig --dataset dst --inference --validate
>>> fuseki| WARNING: sun.reflect.Reflection.getCallerClass 

Re: Howto address a named graph with a geosparql server in an existing persistent store

2022-02-04 Thread Erik Bijsterbosch
We successfully loaded two demo sets with CRS  wgs84 and CRS 27700.
So the geodetic EPSG dataset is used well.
The problem must be in our srs uri's then and we will investigate our
datasets and etl/minting on the schema's used.

Attaching to fuseki
fuseki| /fuseki/databases/SIS/apache-sis-1.1/data/
fuseki| /opt/java-minimal/bin/java -Xmx24g -Xms24g
-Dderby.system.home=/fuseki/databases/SIS/apache-sis-1.1/data/Databases
-classpath
/fuseki/databases/SIS/apache-sis-1.1/data/sis-embedded-data-1.1.jar:/fuseki/jena-fuseki-geosparql-4.4.0.jar
org.apache.jena.fuseki.geosparql.Main -t /fuseki/databases/DB2-5 --tdb2
--rdf_file /fuseki/store/geosparql_test.rdf --dataset dst
--default_geometry --inference
fuseki| WARNING: sun.reflect.Reflection.getCallerClass is not
supported. This will impact performance.
fuseki| [2022-02-04 08:59:49] INFO  Main:: Arguments
Received: [-t, /fuseki/databases/DB2-5, --tdb2, --rdf_file,
/fuseki/store/geosparql_test.rdf, --dataset, dst, --default_geometry,
--inference]
fuseki| [2022-02-04 08:59:49] INFO  DatasetOperations :: Server
Configuration: port=3030, datsetName=dst, loopbackOnly=true,
updateAllowed=false, inference=true, applyDefaultGeometry=true,
validateGeometryLiteral=false, convertGeoPredicates=false,
removeGeoPredicates=false, queryRewrite=true,
tdbFile=/fuseki/databases/DB2-5,
fileGraphFormats=[FileGraphFormat{rdfFile=/fuseki/store/geosparql_test.rdf,
graphName=, rdfFormat=Turtle/pretty}], fileGraphDelimiters=[],
indexEnabled=true, indexSizes=[-1, -1, -1], indexExpiries=[5000, 5000,
5000], spatialIndexFile=null, tdb2=true, help=false
fuseki| [2022-02-04 08:59:49] INFO  DatasetOperations :: TDB Dataset:
/fuseki/databases/DB2-5, TDB2: true
fuseki| [2022-02-04 08:59:50] INFO  DatasetOperations :: Reading RDF -
Started - File: /fuseki/store/geosparql_test.rdf, Graph Name: , RDF Format:
Turtle/pretty
fuseki| [2022-02-04 08:59:51] INFO  DatasetOperations :: Reading RDF -
Completed - File: /fuseki/store/geosparql_test.rdf, Graph Name: , RDF
Format: Turtle/pretty
fuseki| [2022-02-04 08:59:51] INFO  GeoSPARQLOperations :: Applying
hasDefaultGeometry - Completed
fuseki| [2022-02-04 08:59:51] INFO  GeoSPARQLOperations :: Applying
GeoSPARQL Schema - Started
fuseki| [2022-02-04 08:59:51] INFO  GeoSPARQLOperations :: GeoSPARQL
schema applied to graph: default
fuseki| [2022-02-04 08:59:51] INFO  GeoSPARQLOperations :: Applying
GeoSPARQL Schema - Completed
fuseki| [2022-02-04 08:59:51] INFO  GeoSPARQLOperations :: Find Mode
SRS - Started
fuseki| [2022-02-04 08:59:51] INFO  GeoSPARQLOperations :: Find Mode
SRS - Completed
fuseki| [2022-02-04 08:59:51] INFO  SpatialIndex::
Feature-hasGeometry-Geometry statements found.
fuseki| [2022-02-04 08:59:51] INFO  SpatialIndex:: Saving Spatial
Index - Started: /fuseki/databases/DB2-5/spatial.index
fuseki| [2022-02-04 08:59:51] INFO  SpatialIndex:: Saving Spatial
Index - Completed: /fuseki/databases/DB2-5/spatial.index
fuseki| [2022-02-04 08:59:51] INFO  GeosparqlServer :: GeoSPARQL
Server: Running - Port: 3030, Dataset: /dst, Loopback Only: true,  Allow
Update: false
fuseki| [2022-02-04 08:59:51] INFO  Server  :: Start Fuseki
(http=3030)

Op do 3 feb. 2022 om 19:48 schreef Erik Bijsterbosch <
e.bijsterbo...@gmail.com>:

> The work around from https://sis.apache.org/javafx.html
>
> Op do 3 feb. 2022 om 19:46 schreef Erik Bijsterbosch <
> e.bijsterbo...@gmail.com>:
>
>> Hi Andy,
>>
>> We advanced a few steps but now we're having trouble using the (full)
>> geodetic EPSG dataset.
>>
>> $ docker-compose stop fuseki; docker-compose rm -f fuseki; docker-compose
>> up fuseki
>> Stopping fuseki ... done
>> Going to remove fuseki
>> Removing fuseki ... done
>> Creating fuseki ... done
>> Attaching to fuseki
>> fuseki| /opt/java-minimal/bin/java -Xmx24g -Xms24g
>> -Dderby.system.home=/fuseki/databases/SIS/apache-sis-1.1/data/Databases
>> -classpath
>> /fuseki/databases/SIS/apache-sis-1.1/lib/sis-referencing-1.1.jar:/fuseki/jena-fuseki-geosparql-4.4.0.jar
>> org.apache.jena.fuseki.geosparql.Main -t /fuseki/databases/DB2-4 --tdb2
>> --rdf_file /fuseki/store/ligplaats.trig --dataset dst --inference --validate
>> fuseki| WARNING: sun.reflect.Reflection.getCallerClass is not
>> supported. This will impact performance.
>> fuseki| [2022-02-03 19:15:18] INFO  Main:: Arguments
>> Received: [-t, /fuseki/databases/DB2-4, --tdb2, --rdf_file,
>> /fuseki/store/ligplaats.trig, --dataset, dst, --inference, --validate]
>> fuseki| [2022-02-03 19:15:18] INFO  DatasetOperations :: Server
>> Configuration: port=3030, datsetName=dst, loopbackOnly=true,
>> updateAllowed=false, inference=true, applyDefaultGeometry=false,
>> validateGeometryLiteral=true, convertGeoPredicates=false,
>> removeGeoPredicates=false, queryRewrite=true,
>> tdbFile=/fuseki/databases/DB2-4,
>> fileGraphFormats=[FileGraphFormat{rdfFile=/fuseki/store/ligplaats.trig,
>> graphName=,