General Principles of Intellectual Property: Concepts of Intellectual Proper...
Publishing Linked Data with LODSPeaKr
1. Publishing Linked Data
with LODSPeaKr
Alvaro Graves
gravea3@rpi.edu
Twitter: @alvarograves
1
2. What is Linked Data?
Good Idea: There are lots of information
available about government, geographical
organizations, schools, etc. Lets publish
it!
State States
name
County
name
Counties
Schools
School
No. of name Countries
students
2
3. What is Linked Data?
Even better idea: Lets publish this data in a machine-
readable form and use HTTP URIs (http://...) to
describe things, so others can reuse them to refer to
the same things!
Government Data
State States
name
County
name
Counties
Schools
School
No. of name Countries
students
3
4. Why Linked Data?
Now, others can refer to the same
entities as me and add more data!
Government Data
State States
name
County
name
Counties
Schools
International Organization Data
School Measure
No. of name Countries value
students Year
Indicators
Country Categories
name
Category
name
4
5. Why Linked Data?
“If you want to scale up and, specially, if
you want to link and integrate, then you
should consider Linked Data”
Government Data José M. Alonso
State States
name
County
name
Counties
Schools
International Organization Data
School Measure
No. of name Countries value
students Year
Indicators
Country Categories
name
Category
name
5
6. Motivation
• How can organizations publish Linked Data they create?
• How can they build applications based on Linked Data?
• How can they use other people’s Linked Data?
6
7. LODSPeaKr
• A framework for Linked Data-driven applications
• Expose data in multiple formats (RDF/XML, Turtle, *)
automatically
• Create services, APIs and webapps easily
• Easy to install in most LAMP systems
• Only knowledge needed:
• SPARQL
• HTML
• Haanga, a pseudocode-like template language
7
8. Default installation
By default LODSPeaKr
provides:
• Search by label
• Navigation through
entities
•Show all properties of an
entity
• Data in RDFa, RDF/XML
and more
8
13. Building Linked Data apps:
Use of Components
Two main (among other) components
• Types
• Define how information is displayed for entities of
the same type (persons, countries)
• Services
• Create services for aggregated information
13
14. Building applications:
SPARQL + HTML + Haanga
main.query
SELECT DISTINCT ?person ?personName
SPARQL
WHERE {
?person a foaf:Person;
foaf:name ?personName .
}
ORDER BY ?personName
html.template
<ul>
HTML + Haanga
{% for row in models.main %}
<li>
<a href="{{row.person.value}}">
{{row.personName.value}}
</a>
</li>
{% endfor %} 14
</ul>
15. A Simple JSON API
Adding a JSON interface is simple as adding a
new template
json.template
{“people”: [
{% for row in models.main %}
{
“uri”: “{{row.person.value}}”,
“name”: “{{row.personName.value}}”
}
{% endfor %}
]}
15
16. Filters
• Filters in Haanga allow you to process data
before presenting it to the user
{% for i in models.main %}
{{i.personName.value|upper}}
{% endfor %}
“john smith” => “JOHN SMITH”
• LODSPeaKr also provides visualizations
based on filters
{{models.main|GoogleVizColumnChart:”xvar,yvar”}}
DATA =>
16
17. Query workflows
LODSPeaKr can query multiple endpoints, using results
already obtained to specify new queries
SPARQL
Endpoint
LODSPeaKr
17
18. Query workflows
LODSPeaKr can query multiple endpoints, using results
already obtained to specify new queries
SPARQL
Endpoint
SPARQL
Endpoint
LODSPeaKr
18
19. Query workflows
LODSPeaKr can query multiple endpoints, using results
already obtained to specify new queries
SPARQL
Endpoint SPARQL
Endpoint
SPARQL
Endpoint
LODSPeaKr
19
20. Conclusion
• LODSPeaKr is a powerful tool for building
webapps based on Linked Data
• It makes it really simple to publish 5-star
Linked Data
• LODSPeaKr make easier to integrate
external data and create mashups,
simplifying the work for developers
20
23. Components
It is possible to define a set of queries and templates for
each type of things (people, countries)
Bash
$ utils/lodspk.sh create type foaf:Person
components/
|
->types/
File directory
|
->foaf:Person/
|
->html.template
|
->queries/
|
->main.query
|
->query2.query
|
23 ->query3.query
24. Components
It is possible to define a set of queries and templates for
a service (http://mysite.com/myService)
Bash
$ utils/lodspk.sh create service myService
components/
|
->service/
File directory
|
->myService/
|
->html.template
|
->queries/
|
->main.query
|
->query2.query
|
24 ->query3.query