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
@@ 2134-2149 (lines=16) @@
2131
     * @param EasyRdf\Sparql\Result $result
2132
     * @return array
2133
     */
2134
    private function transformChangeListResults($result) {
2135
        $ret = array();
2136
        foreach ($result as $row) {
2137
            $concept = array('uri' => $row->concept->getURI());
2138
            if (isset($row->label)) {
2139
                $concept['prefLabel'] = $row->label->getValue();
2140
            }
2141
2142
            if (isset($row->date)) {
2143
                $concept['date'] = $row->date->getValue();
2144
            }
2145
2146
            $ret[] = $concept;
2147
        }
2148
        return $ret;
2149
    }
2150
2151
    /**
2152
     * return a list of recently changed or entirely new concepts