Code Duplication    Length = 16-16 lines in 2 locations

model/sparql/GenericSparql.php 2 locations

@@ 507-522 (lines=16) @@
504
     * @param EasyRdf_Sparql_Result $result
505
     * @return array Array with URIs (string) as key and array of (label, superclassURI) as value
506
     */
507
    private function transformQueryTypesResults($result) {
508
        $ret = array();
509
        foreach ($result as $row) {
510
            $type = array();
511
            if (isset($row->label)) {
512
                $type['label'] = $row->label->getValue();
513
            }
514
515
            if (isset($row->superclass)) {
516
                $type['superclass'] = $row->superclass->getUri();
517
            }
518
519
            $ret[$row->type->getURI()] = $type;
520
        }
521
        return $ret;
522
    }
523
524
    /**
525
     * Retrieve information about types from the endpoint
@@ 1967-1982 (lines=16) @@
1964
     * @param EasyRdf_Sparql_Result $result
1965
     * @return array
1966
     */
1967
    private function transformChangeListResults($result) {
1968
        $ret = array();
1969
        foreach ($result as $row) {
1970
            $concept = array('uri' => $row->concept->getURI());
1971
            if (isset($row->label)) {
1972
                $concept['prefLabel'] = $row->label->getValue();
1973
            }
1974
1975
            if (isset($row->date)) {
1976
                $concept['date'] = $row->date->getValue();
1977
            }
1978
1979
            $ret[] = $concept;
1980
        }
1981
        return $ret;
1982
    }
1983
1984
    /**
1985
     * return a list of recently changed or entirely new concepts