@prefix rdf: . @prefix rdfs: . @prefix dct: . a ; dct:description "This query returns the items a given user has reviewed."; dct:license ; rdfs:label "Get reviews by reviewer"; ; """prefix schema: prefix rdfs: prefix dct: prefix np: prefix npa: prefix npx: prefix xsd: select distinct ?item ?item_label ?date ?comment ?np (\"^\" as ?np_label) where { { graph npa:graph { ?np npa:hasValidSignatureForPublicKeyHash ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } ?np np:hasAssertion ?a . ?np dct:created ?created . } graph ?a { ?ra a schema:ReviewAction ; schema:agent ?_reviewer_iri ; schema:object ?item . optional { ?item rdfs:label ?item_label } optional { ?ra schema:endTime ?d } optional { ?ra rdfs:comment ?comment } } bind(coalesce(?d, substr(str(?created), 1, 10)) as ?date) } } order by desc(?date)""" .