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
@@ 2072-2087 (lines=16) @@
2069
     * @param EasyRdf\Sparql\Result $result
2070
     * @return array
2071
     */
2072
    private function transformChangeListResults($result) {
2073
        $ret = array();
2074
        foreach ($result as $row) {
2075
            $concept = array('uri' => $row->concept->getURI());
2076
            if (isset($row->label)) {
2077
                $concept['prefLabel'] = $row->label->getValue();
2078
            }
2079
2080
            if (isset($row->date)) {
2081
                $concept['date'] = $row->date->getValue();
2082
            }
2083
2084
            $ret[] = $concept;
2085
        }
2086
        return $ret;
2087
    }
2088
2089
    /**
2090
     * return a list of recently changed or entirely new concepts