Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
trivalent
dashboard-trivalent
Commits
ff455f82
Commit
ff455f82
authored
Oct 23, 2018
by
Daniel Suarez Souto
Browse files
Fixed problems with queries Sparql
parent
40289ed7
Pipeline
#888
passed with stages
in 24 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
demo/queries.json
View file @
ff455f82
[{
"name"
:
"Show me news located in Europe"
,
"val"
:
"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
\n
PREFIX schema: <http://schema.org/>
\n
PREFIX marl: <http://www.gsi.dit.upm.es/ontologies/marl/ns#>
\n
PREFIX me: <http://www.mixedemotions-project.eu/ns/model#>
\n
PREFIX onyx: <http://www.gsi.dit.upm.es/ontologies/onyx/ns#>
\n
PREFIX wnaffect: <http://www.gsi.dit.upm.es/ontologies/wnaffect/ns#>
\n
PREFIX dbps: <http://www.openlinksw.com/schemas/dbpedia-spotlight#>
\n
PREFIX dbr: <http://dbpedia.org/resource/>
\n
PREFIX dbo: <http://dbpedia.org/ontology/>
\n
PREFIX dbc: <http://dbpedia.org/category/>
\n
PREFIX db: <http://dbpedia.org/>
\n
PREFIX dcterms: <http://purl.org/dc/terms/>
\n
\n
SELECT DISTINCT ?headline ?
entity ?articl
e
\n
WHERE {
\n
?article a schema:NewsArticle .
\n
?article schema:headline ?headline .
\n
?article me:hasEntities ?
entities .
\n
?entities rdfs:subClassOf ?entity .
\n
?entities rdfs:subClassOf ?country
.
\n
SERVICE <http://dbpedia.org/sparql> {
\n
?country dcterms
:subject dbr:Category:Countries_in_Europe .
\n
}
\n
\n
}
\n
LIMIT 100
\n
"
},{
"name"
:
"Show news about ISIS"
,
"val"
:
"PREFIX schema: <http://schema.org/>
\n
PREFIX marl: <http://www.gsi.dit.upm.es/ontologies/marl/ns#>
\n
PREFIX me: <http://www.mixedemotions-project.eu/ns/model#>
\n
PREFIX onyx: <http://www.gsi.dit.upm.es/ontologies/onyx/ns#>
\n
PREFIX wnaffect: <http://www.gsi.dit.upm.es/ontologies/wnaffect/ns#>
\n
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
\n
PREFIX dbr: <http://dbpedia.org/resource/>
\n\n
SELECT DISTINCT ?headline ?author ?article
\n
WHERE {
\n
?article a schema:NewsArticle .
\n
?article schema:headline ?headline .
\n
?article schema:author ?author .
\n
?article me:hasEntities dbr:ISIL
\n
}
\n
LIMIT 25"
},{
"name"
:
"Which topics are mentioned in the news allocated in Syria"
,
"val"
:
"PREFIX schema: <http://schema.org/>
\n
PREFIX marl: <http://www.gsi.dit.upm.es/ontologies/marl/ns#>
\n
Prefix me: <http://www.mixedemotions-project.eu/ns/model#>
\n
Prefix onyx: <http://www.gsi.dit.upm.es/ontologies/onyx/ns#>
\n
PREFIX wnaffect: <http://gsi.dit.upm.es/ontologies/wnaffect/ns#>
\n
PREFIX sc: <http://purl.org/science/owl/sciencecommons/>
\n
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
\n
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
\n
PREFIX sioc: <http://rdfs.org/sioc/ns#>
\n
PREFIX nif: <http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#>
\n
PREFIX schema: <http://schema.org/>
\n
PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>
\n
PREFIX emoml: <http://www.gsi.dit.upm.es/ontologies/onyx/vocabularies/emotionml/ns#>
\n
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
\n
PREFIX dbpedia: <http://dbpedia.org/resource/>
\n
PREFIX nif: <http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#>
\n
prefix onyx: <http://www.gsi.dit.upm.es/ontologies/onyx/ns#>
\n
prefix dbps: <http://www.openlinksw.com/schemas/dbpedia-spotlight#>
\n
prefix dbo: <http://dbpedia.org/ontology/>
\n
prefix dbr: <http://dbpedia.org/resource/>
\n
prefix me: <http://www.mixedemotions-project.eu/ns/model#>
\n
prefix marl: <http://www.gsi.dit.upm.es/ontologies/marl/ns#>
\n
prefix prov: <http://www.w3.org/ns/prov#>
\n
prefix dc: <http://dublincore.org/2012/06/14/dcelements#>
\n
prefix wna: <http://www.gsi.dit.upm.es/ontologies/wnaffect/ns#>
\n
SELECT ?about ?headline ?article
\n
WHERE {
\n
?article a schema:NewsArticle .
\n
?article schema:headline ?headline .
\n
?article schema:about ?about .
\n
?article me:hasEntities dbr:Syria
\n
}"
},
{
"name"
:
"How many news are allocated in Syria?"
,
"val"
:
"PREFIX schema: <http://schema.org/>
\n
PREFIX marl: <http://www.gsi.dit.upm.es/ontologies/marl/ns#>
\n
Prefix me: <http://www.mixedemotions-project.eu/ns/model#>
\n
Prefix onyx: <http://www.gsi.dit.upm.es/ontologies/onyx/ns#>
\n
PREFIX wnaffect: <http://gsi.dit.upm.es/ontologies/wnaffect/ns#>
\n
PREFIX sc: <http://purl.org/science/owl/sciencecommons/>
\n
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
\n
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
\n
PREFIX sioc: <http://rdfs.org/sioc/ns#>
\n
PREFIX nif: <http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#>
\n
PREFIX schema: <http://schema.org/>
\n
PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>
\n
PREFIX emoml: <http://www.gsi.dit.upm.es/ontologies/onyx/vocabularies/emotionml/ns#>
\n
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
\n
PREFIX dbpedia: <http://dbpedia.org/resource/>
\n
PREFIX nif: <http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#>
\n
prefix onyx: <http://www.gsi.dit.upm.es/ontologies/onyx/ns#>
\n
prefix wna: <http://www.gsi.dit.upm.es/ontologies/wnaffect/ns#>
\n
prefix dbps: <http://www.openlinksw.com/schemas/dbpedia-spotlight#>
\n
prefix dbo: <http://dbpedia.org/ontology/>
\n
prefix dbr: <http://dbpedia.org/resource/>
\n
prefix me: <http://www.mixedemotions-project.eu/ns/model#>
\n
prefix marl: <http://www.gsi.dit.upm.es/ontologies/marl/ns#>
\n
prefix prov: <http://www.w3.org/ns/prov#>
\n
prefix dc: <http://dublincore.org/2012/06/14/dcelements#>
\n
\n
SELECT (COUNT(DISTINCT ?article) AS ?count) WHERE {
\n
?article a schema:NewsArticle .
\n
?article me:hasEntities dbr:Syria .
\n
}"
},
{
"name"
:
"In which articles and tweets are mentioned populated places?"
,
"val"
:
"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
\n
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
\n
PREFIX schema: <http://schema.org/>
\n
PREFIX marl: <http://www.gsi.dit.upm.es/ontologies/marl/ns#>
\n
PREFIX me: <http://www.mixedemotions-project.eu/ns/model#>
\n
PREFIX onyx: <http://www.gsi.dit.upm.es/ontologies/onyx/ns#>
\n
PREFIX wnaffect: <http://www.gsi.dit.upm.es/ontologies/wnaffect/ns#>
\n
PREFIX dbps: <http://www.openlinksw.com/schemas/dbpedia-spotlight#>
\n
PREFIX dbr: <http://dbpedia.org/resource/>
\n
PREFIX dbo: <http://dbpedia.org/ontology/>
\n
PREFIX db: <http://dbpedia.org/>
\n\n
SELECT DISTINCT ?text ?location
\n
WHERE {
\n
{
\n
?tweet a schema:BlogPosting .
\n
?tweet schema:articleBody ?text .
\n
?tweet me:hasEntities ?entity .
\n
}
\n
UNION {
\n
?article a schema:NewsArticle .
\n
?article schema:headline ?text .
\n
?article me:hasEntities ?entity .
\n
}
\n
?entity rdfs:subClassOf ?location .
\n
SERVICE <http://dbpedia.org/sparql> {
\n
?location rdf:type dbo:PopulatedPlace
\n
}
\n
}
\n
LIMIT 100"
}]
[{
"name"
:
"Show me news located in Europe"
,
"val"
:
"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
\n
PREFIX schema: <http://schema.org/>
\n
PREFIX marl: <http://www.gsi.dit.upm.es/ontologies/marl/ns#>
\n
PREFIX me: <http://www.mixedemotions-project.eu/ns/model#>
\n
PREFIX onyx: <http://www.gsi.dit.upm.es/ontologies/onyx/ns#>
\n
PREFIX wnaffect: <http://www.gsi.dit.upm.es/ontologies/wnaffect/ns#>
\n
PREFIX dbps: <http://www.openlinksw.com/schemas/dbpedia-spotlight#>
\n
PREFIX dbr: <http://dbpedia.org/resource/>
\n
PREFIX dbo: <http://dbpedia.org/ontology/>
\n
PREFIX dbc: <http://dbpedia.org/category/>
\n
PREFIX db: <http://dbpedia.org/>
\n
PREFIX dcterms: <http://purl.org/dc/terms/>
\n
\n
SELECT DISTINCT ?headline ?
plac
e
\n
WHERE {
\n
?article a schema:NewsArticle .
\n
?article schema:headline ?headline .
\n
?article me:hasEntities ?
place .
\n
?place a schema:Place
.
\n
SERVICE <http://dbpedia.org/sparql> {
\n
{?place dbo:country ?country .
\n
?country dct
:subject dbr:Category:Countries_in_Europe .
}
\n
UNION
\n
{?place dct:subject dbr:Category:Countries_in_Europe .}
\n
}
\n
LIMIT 100
\n
"
},{
"name"
:
"Show news about ISIS"
,
"val"
:
"PREFIX schema: <http://schema.org/>
\n
PREFIX marl: <http://www.gsi.dit.upm.es/ontologies/marl/ns#>
\n
PREFIX me: <http://www.mixedemotions-project.eu/ns/model#>
\n
PREFIX onyx: <http://www.gsi.dit.upm.es/ontologies/onyx/ns#>
\n
PREFIX wnaffect: <http://www.gsi.dit.upm.es/ontologies/wnaffect/ns#>
\n
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
\n
PREFIX dbr: <http://dbpedia.org/resource/>
\n\n
SELECT DISTINCT ?headline ?author ?article
\n
WHERE {
\n
?article a schema:NewsArticle .
\n
?article schema:headline ?headline .
\n
?article schema:author ?author .
\n
?article me:hasEntities dbr:ISIL
\n
}
\n
LIMIT 25"
},{
"name"
:
"Which topics are mentioned in the news allocated in Syria"
,
"val"
:
"PREFIX schema: <http://schema.org/>
\n
PREFIX marl: <http://www.gsi.dit.upm.es/ontologies/marl/ns#>
\n
Prefix me: <http://www.mixedemotions-project.eu/ns/model#>
\n
Prefix onyx: <http://www.gsi.dit.upm.es/ontologies/onyx/ns#>
\n
PREFIX wnaffect: <http://gsi.dit.upm.es/ontologies/wnaffect/ns#>
\n
PREFIX sc: <http://purl.org/science/owl/sciencecommons/>
\n
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
\n
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
\n
PREFIX sioc: <http://rdfs.org/sioc/ns#>
\n
PREFIX nif: <http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#>
\n
PREFIX schema: <http://schema.org/>
\n
PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>
\n
PREFIX emoml: <http://www.gsi.dit.upm.es/ontologies/onyx/vocabularies/emotionml/ns#>
\n
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
\n
PREFIX dbpedia: <http://dbpedia.org/resource/>
\n
PREFIX nif: <http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#>
\n
prefix onyx: <http://www.gsi.dit.upm.es/ontologies/onyx/ns#>
\n
prefix dbps: <http://www.openlinksw.com/schemas/dbpedia-spotlight#>
\n
prefix dbo: <http://dbpedia.org/ontology/>
\n
prefix dbr: <http://dbpedia.org/resource/>
\n
prefix me: <http://www.mixedemotions-project.eu/ns/model#>
\n
prefix marl: <http://www.gsi.dit.upm.es/ontologies/marl/ns#>
\n
prefix prov: <http://www.w3.org/ns/prov#>
\n
prefix dc: <http://dublincore.org/2012/06/14/dcelements#>
\n
prefix wna: <http://www.gsi.dit.upm.es/ontologies/wnaffect/ns#>
\n
SELECT ?about ?headline ?article
\n
WHERE {
\n
?article a schema:NewsArticle .
\n
?article schema:headline ?headline .
\n
?article schema:about ?about .
\n
?article me:hasEntities dbr:Syria
\n
}"
},
{
"name"
:
"How many news are allocated in Syria?"
,
"val"
:
"PREFIX schema: <http://schema.org/>
\n
PREFIX marl: <http://www.gsi.dit.upm.es/ontologies/marl/ns#>
\n
Prefix me: <http://www.mixedemotions-project.eu/ns/model#>
\n
Prefix onyx: <http://www.gsi.dit.upm.es/ontologies/onyx/ns#>
\n
PREFIX wnaffect: <http://gsi.dit.upm.es/ontologies/wnaffect/ns#>
\n
PREFIX sc: <http://purl.org/science/owl/sciencecommons/>
\n
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
\n
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
\n
PREFIX sioc: <http://rdfs.org/sioc/ns#>
\n
PREFIX nif: <http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#>
\n
PREFIX schema: <http://schema.org/>
\n
PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>
\n
PREFIX emoml: <http://www.gsi.dit.upm.es/ontologies/onyx/vocabularies/emotionml/ns#>
\n
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
\n
PREFIX dbpedia: <http://dbpedia.org/resource/>
\n
PREFIX nif: <http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#>
\n
prefix onyx: <http://www.gsi.dit.upm.es/ontologies/onyx/ns#>
\n
prefix wna: <http://www.gsi.dit.upm.es/ontologies/wnaffect/ns#>
\n
prefix dbps: <http://www.openlinksw.com/schemas/dbpedia-spotlight#>
\n
prefix dbo: <http://dbpedia.org/ontology/>
\n
prefix dbr: <http://dbpedia.org/resource/>
\n
prefix me: <http://www.mixedemotions-project.eu/ns/model#>
\n
prefix marl: <http://www.gsi.dit.upm.es/ontologies/marl/ns#>
\n
prefix prov: <http://www.w3.org/ns/prov#>
\n
prefix dc: <http://dublincore.org/2012/06/14/dcelements#>
\n
\n
SELECT (COUNT(DISTINCT ?article) AS ?count) WHERE {
\n
?article a schema:NewsArticle .
\n
?article me:hasEntities dbr:Syria .
\n
}"
},
{
"name"
:
"In which articles and tweets are mentioned populated places?"
,
"val"
:
"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
\n
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
\n
PREFIX schema: <http://schema.org/>
\n
PREFIX marl: <http://www.gsi.dit.upm.es/ontologies/marl/ns#>
\n
PREFIX me: <http://www.mixedemotions-project.eu/ns/model#>
\n
PREFIX onyx: <http://www.gsi.dit.upm.es/ontologies/onyx/ns#>
\n
PREFIX wnaffect: <http://www.gsi.dit.upm.es/ontologies/wnaffect/ns#>
\n
PREFIX dbps: <http://www.openlinksw.com/schemas/dbpedia-spotlight#>
\n
PREFIX dbr: <http://dbpedia.org/resource/>
\n
PREFIX dbo: <http://dbpedia.org/ontology/>
\n
PREFIX db: <http://dbpedia.org/>
\n\n
SELECT DISTINCT ?text
?entity
\n
WHERE {
\n
{
\n
?tweet a schema:BlogPosting .
\n
?tweet schema:articleBody ?text .
\n
?tweet me:hasEntities ?entity .
\n
}
\n
UNION {
\n
?article a schema:NewsArticle .
\n
?article schema:headline ?text .
\n
?article me:hasEntities ?entity .
\n
}
\n
?entity a schema:Place .
\n
SERVICE <http://dbpedia.org/sparql> {
\n
?entity rdf:type dbo:PopulatedPlace
\n
}
\n
}
\n
SELECT DISTINCT ?text
?location
\n
WHERE {
\n
{
\n
?tweet a schema:BlogPosting .
\n
?tweet schema:articleBody ?text .
\n
?tweet me:hasEntities ?entity .
\n
}
\n
UNION {
\n
?article a schema:NewsArticle .
\n
?article schema:headline ?text .
\n
?article me:hasEntities ?entity .
\n
}
\n
?entity rdfs:subClassOf ?location .
\n
SERVICE <http://dbpedia.org/sparql> {
\n
?location rdf:type dbo:PopulatedPlace
\n
}
\n
}
\n
LIMIT 100"
}]
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment