Skip to content

GeoSPARQL support #29

@MadsHolten

Description

@MadsHolten

Is it possible to set up a database that has both full text and GeoSPARQL support? Here is the assembler I tried. Unfortunately I had no luck with my test query 😒

@prefix fuseki:  <http://jena.apache.org/fuseki#> .
@prefix tdb:     <http://jena.hpl.hp.com/2008/tdb#> .
@prefix text:    <http://jena.apache.org/text#> .
@prefix skos:    <http://www.w3.org/2004/02/skos/core#> .
@prefix geosparql: <http://jena.apache.org/geosparql#> .

<#service> a fuseki:Service ;
    fuseki:name              "ds" ;   # http://host:port/ds
    fuseki:serviceQuery      "sparql" ;    # SPARQL query service
    fuseki:serviceUpdate     "update" ;    # SPARQL update service
    fuseki:serviceReadWriteGraphStore "data" ;     # SPARQL Graph store protocol
    #fuseki:serviceReadGraphStore    "data" ;     # SPARQL Graph store protocol (read only)
    fuseki:endpoint [ fuseki:operation fuseki:shacl ; fuseki:name "shacl" ] ;
    fuseki:dataset           <#text_ds> ;
#    fuseki:dataset           <#tdb> ;
    .

<#text_ds> a text:TextDataset , geosparql:geosparqlDataset ;
    text:dataset <#tdb> ;
    text:index <#lucene> ;
    geosparql:dataset <#tdb> ;
    geosparql:spatialIndexFile     "/fuseki-base/databases/tdb/spatial.index";
    .

<#tdb> a tdb:DatasetTDB ;
    tdb:location "/fuseki-base/databases/tdb" ;
    tdb:unionDefaultGraph true ;
    .

<#lucene> a text:TextIndexLucene ;
    text:directory <file:/fuseki-base/databases/lucene> ;
    text:storeValues true ;
    text:entityMap <#entity-map> ;
    .

<#entity-map> a text:EntityMap ;
    text:entityField "uri" ;
    text:graphField "graph" ; ## enable graph-specific indexing
    text:defaultField "text" ; ## Must be defined in the text:map
    text:uidField "uid" ;
    text:langField "lang" ;
    text:map (
         [ text:field "text" ; text:predicate skos:prefLabel ]
         [ text:field "text" ; text:predicate skos:altLabel ]
         [ text:field "text" ; text:predicate skos:hiddenLabel ]
         [ text:field "text" ; text:predicate skos:notation ]
         )
    .

And my test query:

PREFIX geo: <http://www.opengis.net/ont/geosparql#>
PREFIX geof: <http://www.opengis.net/def/function/geosparql/>

SELECT ?point
WHERE {
    BIND("POLYGON ((-64.8 32.3, -65.5 18.3, -80.3 25.2, -64.8 32.3))"^^geo:wktLiteral AS ?polygon)
    VALUES ?point { "POINT (-70.268555 25.522615)"^^geo:wktLiteral "POINT (-60.996094 24.846565)"^^geo:wktLiteral }
    FILTER(geof:sfWithin(?point, ?polygon))
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions