Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
schaertl_andreas
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
supervision
schaertl_andreas
Commits
9634c906
Commit
9634c906
authored
4 years ago
by
Andreas Schärtl
Browse files
Options
Downloads
Patches
Plain Diff
doc: explain RDF4J endpoint
parent
e1622f27
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/endpoints.md
+35
-4
35 additions, 4 deletions
doc/endpoints.md
with
35 additions
and
4 deletions
doc/endpoints.md
+
35
−
4
View file @
9634c906
...
...
@@ -19,18 +19,45 @@ programming language or environment.
SPARQL is inspired by SQL, a simple query that returns all triplets
in the store looks like
SELECT *
WHERE { ?s ?p ?o }
SELECT *
WHERE { ?s ?p ?o }
where
`s`
,
`p`
and
`o`
are query variables. The result of a query are
valid substitutions for the query variables. In this case, the
database would return a table of all triplets in the store sorted by
subject
`s`
, predicate
`p`
and object
`o`
.
Of course, queries might return a lot of data. Importing just the
Isabelle exports [3] into GraphDB results in >200M triplets. This
Of course, queries might return a lot of data. Importing just the Isabelle exports [3] into GraphDB results in >200M triplets. This
is solved with pagination techniques [4].
RDF4J
-----
RDF4J [5] is a Java API for interacting with triplet stores, implemented
based on a superset of SPARQL. GraphDB supports RDF4J, in fact it is the
recommended way of interacting with GraphDB repositories [6].
Instead of formulating textual queries, RDF4J allows developers to query
a repository by calling Java API methods. Above query that returns all triplets
in the store looks like
connection.getStatements(null, null, null);
in RDF4J. Method
`getStatements(s, p, o)`
returns all triplets that
have matching subject
`s`
, predicate
`p`
and object
`o`
. If any of
these arguments is
`null`
, it can be any value, i.e. it is a query
variable that is to be filled by the call to
`getStatements`
.
Comparing SPARQL to RDF4J
-------------------------
While plain SPARQL offers independence from the JVM, RDF4J is a
convenient interface that makes it easy to write applications with
problems like pagination already taken care of.
Of course the interesting question for the task of building an ULO/RDF
endpoint is what works better for this particular application.
References
----------
...
...
@@ -41,3 +68,7 @@ References
[3] https://gl.mathhub.info/Isabelle
[4] https://stackoverflow.com/questions/27488403/paginating-sparql-results
[5] https://rdf4j.org/
[6] http://graphdb.ontotext.com/documentation/free/using-graphdb-with-the-rdf4j-api.html
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment