Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
sefarad
dashboard-gsicrawler
Commits
d2f3c205
Commit
d2f3c205
authored
Oct 09, 2017
by
Alberto Pascual
Browse files
yasgui sparql queries working
parent
96d10d4e
Pipeline
#396
passed with stages
in 12 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
dashboard-gsicrawler.env.html
View file @
d2f3c205
...
...
@@ -203,6 +203,7 @@
<div>
<yasgui-ui
endpoint=
"http:///${FUSEKI_ENDPOINT_DASHBOARD}/gsicrawler/query"
queries=
"{{queries}}"
</
yasgui-ui
>
</div>
</iron-pages>
...
...
dashboard-gsicrawler.html
View file @
d2f3c205
...
...
@@ -203,6 +203,7 @@
<div>
<yasgui-ui
endpoint=
"http:///sefarad-fuseki.cluster.gsi.dit.upm.es/gsicrawler/query"
queries=
"{{queries}}"
</
yasgui-ui
>
</div>
</iron-pages>
...
...
@@ -334,7 +335,7 @@
// undocumented params are appended to the query string
index
:
"
gsicrawler
"
,
body
:
{
size
:
2
2
,
size
:
2
00
,
query
:
{
multi_match
:{
query
:
this
.
query
,
...
...
@@ -421,7 +422,7 @@
// undocumented params are appended to the query string
index
:
"
gsicrawler
"
,
body
:
{
size
:
2
2
,
size
:
2
00
,
query
:
{
bool
:
{
must
:
this
.
filters
,
...
...
queries.json
View file @
d2f3c205
[{
"name"
:
"Show me news about Terrorism in Spain"
,
"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
PREFIX dbo: <http://dbpedia.org/ontology/>
\n
PREFIX db: <http://dbpedia.org/>
\n\n
SELECT DISTINCT ?headline ?entity
\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 dbr:Spain
\n
\n
}
\n
LIMIT 25"
},{
"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 ?entityURI
\n
WHERE {
\n
?article a schema:NewsArticle .
\n
?article schema:headline ?headline .
\n
?article me:hasEntities ?entity .
\n
?entity rdfs:subClassOf ?entityURI .
\n
?entity rdfs:subClassOf dbr:Islamic_State_of_Iraq_and_the_Levant
\n
\n
}
\n
LIMIT 25"
},{
"name"
:
"Show the sentiment of articles"
,
"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\n
SELECT ?headline ?sentiment
\n
WHERE {
\n
?article a schema:NewsArticle .
\n
?article schema:headline ?headline .
\n
?article marl:hasOpinion ?opinion .
\n
?opinion marl:hasPolarity ?sentiment .
\n
}
\n
LIMIT 25
\n
"
},{
"name"
:
"How many opinions are positive, neutral or neutral on each news?"
,
"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 sioc: <http://rdfs.org/sioc/ns#>
\n
PREFIX nif: <http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#>
\n
SELECT ?article
\n
(COUNT(DISTINCT ?opinionTextPositive) AS ?positives)
\n
(COUNT(DISTINCT ?opinionTextNegative) AS ?negatives)
\n
(COUNT(DISTINCT ?opinionTextNeutral) AS ?neutral)
\n
WHERE {
\n
{
\n
?blogpost a schema:NewsArticle .
\n
?article marl:hasOpinion ?opinion .
\n
?opinion marl:hasPolarity marl:Positive .
\n
?opinion nif:anchorOf ?opinionTextPositive .
\n
}
\n
UNION
\n
{
\n
?article a schema:NewsArticle .
\n
?article marl:hasOpinion ?opinion .
\n
?opinion marl:hasPolarity marl:Negative .
\n
?opinion nif:anchorOf ?opinionTextNegative .
\n\n
}
\n
UNION
\n
{
\n
?article a schema:NewsArticle .
\n
?article marl:hasOpinion ?opinion .
\n
?opinion marl:hasPolarity marl:Neutral .
\n
?opinion nif:anchorOf ?opinionTextNeutral .
\n
}
\n
} GROUP BY ?article"
},
{
"name"
:
"Which topics are mentioned in the news allocated in Syria"
,
"value"
:
""
},
{
"name"
:
"How many news are allocated in Syria?
"
,
"value"
:
""
}]
[{
"name"
:
"Show me news about Terrorism in Spain"
,
"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 db: <http://dbpedia.org/>
\n\n
SELECT DISTINCT ?headline ?entity
\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 dbr:Spain
\n
\n
}
\n
LIMIT 25"
},{
"name"
:
"Show news about ISIS"
,
"val"
:
"PREFIX schema: <http://schema.org/>
\n
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
\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\n
SELECT DISTINCT ?headline ?entityName
\n
WHERE {
\n
?article a schema:NewsArticle .
\n
?article schema:headline ?headline .
\n
?article me:hasEntities ?entity .
\n
?entity rdfs:subClassOf ?entityName .
\n
?entity rdfs:subClassOf dbr:ISIS
\n
\n
}
\n
LIMIT 25"
},{
"name"
:
"Show the sentiment of articles"
,
"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\n
SELECT ?headline ?sentiment
\n
WHERE {
\n
?article a schema:NewsArticle .
\n
?article schema:headline ?headline .
\n
?article marl:hasOpinion ?opinion .
\n
?opinion marl:hasPolarity ?sentiment .
\n
}
\n
LIMIT 25
\n
"
},{
"name"
:
"How many opinions are positive, neutral or neutral on each news?"
,
"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 sioc: <http://rdfs.org/sioc/ns#>
\n
PREFIX nif: <http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#>
\n
SELECT ?headline
\n
(COUNT(DISTINCT ?opinionTextPositive) AS ?positives)
\n
(COUNT(DISTINCT ?opinionTextNegative) AS ?negatives)
\n
(COUNT(DISTINCT ?opinionTextNeutral) AS ?neutral)
\n
WHERE {
\n
{
\n
?article a schema:NewsArticle .
\n
?article schema:headline ?headline .
\n
?article marl:hasOpinion ?opinion .
\n
?opinion marl:hasPolarity marl:Positive .
\n
?opinion nif:anchorOf ?opinionTextPositive .
\n
}
\n
UNION
\n
{
\n
?article a schema:NewsArticle .
\n
?article schema:headline ?headline .
\n
?article marl:hasOpinion ?opinion .
\n
?opinion marl:hasPolarity marl:Negative .
\n
?opinion nif:anchorOf ?opinionTextNegative .
\n\n
}
\n
UNION
\n
{
\n
?article a schema:NewsArticle .
\n
?article schema:headline ?headline .
\n
?article marl:hasOpinion ?opinion .
\n
?opinion marl:hasPolarity marl:Neutral .
\n
?opinion nif:anchorOf ?opinionTextNeutral .
\n
}
\n
} GROUP BY ?headline"
}]
\ No newline at end of file
Write
Preview
Markdown
is supported
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