Commit 613603d0 authored by Thibault Ehrhart's avatar Thibault Ehrhart

Update SPARQL queries based on new data model

- rnews:NewsItem is now rnews:Article
- rnews:description is now rnews:ArticleBody
parent 22c8d55d
...@@ -63,7 +63,7 @@ export class NewsService { ...@@ -63,7 +63,7 @@ export class NewsService {
SELECT DISTINCT ?country SELECT DISTINCT ?country
FROM <http://asrael.eurecom.fr/agencefrancepresse/news> FROM <http://asrael.eurecom.fr/agencefrancepresse/news>
WHERE { WHERE {
?s a rnews:NewsItem . ?s a rnews:Article .
?s schema:contentLocation ?location . ?s schema:contentLocation ?location .
?location schema:address ?address . ?location schema:address ?address .
?address schema:addressCountry ?country . ?address schema:addressCountry ?country .
...@@ -82,7 +82,7 @@ export class NewsService { ...@@ -82,7 +82,7 @@ export class NewsService {
WHERE { WHERE {
{ {
SELECT DISTINCT ?subject WHERE { SELECT DISTINCT ?subject WHERE {
GRAPH <http://asrael.eurecom.fr/agencefrancepresse/news> { ?s a rnews:NewsItem . } GRAPH <http://asrael.eurecom.fr/agencefrancepresse/news> { ?s a rnews:Article . }
?s dc:subject ?subject . ?s dc:subject ?subject .
} }
} }
...@@ -105,7 +105,7 @@ export class NewsService { ...@@ -105,7 +105,7 @@ export class NewsService {
${this.getPrefixes()} ${this.getPrefixes()}
SELECT DISTINCT ?lang SELECT DISTINCT ?lang
WHERE { WHERE {
GRAPH <http://asrael.eurecom.fr/agencefrancepresse/news> { ?s a rnews:NewsItem . } GRAPH <http://asrael.eurecom.fr/agencefrancepresse/news> { ?s a rnews:Article . }
?s rnews:inLanguage ?lang . ?s rnews:inLanguage ?lang .
} }
GROUP BY ?lang GROUP BY ?lang
...@@ -134,13 +134,13 @@ export class NewsService { ...@@ -134,13 +134,13 @@ export class NewsService {
SELECT DISTINCT ?s ?dateCreated ?dateModified ?datePublished ?description ?genre ?genreLabel (GROUP_CONCAT(?subject; separator="|") AS ?subjects) (GROUP_CONCAT(?subjectLabel; separator="|") AS ?subjectsLabels) ?dateline ?headline ?identifier ?language ?slug (GROUP_CONCAT(?associatedMedia; separator="|") AS ?associatedMedias) ?country ?locality ?context SELECT DISTINCT ?s ?dateCreated ?dateModified ?datePublished ?description ?genre ?genreLabel (GROUP_CONCAT(?subject; separator="|") AS ?subjects) (GROUP_CONCAT(?subjectLabel; separator="|") AS ?subjectsLabels) ?dateline ?headline ?identifier ?language ?slug (GROUP_CONCAT(?associatedMedia; separator="|") AS ?associatedMedias) ?country ?locality ?context
FROM <http://asrael.eurecom.fr/agencefrancepresse/news> FROM <http://asrael.eurecom.fr/agencefrancepresse/news>
WHERE { WHERE {
?s a rnews:NewsItem . ?s a rnews:Article .
VALUES ?s { <${uri}> } VALUES ?s { <${uri}> }
OPTIONAL { ?s rnews:dateCreated ?dateCreated . } OPTIONAL { ?s rnews:dateCreated ?dateCreated . }
OPTIONAL { ?s rnews:dateModified ?dateModified . } OPTIONAL { ?s rnews:dateModified ?dateModified . }
OPTIONAL { ?s rnews:datePublished ?datePublished . } OPTIONAL { ?s rnews:datePublished ?datePublished . }
OPTIONAL { OPTIONAL {
?s rnews:description ?description . ?s rnews:articleBody ?description .
} }
OPTIONAL { OPTIONAL {
?s rnews:genre ?genre . ?s rnews:genre ?genre .
...@@ -289,9 +289,9 @@ export class NewsService { ...@@ -289,9 +289,9 @@ export class NewsService {
SELECT DISTINCT * SELECT DISTINCT *
FROM <http://asrael.eurecom.fr/agencefrancepresse/news> FROM <http://asrael.eurecom.fr/agencefrancepresse/news>
WHERE { WHERE {
?s a rnews:NewsItem . ?s a rnews:Article .
OPTIONAL { ?s rnews:dateCreated ?dateCreated . } OPTIONAL { ?s rnews:dateCreated ?dateCreated . }
OPTIONAL { ?s rnews:description ?description . } OPTIONAL { ?s rnews:articleBody ?description . }
OPTIONAL { ?s rnews:headline ?headline . } OPTIONAL { ?s rnews:headline ?headline . }
OPTIONAL { ?s asrael:context ?context . } OPTIONAL { ?s asrael:context ?context . }
OPTIONAL { ?s schema:contentLocation/schema:address/schema:addressCountry ?country . } OPTIONAL { ?s schema:contentLocation/schema:address/schema:addressCountry ?country . }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment