Difference between revisions of "SPARQL"
Line 33: | Line 33: | ||
The natural language statement "Dubai is located in United Arab Emirates" is purposely slightly modified to a more "computer-ready" form. | The natural language statement "Dubai is located in United Arab Emirates" is purposely slightly modified to a more "computer-ready" form. | ||
The predicate has been written as '''is-located-in''' to make it a proper Identifier. And the country-name "United Arab Emirates" has been replaced by its two letter United Nations Location Code '''AE'''. | The predicate has been written as '''is-located-in''' to make it a proper Identifier. And the country-name "United Arab Emirates" has been replaced by its two letter United Nations Location Code '''AE'''. | ||
+ | === TripleStore === | ||
+ | A Triplestore is a database that can store and query triples. I fact for educational purposes I have written a simple Triplestore myself: | ||
+ | * https://github.com/BITPlan/org.sidif.triplestore | ||
+ | For that simple triplestore the triples are supplied in {{Link|target=SiDiF|title=Simple Data Interchange Format}}. |
Revision as of 12:15, 4 January 2018
What is SPARQL
SPARQL is a query language for semantic databases using the Resource Description Framework (RDF) format
Tutorial
There are quite a few tutorials out there for SPARQL e.g.
This tutorial is for people which are new to semantic concepts but would like to use an example with a fair amount of data but not too much of complexity in the structure of the data.
Semantic Concepts
Personally I learned Semantic Concepts using Semantic MediaWiki see
When using SPARQL a tutorial needs to get a slightly different touch, so for those who know the talk above I'll explain some key concepts based on an example using:
- Countries
- Towns
- Municipal Units
Triples
A semantic statement has the form
<subject> <predicate> <object>
e.g.
Dubai is-located-in AE
is such a semantic statement which is also called a Triple.
The natural language statement "Dubai is located in United Arab Emirates" is purposely slightly modified to a more "computer-ready" form. The predicate has been written as is-located-in to make it a proper Identifier. And the country-name "United Arab Emirates" has been replaced by its two letter United Nations Location Code AE.
TripleStore
A Triplestore is a database that can store and query triples. I fact for educational purposes I have written a simple Triplestore myself:
For that simple triplestore the triples are supplied in Simple Data Interchange Format.