Code Duplication    Length = 16-16 lines in 2 locations

model/sparql/GenericSparql.php 2 locations

@@ 534-549 (lines=16) @@
531
     * @param EasyRdf_Sparql_Result $result
532
     * @return array Array with URIs (string) as key and array of (label, superclassURI) as value
533
     */
534
    private function transformQueryTypesResults($result) {
535
        $ret = array();
536
        foreach ($result as $row) {
537
            $type = array();
538
            if (isset($row->label)) {
539
                $type['label'] = $row->label->getValue();
540
            }
541
542
            if (isset($row->superclass)) {
543
                $type['superclass'] = $row->superclass->getUri();
544
            }
545
546
            $ret[$row->type->getURI()] = $type;
547
        }
548
        return $ret;
549
    }
550
551
    /**
552
     * Retrieve information about types from the endpoint
@@ 2055-2070 (lines=16) @@
2052
     * @param EasyRdf_Sparql_Result $result
2053
     * @return array
2054
     */
2055
    private function transformChangeListResults($result) {
2056
        $ret = array();
2057
        foreach ($result as $row) {
2058
            $concept = array('uri' => $row->concept->getURI());
2059
            if (isset($row->label)) {
2060
                $concept['prefLabel'] = $row->label->getValue();
2061
            }
2062
2063
            if (isset($row->date)) {
2064
                $concept['date'] = $row->date->getValue();
2065
            }
2066
2067
            $ret[] = $concept;
2068
        }
2069
        return $ret;
2070
    }
2071
2072
    /**
2073
     * return a list of recently changed or entirely new concepts