Now that I have figured out how to apply a context to our data using JSON-LD's syntax, we need to publish our data to be able to query against it in our web app. There are many options to publishing our data, and Dr. Bansal recommended Fuseki. To try it out, I installed Fuseki on my local machine. Fuseki is a SPARQL server. I am using it as a standalone server. We decided to go with Fuseki, because it's open source and supports JSON-LD. Once I installed the server, I was able to upload our JSON-LD documents. The Fuskei server provides a great interface that allows you to create your datasets, upload data, test SPARQL queries against your uploaded data. SPARQL is very similar to SQL, but there are some very distinct differences, that are confusing at first. The part that confused me at first was how you have to reference keys in your data. I was able to figure out the syntax and was able to produce valid queries against my data. Below is a basic SPARQL select statement to get all of the stadiums names: PREFIX schema: <http://schema.org/> As you can see, you can provide your query a prefix. This allows you to reference keys in your data without having to provide the entire URI; it just makes the queries more readable. The ?name is known as a SPARQL variable. SPARQL variables start with a ? and can match any node (resource or literal) in the dataset. Inside of the where clause is where you can see is where I can ask for all StadiumsOrArenas and names that are linked with the schema:name predicate. This is called a Triple Pattern. Triple Patterns are just like triples, except that any of the parts of a triple can be replaced with a variable. This is very powerful, because it allows us to discover unknown relationships.
I need to continue testing and running queries against our dataset to ensure I have properly defined our Schema that produces useful queries. This part of the project is very exciting, because this is actually what will set our application apart from any other real-estate application.
0 Comments
|
CategoriesArchives
May 2016
|