Skip to content

Commit

Permalink
BARTOC: Fix non-KOS mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
nichtich committed Oct 24, 2016
1 parent c019340 commit bbf33c6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/lib/BARTOCService.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function query($query) {

public function entityLookup($uri) {
$rdf = RDFMapping::loadRDF($uri);
if (!$rdf) return;
if (!$rdf || empty($rdf->getGraph()->propertyUris($uri))) return;

// FIXME: There is a bug in Drupal RDFa output. This is a dirty hack to repair.
foreach ( ['dct:subject', 'dct:type', 'dct:language', 'dct:format', 'schema:license']
Expand All @@ -77,13 +77,12 @@ public function entityLookup($uri) {
$jskos = new ConceptScheme(['uri' => $uri]);

$this->applyRDFMapping($rdf, $jskos);
# error_log($rdf->getGraph()->dump('text'));
error_log($rdf->getGraph()->dump('text'));

# TODO: Extend registry-specific fields
if ( empty(RDFMapping::getURIs($rdf, 'dct:subject')) ) {
$jskos = new Registry($jskos);
}
# error_log($jskos->json());

# map licenses
foreach ( RDFMapping::getURIs($rdf, 'schema:license') as $license ) {
Expand Down

0 comments on commit bbf33c6

Please sign in to comment.