Skip to content

Commit

Permalink
Give user nodes query template same treatment as sample nodes (#163 #501
Browse files Browse the repository at this point in the history
)
  • Loading branch information
jgonggrijp committed Nov 10, 2021
1 parent 14760c4 commit d799857
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 24 deletions.
2 changes: 0 additions & 2 deletions frontend/src/global/hbsPartials.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import Handlebars from 'handlebars/dist/handlebars.runtime';

import sparqlPreamble from '../sparql/query-templates/preamble-template';
import restrictToItems from '../sparql/query-templates/restrict-to-items-template';

Handlebars.registerPartial('sparqlPreamble', sparqlPreamble);
Handlebars.registerPartial('restrictToItems', restrictToItems);
25 changes: 15 additions & 10 deletions frontend/src/sparql/query-templates/nodes-by-user-template.hbs
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX oa: <http://www.w3.org/ns/oa#>
CONSTRUCT {?node ?p ?o}
WHERE {
?node ?p ?o.
?node dcterms:creator <{{userURI}}>.
{{#if itemQuery}}
{{>restrictToItems}}
{{/if}}
{{>sparqlPreamble}}

construct {
?subject ?prop ?val
} where {
?subject ?prop ?val;
dcterms:creator <{{userURI}}>.
{{#itemQuery}}
?anno oa:hasBody ?subject.
?subject a ?x.
{{/itemQuery}}
{{^itemQuery}}
?subject a vocab:Source.
{{/itemQuery}}
}
ORDER BY desc(?node)
ORDER BY desc(?subject)
12 changes: 0 additions & 12 deletions frontend/src/sparql/query-templates/restrict-to-items-template.hbs

This file was deleted.

0 comments on commit d799857

Please sign in to comment.