<commit_before>= GeoSPARQL 

RDF4J offers an extended algebra for partial http://www.opengeospatial.org/standards/geosparql[GeoSPARQL] support. When enabled, this offers additional geospatial functionality as part of the SPARQL engine, on top of any RDF4J repository, using the well-known Spatial4J and JTS libraries for geospatial reasoning.

To enable GeoSPARQL support, all you need to do is include the `rdf4j-queryalgebra-geosparql` Maven module in your project:

[source, xml]
----
<dependency>
  <groupId>org.eclipse.rdf4j</groupId>
  <artifactId>rdf4j-queryalgebra-geosparql</artifactId>
</dependency>
----

NOTE: this module is currently not included by default in the RDF4J Server, so if you plan to use GeoSPARQL in the RDF4J Server, you will need to download this jar separately and add it to the runtime classpath of the webapp. 

== Adding geospatial data to the Repository

By default, RDF4J only supports GeoSPARQL functions on top of geospatial data represented as so-called Well-Known Text (WKT)  strings.

For example, to model the coordinates of landmarks like the Eiffel Tower in Paris or the Tower Bridge in London, you could do something like this:

[source]
----
@prefix geo: <http://www.opengis.net/ont/geosparql#> .
@prefix sf: <http://www.opengis.net/ont/sf> .
@prefix ex: <http://example.org/> .

ex:eiffelTower a ex:Landmark ;
          geo:hasGeometry ex:coordinates-et.
ex:coordinates-et a sf:Point; 
        geo:asWKT "POINT(48.8584 2.2945)"^^geo:wktLiteral .
ex:towerBridge a ex:Landmark ;
          geo:hasGeometry ex:coordinates-tb.
ex:coordinates-tb a sf:Point; 
        geo:asWKT "POINT(51.5055 0.0754)"^^geo:wktLiteral .
----

After adding this data to a repository, we can use a GeoSPARQL query to get,<commit_msg>Swapped long/lat + correct coordinate<commit_after>= GeoSPARQL 

RDF4J offers an extended algebra for partial http://www.opengeospatial.org/standards/geosparql[GeoSPARQL] support. When enabled, this offers additional geospatial functionality as part of the SPARQL engine, on top of any RDF4J repository, using the well-known Spatial4J and JTS libraries for geospatial reasoning.

To enable GeoSPARQL support, all you need to do is include the `rdf4j-queryalgebra-geosparql` Maven module in your project:

[source, xml]
----
<dependency>
  <groupId>org.eclipse.rdf4j</groupId>
  <artifactId>rdf4j-queryalgebra-geosparql</artifactId>
</dependency>
----

NOTE: this module is currently not included by default in the RDF4J Server, so if you plan to use GeoSPARQL in the RDF4J Server, you will need to download this jar separately and add it to the runtime classpath of the webapp. 

== Adding geospatial data to the Repository

By default, RDF4J only supports GeoSPARQL functions on top of geospatial data represented as so-called Well-Known Text (WKT)  strings.

For example, to model the coordinates of landmarks like the Eiffel Tower in Paris or the Tower Bridge in London, you could do something like this:

[source]
----
@prefix geo: <http://www.opengis.net/ont/geosparql#> .
@prefix sf: <http://www.opengis.net/ont/sf> .
@prefix ex: <http://example.org/> .

ex:eiffelTower a ex:Landmark ;
          geo:hasGeometry ex:coordinates-et.
ex:coordinates-et a sf:Point; 
        geo:asWKT "POINT(2.2945 48.8584)"^^geo:wktLiteral .
ex:towerBridge a ex:Landmark ;
          geo:hasGeometry ex:coordinates-tb.
ex:coordinates-tb a sf:Point; 
        geo:asWKT "POINT(-0.0754 51.5055)"^^geo:wktLiteral .
----

After adding this data to a repository, we can use a GeoSPARQL query to get,
{'fraction_non_alphanumeric': 0.09204191447182102, 'fraction_numerical': 0.017558765222316624, 'mean_word_length': 4.156204379562044, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3931322', 'n_tokens_mistral': 1218, 'n_tokens_neox': 1117, 'n_words': 410}