1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- //© 2019 Dublin City University, Trinity College Dublin. All rights reserved. This material may not be reproduced, displayed, modified or distributed without the express prior written permission of the copyright holder.
- const prefix = `
- PREFIX qpro: <http://purl.org/eis/vocab/qpro#>
- PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
- PREFIX dqm-prob: <http://www.diachron-fp7.eu/dqm-prob#>
- `;
- export const MisplacedClassesOrPropertiesMetric = (qualityGraph,dataGraph,observationURI,datasetSource) =>{
- let query = `
- SELECT ?ProblematicThing (?ProblematicThingResource AS ?Subject) ?Predicate ?Object ?FailedMertic ?Exception
- FROM NAMED <${qualityGraph}>
- FROM NAMED <${dataGraph}>
- WHERE
- {
- {GRAPH <${qualityGraph}>
- {?QualityProblem qpro:generatedBy ?Observation;
- a qpro:QualityProblem;
- qpro:isDescribedBy ?FailedMertic;
- qpro:problemStructure qpro:ModelContainer;
- qpro:problematicThing ?ProblematicThingResource}.
- }
- {{GRAPH <${qualityGraph}>
- {?ProblematicThingResource qpro:exceptionDescription ?Exception;
- ?Property ?Predicate}.
- FILTER(?Exception IN (dqm-prob:MisplacedClass)).
- FILTER(?Property IN (dqm-prob:hasMisplacedClass)).}
- UNION
- {GRAPH <${qualityGraph}>
- {?ProblematicThingResource qpro:exceptionDescription ?Exception;
- ?Property ?Object}.
- FILTER(?Exception IN (dqm-prob:MisplacedProperty)).
- FILTER(?Property IN (dqm-prob:hasMisplacedProperty)).}
- }
-
- {${datasetSource} <${dataGraph}>
- {?ProblematicThingResource ?Predicate ?Object
- }.
- }
- BIND(COALESCE(
- IF(?Exception = dqm-prob:MisplacedClass, "Predicate",IF(?Exception = dqm-prob:MisplacedProperty, "Object",""))
- ) AS ?ProblematicThing).
- FILTER(str(?Observation) = "${observationURI}").
- }
- `;
- return prefix + query;
- }
- export default {MisplacedClassesOrPropertiesMetric};
|