GithubHelp home page GithubHelp logo

geoknow / linkedgeodata Goto Github PK

View Code? Open in Web Editor NEW
131.0 33.0 32.0 9.53 MB

OpenStreetMap for the Semantic Web

Home Page: http://linkedgeodata.org

License: GNU General Public License v3.0

Makefile 1.54% Shell 25.43% Java 26.31% Standard ML 14.42% PLpgSQL 9.38% PHP 19.60% Dockerfile 3.29% HTML 0.02%
obda sparql-to-sql rdf openstreetmap ontop sparqlify virtuoso semantic-web sparql

linkedgeodata's Introduction

Welcome to LinkedGeoData: Providing OpenStreetMap data as RDF

LinkedGeoData (LGD) is an effort to add a spatial dimension to the Web of Data / Semantic Web. LinkedGeoData uses the information collected by the OpenStreetMap project and makes it available as an RDF knowledge base according to the Linked Data principles. It interlinks this data with other knowledge bases in the Linking Open Data initiative.

The project web site can be found here. If you are running Ubuntu then this repository contains everything you need to transform OpenStreetMap data to RDF yourself. For other systems please consider contributing adaptions of the existing scripts.

Quick Start

The following commands should get you started with a running Monaco dataset:

git clone https://github.com/GeoKnow/LinkedGeoData.git
cd LinkedGeoData
make clean
make
docker-compose up

# Quirk: Sometimes the nominatim container startup fails
# indicated by an error message that only reverse-only search is available
# In that case restart the container:
docker-compose restart lgd-nominatim-web

Services will run under these ports:

Important Notes

  • The default settings are in env.dist.
  • If the file .env. does not exist then the make invocation will also create it from env.dist.
  • The .env file by default contains the setting PROJECT_NAME=linkedgeodata. Make sure that the project name matches the lower-case spelling of the name of the folder containing the git repo.
  • Most configuration changes, such as port and database settings, take effect when restarting the containers.
  • Many data and config files are stored in volumes whose naming is ${parent-directory}_${service-name}-vol. For example linkedgeodata_lgd-osmosis-sync-vol. You can check existing volumes with docker volume ls.
  • Before starting the containers the sources for the initial data and incremental updates can be configured. These settings should not be changed after starting the containers.
  • SQL scripts and RDB2RDF Mappings are located in the sql and sml folders, respectively. The build process bundles these up as a debian package that gets installed in the docker container on docker build. Therefore, changes to these resources require the debian package to be updated.

Recent Updates

How It Works

The architecture shown in the image below. The docker setup is located in the linkedgeodata-docker folder.

LGD Dockerized Architecture Overview

  • This project first uses Osmosis to initialize a 'raw' OpenStreetMap postgis database (using simple schema) from a .osm.pdf file.
  • Then, this database is extended with additional tables containing RDF mapping - and interlinking - information. Also, helper views are provided for simplifying access to the integrated information.
  • Further, a nominatim setup (based on osm2pgqsl) is performed to further enrich the initial database osm data.
  • A set of RDB2RDF mappings is provided that enables running SPARQL queries over the postgis database. The SPARQL-2-SQL rewriting engine we use is Sparqlify.
  • Dumps are generated by simply running preconfigured SPARQL queries.

Project layout

This project requires Make and Apache Maven to build (Java 11+ required). Maven builds are not dockerized. Therefore any built artifacts will be cached in the local repository as usual.

Primary resources

They include the SQL files and mappings that enable rewriting SPARQL queries to SQL ones over an OpenStreetMap (and Nominatim) database. Furthermore, bash scripts are avaiable for helping setting up an LGD database. The mavenization and dockerization re-package these resources.

The following folders contain resources that are copied when building the lgd-tools-resources jar bundle

  • sql SQL scripts for extending on OSM simple schema database
  • sml The mapping files in SML format. Convert to e.g. r2rml using the mapping converter.

The scripts in the bin folder become part of the debian packaging of the cli tools lgd-tools-pkg-deb-cli

  • bin Bash scripts for setting LinkedGeoData up (Ubuntu)

Thirdparty resources

There is a pom.xml that creates a jar file from a snapshot of the nominatim git. Especially for development this is much faster than repeated clones of the full git repo.

Contributions Welcome

The docker-based architecture is aimed at making it easy to contribute new or alternative components that can sit side-by-side with the core of the system - which is the a virtual knowledge graph view over an OSM database. Please open issues for discussion.

Examples include but are not limited to:

  • A more modern Linked Data Interface that displays GeoSPARQL geometries out-of-the-box
  • Nicer SPARQL interface (YASGUI)
  • Another data virtualization engine in order to ease comparision with the already integrated ones
  • Updates to the existing OSM-RDF mappings, proposals about how this system could be improved.
  • Proposals for a better IRI schema. For example, the 'triplify' in the IRIs is archaic. Migration to the pattern used by Sophox seems very worthwhile. Because of the virtual knowledge graph approach there should be no problem to use the legacy approach in parallel.
  • General proposals for architecture improvements (e.g. config options in the docker setup to improve modularity)

Dockerfiles for services such as a Linked Data or SPARQL interfaces should be designed to allow configuration of the target SPARQL endpoint(s), ideally via the docker environment.

License

The content of this project are licensed under the GPL v3 License.

linkedgeodata's People

Contributors

aklakan avatar apano-on avatar ghxiao avatar gordiandziwis avatar jlleitschuh avatar konradhoeffner avatar msherif avatar patrickwestphal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

linkedgeodata's Issues

update db form planet file

I deployed the lgd project on a linux machine and imported the swiss planet file. I now wondered if i can update the db without deleting and reimporting the complete planet file?

many thanks,
Norman

add link to layar app

There is a mention in https://www.semantic-web-journal.net/content/linkedgeodata-core-web-spatial-open-data of a mobile app based on layar https://layar.com/. At layar, they forward to blipbuilder.

If the app still exists, link it from linkedgeodata.org menu.

Reason: end-user applications would make end users benefit from the semantic web. That would motivate more developers to provide apps and more publishers to contribute data.

Edit: as the paper is from 2012, and the app from 2012, the layar app may not be maintained anymore. Still, such app would be highly relevant still today for the purpose of generating a positive feedback look of using & creating LinkedGeoData

Edit: even more relevant today as I prefer the web and 3-dimensional cyberspace and augmented reality to be open and not to be a proprietary show by a single player like "meta".

Interlinking sports with Wikidata/DBpedia (lgdo:featuresSport)

Hello,

I see LGD uses lgdo:featuresSport eg.
lgdo:featuresSport lgdo:Soccer

OSM has a page which links sport tags to Wikipedia pages
http://wiki.openstreetmap.org/wiki/Key:sport

I would like to help somehow with creating clear mapping between sports in lgdo: and same ones in dbpedia: (and wikidata)

How this could work?

I also notice that some sports don't show up in LGD eg.
curl http://linkedgeodata.org/triplify/way337581223 -L -H "Accept: text/turtle"

It doesn't have lgdo:featuresSport even that OSM has sport=roller_skating

http://www.openstreetmap.org/way/337581223

We prepare for a hackathon next friday where we want to use data about locations and sports available. Our prototype will use Linked Data and we would happily reuse as much as possible work already done by LGD 😄

Cheers!

OpenStreetMap import will break if links aren't updated before May 7

http://planet.openstreetmap.org is available over https, and will start redirecting to https on 2018-05-07.

Your project seems to be using osmosis, which will not follow redirects by default.

Would it please be possible to update all files from http://planet.openstreetmap.org to httpS://planet.openstreetmap.org before then?

Ideally, would it be possible to make all requests to openstreetmap.org over https? All services respond over https and will start redirecting soon.

500 Request failed for http://linkedgeodata.org/page/triplify/node2353043846

When I open http://linkedgeodata.org/page/triplify/node2353043846 in the browser, I get a HTTP Status exception:

HTTP Status 500 - HttpException: 500 Request failed.

type Exception report

message HttpException: 500 Request failed.

description The server encountered an internal error that prevented it from fulfilling this request.

exception

HttpException: HttpException: 500 Request failed.: HttpException: 500 Request failed.
    com.hp.hpl.jena.sparql.engine.http.HttpQuery.execCommon(HttpQuery.java:337)
    com.hp.hpl.jena.sparql.engine.http.HttpQuery.execGet(HttpQuery.java:189)
    com.hp.hpl.jena.sparql.engine.http.HttpQuery.exec(HttpQuery.java:144)
    com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execModel(QueryEngineHTTP.java:160)
    com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execDescribe(QueryEngineHTTP.java:154)
    com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execDescribe(QueryEngineHTTP.java:152)
    de.fuberlin.wiwiss.pubby.RemoteSPARQLDataSource.execDescribeQuery(RemoteSPARQLDataSource.java:74)
    de.fuberlin.wiwiss.pubby.RemoteSPARQLDataSource.getResourceDescription(RemoteSPARQLDataSource.java:52)
    de.fuberlin.wiwiss.pubby.servlets.BaseServlet.getResourceDescription(BaseServlet.java:61)
    de.fuberlin.wiwiss.pubby.servlets.PageURLServlet.doGet(PageURLServlet.java:38)
    de.fuberlin.wiwiss.pubby.servlets.BaseURLServlet.doGet(BaseURLServlet.java:33)
    de.fuberlin.wiwiss.pubby.servlets.BaseServlet.doGet(BaseServlet.java:89)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:727)

root cause

HttpException: 500 Request failed.
    com.hp.hpl.jena.sparql.engine.http.HttpQuery.execCommon(HttpQuery.java:299)
    com.hp.hpl.jena.sparql.engine.http.HttpQuery.execGet(HttpQuery.java:189)
    com.hp.hpl.jena.sparql.engine.http.HttpQuery.exec(HttpQuery.java:144)
    com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execModel(QueryEngineHTTP.java:160)
    com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execDescribe(QueryEngineHTTP.java:154)
    com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execDescribe(QueryEngineHTTP.java:152)
    de.fuberlin.wiwiss.pubby.RemoteSPARQLDataSource.execDescribeQuery(RemoteSPARQLDataSource.java:74)
    de.fuberlin.wiwiss.pubby.RemoteSPARQLDataSource.getResourceDescription(RemoteSPARQLDataSource.java:52)
    de.fuberlin.wiwiss.pubby.servlets.BaseServlet.getResourceDescription(BaseServlet.java:61)
    de.fuberlin.wiwiss.pubby.servlets.PageURLServlet.doGet(PageURLServlet.java:38)
    de.fuberlin.wiwiss.pubby.servlets.BaseURLServlet.doGet(BaseURLServlet.java:33)
    de.fuberlin.wiwiss.pubby.servlets.BaseServlet.doGet(BaseServlet.java:89)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:727)

ICAO code incorrectly specified as IATA code

Patiala Airport is listed with the IATA code VIPL which is actually its ICAO code, see http://linkedgeodata.org/triplify/node412253158

In general, there are more than 200 airports with IATA codes that do not follow the required trigram format. I propose to only use IATA codes that are letter trigrams.

PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX ocg: <http://www.opengis.net/ont/geosparql#>
PREFIX dbp: <http://dbpedia.org/property/>
PREFIX lgdo: <http://linkedgeodata.org/ontology/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX meta: <http://linkedgeodata.org/meta/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX geom: <http://geovocab.org/geometry#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/terms/>
SELECT ?y ?v0
WHERE {
?y rdf:type lgdo:Airport .
?y lgdo:iata ?iata2 .
filter(!regex(?iata2,"^[A-Z]{3}$")).
?y rdf:type meta:Node .
?y lgdo:iata ?v0 .
}

Problem when deploying LinkedGeoData

Hi,

I'm trying to follow the example in the README file. I get thorough until I do:

sparqlify-tool -P lgd-example ontology

... I get the following error:

2017-12-23 23:09:00,746 WARN org.aksw.sparqlify.core.cast.TypeSystemImpl: Skipping: geography, geography
2017-12-23 23:09:00,746 WARN org.aksw.sparqlify.core.cast.TypeSystemImpl: Skipping: geometry, geometry
2017-12-23 23:09:00,746 WARN org.aksw.sparqlify.core.cast.TypeSystemImpl: Skipping: timestamp, timestamp
2017-12-23 23:09:01,145 INFO org.aksw.sparqlify.web.Main: Database product: PostgreSQL
2017-12-23 23:09:01,169 INFO org.aksw.sparqlify.config.v0_2.bridge.SchemaProvider: Retrieving schema for query: SELECT * FROM "users"
2017-12-23 23:09:01,169 WARN org.aksw.sparqlify.config.v0_2.bridge.SchemaProvider: Using ugly hack for adding a limit
Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: org.postgresql.util.PSQLException: ERROR: relation "users" does not exist
Position: 15
at org.aksw.sparqlify.config.v0_2.bridge.SchemaProviderImpl.createSchemaForQueryString(SchemaProviderImpl.java:84)
at org.aksw.sparqlify.config.v0_2.bridge.SchemaProviderImpl.createSchemaForRelationName(SchemaProviderImpl.java:58)
at org.aksw.sparqlify.config.v0_2.bridge.SyntaxBridge.create(SyntaxBridge.java:228)
at org.aksw.sparqlify.config.v0_2.bridge.ConfiguratorCandidateSelector.configure(ConfiguratorCandidateSelector.java:24)
at org.aksw.sparqlify.web.Main.main(Main.java:232)
Caused by: java.lang.RuntimeException: org.postgresql.util.PSQLException: ERROR: relation "users" does not exist
Position: 15
at org.aksw.sparqlify.config.v0_2.bridge.BasicTableProviderJdbc.getBasicTableInfo(BasicTableProviderJdbc.java:27)
at org.aksw.sparqlify.config.v0_2.bridge.SchemaProviderImpl.createSchemaForQueryString(SchemaProviderImpl.java:80)
... 4 more
Caused by: org.postgresql.util.PSQLException: ERROR: relation "users" does not exist
Position: 15
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2310)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2023)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:217)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:421)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:318)
at org.postgresql.jdbc.PgStatement.executeQuery(PgStatement.java:281)
at com.jolbox.bonecp.StatementHandle.executeQuery(StatementHandle.java:464)
at org.aksw.sparqlify.config.v0_2.bridge.BasicTableProviderJdbc.getRawTypes(BasicTableProviderJdbc.java:42)
at org.aksw.sparqlify.config.v0_2.bridge.BasicTableProviderJdbc.getBasicTableInfo(BasicTableProviderJdbc.java:25)
... 5 more

Any clue?
Thank you
D063520

Performance issue on lgd_way_tags_resource_k

The following query on with lgd_node_tags_resource_k works as expected, but on way tags the query plan goes wrong. Either the view definition could be optimized, or the magic constants in the postgresql config could be tweaked.

SELECT COUNT(*) "cnt" FROM ( SELECT true FROM "lgd_way_tags_resource_kv" a_250528 WHERE (a_250528."property" IS NOT NULL) AND (a_250528."object" IS NOT NULL) AND (a_250528."way_id" IS NOT NULL) AND (a_250528."object" = 'http://linkedgeodata.org/ontology/BuildingMonastery'::text) AND (a_250528."property" = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'::text) LIMIT 100 ) a;

Vaccuum full analyze did not help.

lgd-createdb.sh error for interlinks.sql

As the log appear on:

SET
SET
SET
SET
SET
SET
SET
Password for user postgres:
psql:/tmp/linkedgeodata/interlinks.sql:602200: ERROR:  missing data for column "o"
CONTEXT:  COPY lgd_interlinks, line 1: "LGD-Interlinks-110406-GeoNames/"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.