src/acdhOeaw/util/metadataValidator/MetadataValidator.php
static private function loadClasses(Fedora $fedora) {
        $ontologyLoc = RC::get('fedoraApiUrl') . '/' . RC::get('doorkeeperOntologyLocation') . '/';

        $query = new SimpleQuery("
            select ?fRes ?id ?parent
            where {
                ?fRes a <http://www.w3.org/2002/07/owl#Class> .
                ?fRes ?@ ?id .
                optional { ?fRes <http://www.w3.org/2000/01/rdf-schema#subClassOf> / (^?@ / <http://www.w3.org/2000/01/rdf-schema#subClassOf>)* ?parent . }
                filter regex(str(?fRes), ?#)
            }
        ");
        $query->setValues(array(RC::idProp(), RC::idProp(), $ontologyLoc));
        $res   = $fedora->runQuery($query);

        self::$classes = array();
        foreach ($res as $i) {
            $id = $i->id->getUri();
            if (!isset(self::$classes[$id])) {
                self::$classes[$id] = array($id);
            }
            if (isset($i->parent) && $i->parent) {
                self::$classes[$id][] = $i->parent->getUri();
            }
        }
    }
static private function loadClasses(Fedora $fedora) {
        $ontologyLoc = RC::get('fedoraApiUrl') . '/' . RC::get('doorkeeperOntologyLocation') . '/';

        $query = new SimpleQuery("
            select ?fRes ?id ?parent
            where {
                ?fRes a <http://www.w3.org/2002/07/owl#Class> .
                ?fRes ?@ ?id .
                optional { ?fRes <http://www.w3.org/2000/01/rdf-schema#subClassOf> / (^?@ / <http://www.w3.org/2000/01/rdf-schema#subClassOf>)* ?parent . }
                filter regex(str(?fRes), ?#)
            }
        ");
        $query->setValues(array(RC::idProp(), RC::idProp(), $ontologyLoc));
        $res   = $fedora->runQuery($query);

        self::$classes = array();
        foreach ($res as $i) {
            $id = $i->id->getUri();
            if (!isset(self::$classes[$id])) {
                self::$classes[$id] = array($id);
            }
            if (isset($i->parent) && $i->parent) {
                self::$classes[$id][] = $i->parent->getUri();
            }
        }
    }
static private function loadClasses ( Fedora $ fedora ) { $ ontologyLoc = RC :: get ( 'fedoraApiUrl' ) . '/' . RC :: get ( 'doorkeeperOntologyLocation' ) . '/' ; $ query = new SimpleQuery ( "
            select ?fRes ?id ?parent
            where {
                ?fRes a <http://www.w3.org/2002/07/owl#Class> .
                ?fRes ?@ ?id .
                optional { ?fRes <http://www.w3.org/2000/01/rdf-schema#subClassOf> / (^?@ / <http://www.w3.org/2000/01/rdf-schema#subClassOf>)* ?parent . }
                filter regex(str(?fRes), ?#)
            }
        " ) ; $ query -> setValues ( array ( RC :: idProp ( ) , RC :: idProp ( ) , $ ontologyLoc ) ) ; $ res = $ fedora -> runQuery ( $ query ) ; self :: $ classes = array ( ) ; foreach ( $ res as $ i ) { $ id = $ i -> id -> getUri ( ) ; if ( ! isset ( self :: $ classes [ $ id ] ) ) { self :: $ classes [ $ id ] = array ( $ id ) ; } if ( isset ( $ i -> parent ) && $ i -> parent ) { self :: $ classes [ $ id ] [ ] = $ i -> parent -> getUri ( ) ; } } }
Loads classes defined in the ontology.
@param Fedora $fedora repository connection object
Loads classes defined in the ontology .