FREME Enrichment Templates

These templates are used by the e-Link service.

Template id: 1 - DBpedia

Description:

enriches named entities in the input document with a list of museums close to that entity. The template is executed for every named entity in the input document.

Endpoint:

http://dbpedia.org/sparql

 PREFIX dbpedia: <http://dbpedia.org/resource/ >
		PREFIX dbpedia-owl: <http://dbpedia.org/ontology/ >
		PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns# >
		PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos# >
		CONSTRUCT {
		?museum <http://xmlns.com/foaf/0.1/based_near > <@@@entity_uri@@@ > .
		}
		WHERE {
		<@@@entity_uri@@@ > geo:geometry ?citygeo .
		?museum rdf:type <http://schema.org/Museum > .
		?museum geo:geometry ?museumgeo .
		FILTER (<bif:st_intersects >(?museumgeo, ?citygeo, 10))
		} LIMIT 10 
Example data for enrichment can be downloaded from here.

Test Query:

 curl -v -X POST -d @test-for-template-1.ttl "https://api.freme-project.eu/current/e-link/documents/?outformat=turtle&templateid=1" -H "Content-Type: text/turtle"
	

Template id: 2 - DBpedia live

Description:

enriches named entities in the input document with a list of events close to that entity. The template is executed for every named entity in the input document.

Endpoint:

http://live.dbpedia.org/sparql

 PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns# >
		CONSTRUCT {
		?event <http://dbpedia.org/ontology/place > <@@@entity_uri@@@ > .
		}
		WHERE {
		?event rdf:type <http://dbpedia.org/ontology/Event > .
		?event <http://dbpedia.org/ontology/place > <@@@entity_uri@@@ > .
		} LIMIT 10 
Example data for enrichment can be downloaded from here.

Test Query:

 curl -v -X POST -d @test-for-template-2.ttl "https://api.freme-project.eu/current/e-link/documents/?outformat=turtle&templateid=2" -H "Content-Type: text/turtle" 

Template id: 3 - GeoKnow

Description:

Enrich place with longitude and latitude coordinates fetched form the GeoKnow database.

Endpoint:

http://factforge.net/sparql

 PREFIX geo-pos: <http://www.w3.org/2003/01/geo/wgs84_pos# >
		CONSTRUCT {
		<@@@entity_uri@@@ > geo-pos:lat ?long .
		<@@@entity_uri@@@ > geo-pos:lat ?lat .
		}
		WHERE {
		<@@@entity_uri@@@/ > geo-pos:lat ?lat .
		<@@@entity_uri@@@/ > geo-pos:long ?long .
		} 
Example data for enrichment can be downloaded from here.

Test Query:

 curl -v -X POST -d @test-for-template-3.ttl "https://api.freme-project.eu/current/e-link/documents/?outformat=turtle&templateid=3" -H "Content-Type: text/turtle" 

Template id: 5 - Europeana

Description:

Retrieve 5 18th century Europeana objects from a place (country).

Endpoint:

http://sparql.europeana.eu

 PREFIX edm: <http://www.europeana.eu/schemas/edm/ >
		PREFIX ore: <http://www.openarchives.org/ore/terms/ >
		CONSTRUCT {
		?CHO edm:HasMet <@@@entity_uri@@@ >
		} WHERE {
		?EuropeanaObject  edm:year  ?year ;
		edm:hasMet <@@@entity_uri@@@ > .
		?EuropeanaObject ore:proxyFor ?CHO .
		FILTER (?year < "1800")
		FILTER (?year > "1700")
		} LIMIT 5 
Example data for enrichment can be downloaded from here.

Test Query:

 curl -v -X POST -d @test-for-template-5.ttl "https://api.freme-project.eu/current/e-link/documents/?outformat=turtle&templateid=5" -H "Content-Type: text/turtle" 

Template id: 6 - DBpedia live

Description:

enriches named entities in the input document with a list of events close to that entity. This is a template with a user defined parameter event_type, so when calling the endpoint the event_type parameter should be specified.

Endpoint:

http://live.dbpedia.org/sparql

 PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns# >
		CONSTRUCT {
		?event <http://dbpedia.org/ontology/place > <http://dbpedia.org/resource/Berlin > .
		}
		WHERE {
		?event rdf:type <http://dbpedia.org/ontology/@@@event_type@@@ > .
		?event <http://dbpedia.org/ontology/place > ?o .
		} LIMIT 10 
Example data for enrichment can be downloaded from here.

Test Query:

 curl -v -X POST -d @test-for-template-6.ttl "https://api.freme-project.eu/current/e-link/documents/?outformat=turtle&templateid=6&event_type=SocietalEvent" -H "Content-Type: text/turtle" 

Template id: 7 - Linked Geo Data

Description:

enriches a named entity of type place with a list of 10 bakeries in radius of 10km from the place.

Endpoint:

http://linkedgeodata.org/vsnorql/

 PREFIX owl: <http://www.w3.org/2002/07/owl# >
		PREFIX ogc: <http://www.opengis.net/ont/geosparql# >
		PREFIX geom: <http://geovocab.org/geometry# >
		PREFIX lgdo: <http://linkedgeodata.org/ontology/ >
		PREFIX bif: <http://www.openlinksw.com/schemas/bif# >
		CONSTRUCT {
		?s <http://xmlns.com/foaf/0.1/based_near > <@@@entity_uri@@@ > .
		} WHERE {
		?s
		a lgdo:Bakery ;
		geom:geometry [ ogc:asWKT ?sg ] .
		?a
		owl:sameAs <@@@entity_uri@@@ >
		geom:geometry [ ogc:asWKT ?ag ] .
		FILTER(bif:st_intersects(?sg, ?ag, 10))
		} LIMIT 10 
Example data for enrichment can be downloaded from here.

Test Query:

 curl -v -X POST -d @test-for-template-7.ttl "https://api.freme-project.eu/current/e-link/documents/?outformat=turtle&templateid=7" -H "Content-Type: text/turtle" 
Note: there is an issue with the SPARQL endpoint.

Template id: 8 - Linked Geo Data

Description:

Retrieve all bakeries 10km close to a place.

Endpoint:

http://linkedgeodata.org/vsnorql

  PREFIX owl: <http://www.w3.org/2002/07/owl# >
		PREFIX ogc: <http://www.opengis.net/ont/geosparql# >
		PREFIX geom: <http://geovocab.org/geometry# >
		PREFIX lgdo: <http://linkedgeodata.org/ontology/ >
		CONSTRUCT {
		?s <http://xmlns.com/foaf/0.1/based_near > <@@@entity_uri@@@ > .
		} WHERE {
		?s
		a lgdo:Bakery ;
		geom:geometry [ ogc:asWKT ?sg ] .
		?a
		owl:sameAs <@@@entity_uri@@@ > ;
		geom:geometry [ ogc:asWKT ?ag ] .
		FILTER(bif:st_intersects(?sg, ?ag, 10))
		} LIMIT 10 

Example data for enrichment can be downloaded from here.
curl -v -X POST "https://api.freme-project.eu/current/e-link/documents?templateid=4448&informat=turtle&outformat=turtle" -d @nif-to-enrich.txt -H "Content-Type:"
Note: there is issue with the SPARQL endpoint.