Employers: discover CodinGame for tech hiring
Practice
Compete
1
Contribute
Learn
Log In
Sign Up
An introduction to RDF querying in SPARQL
Zwifi
9,701 views
01
Welcome
02
Initial queries
03
Filters
04
Optionality
05
Negation
06
Alternatives
07
Projection
08
Grouping
09
Modifiers
6/9
Alternatives
Previous:
Negation
Next:
Projection
Alternative
UNION
Conjunction of patterns
union_off.sparql
matrix.ttl
1
2
3
4
5
6
7
8
9
10
PREFIX yaco: <https://www.irit.fr/recherches/MELOD
I/ontologies/cinema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-synt
ax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema
#>
SELECT ?person
WHERE {
?person rdf:type yaco:Actor.
?person rdf:type yaco:Director.
}
1
@prefix yaco: <https://www.irit.fr/recherches/MELO
DI/ontologies/cinema#> .
Run
Disjunction of patterns
union_on.sparql
matrix.ttl
1
2
3
4
5
6
7
8
9
10
11
PREFIX yaco: <https://www.irit.fr/recherches/MELOD
I/ontologies/cinema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-synt
ax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema
#>
SELECT ?person
WHERE {
{?person rdf:type yaco:Actor.}
UNION
{?person rdf:type yaco:Director.}
}
1
@prefix yaco: <https://www.irit.fr/recherches/MELO
DI/ontologies/cinema#> .
Run
4
0
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io
Suggested playgrounds
Common patterns with Solid
By
Zwifi
2,843
2
Learning algorithmics with Ada
By
Zwifi
11.6K
2
Correct the code to display 'Hello World!'
By
SJTECollege
1,915
95
Python Hello World program
By
SJTECollege
1,277
77
CodinGame - Home
ABOUT US
CAREERS
PRIVACY
FAQ
CodinGame - Work
The #1 tech hiring platform
SCREENING
SOURCING
RETAIN
ABOUT US
CAREERS
PRIVACY
FAQ
Facebook
YouTube
Twitter
LinkedIn
FR
EN
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants
Keyboard Shortcuts:
?
Show / hide this help menu
×