Difference between revisions of "ORG Validation Suite"

From Government Linked Data (GLD) Working Group Wiki
Jump to: navigation, search
(Query set)
Line 136: Line 136:
 
     $org org:hasSite ?result .
 
     $org org:hasSite ?result .
 
     OPTIONAL {
 
     OPTIONAL {
       ?result org:hasPrimarySite $org .
+
       $org org:hasPrimarySite ?result .
 
       BIND (true AS ?isPrimarySite)
 
       BIND (true AS ?isPrimarySite)
 
     }
 
     }
 
     OPTIONAL {
 
     OPTIONAL {
       ?result org:hasRegisteredSite $org .
+
       $org org:hasRegisteredSite ?result .
 
       BIND (true AS ?isRegisteredSite)
 
       BIND (true AS ?isRegisteredSite)
 
     }
 
     }

Revision as of 13:58, 2 May 2013

This page describes a verification suite to assist implementers of ORG in checking that they are using the vocabulary appropriately. It is provided to support gathering implementation evidence as part of the W3C REC track process.

Verification approach

ORG provides a collection of terms intended to be useful for describing various aspects of organizations and organizational structure. Validating usage of such a vocabulary is difficult and cannot be completely automated.

  • There are few formal semantic constraints on the use vocabulary terms. The intended usage of terms is largely carried in the prose descriptions of them.
  • Implementers are free to use a subset of terms and to use additional terms (for cases where the coverage of ORG is insufficient).
  • There are no constraints on what it means to consume ORG data. The information may simply be published in machine readable form (e.g. as part of a government transparency initiative), may be used to drive visualizations of organizational structure or may be used in a more operational setting.

Our approach is to provide the specification for a minimal ORG consumer that extracts and describes different ORG resources from a data source. For example, given an organization then one affordance is to locate all sub organzations or organizational units. An implementation checker (a human) can thus walk through a sample ORG data source using the minimal consumer and confirm that the resources found match those expected from the source data. Verifying that the returned results are correct requires human interpretation.

We formalize this minimal ORG consumer as a set of SPARQL queries. To simplify testing the Working Group intends to offer an on line service which provides a simple HTML rendering of an ORG data source based on these queries.

Query set

Many of the verification queries are intended to extract part of the description of an organization. In the queries specified here the string $org should be replaced by <uri> where uri is the URI of the org:Organization instance being examined.

All SPARQL queries and update specifications below assume the following prefix declarations:

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#>
PREFIX skos:       <http://www.w3.org/2004/02/skos/core#>
PREFIX dct:        <http://purl.org/dc/terms/>
PREFIX vcard:      <http://www.w3.org/2006/vcard/ns#>
PREFIX org:        <http://www.w3.org/ns/org#>

Inference closure

Before applying any verification queries an inference closure should be formed as follows:

  • Create an RDF graph comprising the union of:
    • the data sample to be checked
    • the ORG ontology
    • any additional ontologies used in the implementation which declare mapping relationships between ORG and implementation-specific terms
  • Form an inference closure by applying the following SPARQL UPDATE on the graph:
INSERT {
    ?i a ?c .
} WHERE {
    ?sc rdfs:subClassOf+ ?c .
    ?i a ?sc .
};

INSERT {
    ?x ?p ?y .
} WHERE {
    ?sp rdfs:subPropertyOf+ ?p .
    ?x ?sp ?y .
};

INSERT {
   ?x ?p ?y .
} WHERE {
   ?ip owl:inverseOf ?p .
   ?y ?ip ?x.
};

INSERT {
    ?agent   org:memberOf  ?org.
} WHERE {
  [] a org:Membership;
    org:member       ?agent;
    org:organization ?org.
};

INSERT {
    ?agent   ?roleprop  ?org.
} WHERE {
  [] a org:Membership;
    org:member       ?agent;
    org:organization ?org;
    org:role         [ org:roleProperty ?roleprop ].
};

INSERT {
  ?agent  org:memberOf ?org.
} WHERE {
  ?agent org:holds  ?post.
  ?post  org:postIn ?org.
};

INSERT {
  [] a org:Membership;
    org:member       ?agent;
    org:organization ?org;
    org:role         ?role.
} WHERE {
  ?agent org:holds  ?post.
  ?post  org:postIn ?org.
  ?post  org:role   ?role.
}

Any alternative inference closure process which computes (a super set of) those found by this SPARQL UPDATE may be used.

Core

List all organizations mentioned in the data.

SELECT * WHERE {
    ?result a org:Organization .
    OPTIONAL {?result skos:prefLabel ?prefLabel}
    OPTIONAL {?result rdfs:label ?label}
    OPTIONAL {?result dct:description ?description}
    OPTIONAL {?result org:identifier ?identifier}
    OPTIONAL {?result org:classification ?classification}
}

Structure

List all sub-organizations of a given organization.

SELECT * WHERE {
    ?result org:subOrganizationOf $org .
    OPTIONAL {
       ?result org:unitOf $org .
       BIND (true AS ?isUnitOf)
    }
}

Sites

List all sites of a given organization.

SELECT * WHERE {
    $org org:hasSite ?result .
    OPTIONAL {
       $org org:hasPrimarySite ?result .
       BIND (true AS ?isPrimarySite)
    }
    OPTIONAL {
       $org org:hasRegisteredSite ?result .
       BIND (true AS ?isRegisteredSite)
    }
    OPTIONAL {
        ?result org:siteAddress ?address .
        OPTIONAL { ?address vcard:fn  ?sitename }
        OPTIONAL { ?address vcard:tel / rdf:value ?telephone }
        OPTIONAL { ?address vcard:adr / vcard:street-address ?street }
        OPTIONAL { ?address vcard:adr / vcard:locality ?locality }
    }
}

Membership

Posts

Organization change

Collaboration