Giter Club home page Giter Club logo

p3-simple-demo-app's Introduction

p3-simple-demo-app

A simple demo app that shows pubs, restaurants, pharmacies, accommodations, museums and - optionally - events in Trentino and Tuscany regions. You can click the location you are interested in to see what can be found nearby. To use event data from a specific resource, use the “events” attribute in the URL in which provide the URI of the resource: app URL/?events=http://sandbox.fusepool.info:8181/ldp/demo/wr-ldpc/Trentino-Events/events-xml-xml-transformed

It uses the following SPARQL endpoint: http://sandbox.fusepool.info:8181/sparql/select

...and works with this SPARQL query:

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX schema: <http://schema.org/>

SELECT distinct ?name ?type ?lat ?long ?eventLabel ?eventDescription ?eventCategory ?eventCategory ?eventStart ?eventEnd

FROM <http://sandbox.fusepool.info:8181/ldp/tuscany-museums-1/y-csv-transformed>
FROM <http://sandbox.fusepool.info:8181/ldp/tuscany-restaurants-1/c-csv-transformed>
FROM <http://sandbox.fusepool.info:8181/ldp/tuscany-accommodations-1/v-csv-transformed>
FROM <http://sandbox.fusepool.info:8181/ldp/trentino-pharmacies/c>
FROM <http://sandbox.fusepool.info:8181/ldp/demo/wr-ldpc/Trentino-Events/events-xml-xml-transformed>

WHERE { { 
	?entity schema:address ?address ;
  			geo:lat ?lat ;
			geo:long ?long ;
			rdf:type ?type ;
			rdfs:label ?name .	}
   UNION {
 	?entity schema:event ?event ;
 			geo:lat ?lat ;
 			geo:long ?long ;
 			rdf:type ?type ;
 			rdfs:label ?name . 
	?event rdfs:label ?eventLabel ;
 		   schema:description ?eventDescription ;
 		   schema:category ?eventCategory ;
 		   schema:startDate ?eventStart ;
 		   schema:endDate ?eventEnd .
 	FILTER ( ?eventStart >= "2015-03-01"^^xsd:date && ?eventEnd <= "2015-03-01"^^xsd:date )
 	FILTER(langMatches(lang(?eventLabel), "it"))
 	FILTER(langMatches(lang(?eventCategory), "it"))
 	FILTER(langMatches(lang(?eventDescription), "it"))
 	}
   FILTER ( ( ?lat >= 45.96365339743794 && ?lat <= 46.06365339743793 )
  	 && ( ?long >= 10.900897290708068 && ?long <= 11.00089729070807 ) ) }

ORDER BY ?name

...where:

  • the last FROM clause is used only if a resource URI is provided in the query string (the other four resource URIs are static)
  • eventStart and eventEnd uses exactly what is typed to the input fields on the top left corner
  • lat and long come from the position of the marker on the map

An example installation can be found here:

http://fusepoolp3.github.io/p3-simple-demo-app/?events=http://sandbox.fusepool.info:8181/ldp/demo/wr-ldpc/Trentino-Events/events-xml-xml-transformed

p3-simple-demo-app's People

Contributors

szluca avatar retog avatar

Stargazers

Trevor Lazarus avatar

Watchers

 avatar Rupert Westenthaler avatar Adrian Gschwend avatar James Cloos avatar Giuliano Mega avatar Gabor Remenyi avatar Milos Jovanovik avatar Andrii avatar

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.