Loading [Contrib]/a11y/accessibility-menu.js
Back
Close

An introduction to RDF querying in SPARQL

Zwifi
1,894 views

Alternative

UNION

Conjunction of patterns
PREFIX yaco: <https://www.irit.fr/recherches/MELODI/ontologies/cinema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?person
WHERE {
?person rdf:type yaco:Actor.
?person rdf:type yaco:Director.
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Disjunction of patterns
PREFIX yaco: <https://www.irit.fr/recherches/MELODI/ontologies/cinema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-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.}
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
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
codingame x discord
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