GraphKnowledge

graph-studio

Data Quality Monitoring

This topic provides queries that administrators can run to monitor the quality of the data based on the validity and completeness of the ontologies in the system. You can run the queries from the Query Builder (See Running SPARQL Queries in the Query Builder) or against the SPARQL endpoint (See Access the SPARQL Endpoint).

Each of the queries below target the System Datasource, which is accessible to the sysadmin user or users with the Graph Studio Administrator role.

You can generate a cURL request against the SPARQL endpoint from a query in the Query Builder. Once you have a valid query, click the More button under the query and select Copy CURL Command.

Return properties that are missing a domain or range definition

You can run the following query against the System Datasource (http://openanzo.org/datasource/systemDatasource) to check for properties that do not have a range or domain.

PREFIX rdfs: http://www.w3.org/2000/01/rdf-schema# PREFIX owl: http://www.w3.org/2002/07/owl#

SELECT DISTINCT ?predicate WHERE { GRAPH ?ont { ?ont a owl:Ontology . ?predicate a owl:ObjectProperty . OPTIONAL { ?ont http://openanzo.org/2008/07/Anzo#isSystem ?isSystem . } FILTER(!BOUND(?isSystem) || ?isSystem != "true"). { ?predicate a owl:ObjectProperty . FILTER NOT EXISTS {?predicate rdfs:domain ?domain} } UNION { ?predicate a owl:ObjectProperty . FILTER NOT EXISTS {?predicate rdfs:range ?range} } } }

Return possible cross products

You can run the following query against the System Tables data source (http://cambridgesemantics.com/datasource/SystemTables) to return a list of similar predicates that have the same domain or range.

PREFIX rdfs: http://www.w3.org/2000/01/rdf-schema# PREFIX owl: http://www.w3.org/2002/07/owl#

SELECT DISTINCT ?predicate1 ?predicate2 WHERE { GRAPH ?ont { ?ont a owl:Ontology . ?predicate a owl:ObjectProperty . OPTIONAL { ?ont http://openanzo.org/2008/07/Anzo#isSystem ?isSystem . } FILTER(!BOUND(?isSystem) || ?isSystem != "true") . ?class1 a owl:Class . ?class2 a owl:Class . ?predicate1 a owl:ObjectProperty . ?predicate2 a owl:ObjectProperty . FILTER (?predicate1 != ?predicate2) . ?predicate1 rdfs:domain ?d1; rdfs:range ?r1. ?predicate2 rdfs:domain ?d2; rdfs:range ?r2. FILTER(?r1=?r2) . FILTER(?d1=?d2) . } }

Return classes without class-specific properties

You can run the following query against the System Datasource (http://openanzo.org/datasource/systemDatasource) to check for classes that do not have any properties that belong only to that class. The query finds classes that do not have properties or have only inherited properties.

PREFIX owl: http://www.w3.org/2002/07/owl#

SELECT DISTINCT ?class WHERE { GRAPH ?ont { ?ont a owl:Ontology . ?predicate a owl:ObjectProperty . OPTIONAL { ?ont http://openanzo.org/2008/07/Anzo#isSystem ?isSystem . } FILTER(!BOUND(?isSystem) || ?isSystem != "true"). ?class a owl:Class . FILTER NOT EXISTS { ?predicate rdfs:domain ?class } . } }

Return similar classes

You can run the following query against the System Datasource (http://openanzo.org/datasource/systemDatasource) to check for classes that are similar based on the instances that are assigned to them.

PREFIX rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# PREFIX rdfs: http://www.w3.org/2000/01/rdf-schema# PREFIX owl: http://www.w3.org/2002/07/owl#

SELECT DISTINCT ?class1 ?class2 WHERE {
GRAPH ?ont { ?ont a owl:Ontology . ?predicate a owl:ObjectProperty . OPTIONAL { ?ont http://openanzo.org/2008/07/Anzo#isSystem ?isSystem . } FILTER(!BOUND(?isSystem) || ?isSystem != "true") . ?class1 a owl:Class . ?class2 a owl:Class . ?instance a ?class1, ?class2. FILTER ( ?class1 != ?class2 ) . FILTER NOT EXISTS { ?anything a ?class1 . FILTER NOT EXISTS { ?anything a ?class2 . } } FILTER NOT EXISTS { ?anything a ?class2 . FILTER NOT EXISTS { ?anything a ?class1 . } } } }

Source: https://docs.sw.siemens.com/documentation/external/PL20260212925461721/en-US/graph_studio/monitor-quality-control.htm · retrieved 2026-08-23