wikimedia/mediawiki-extensions-Wikibase

View on GitHub
repo/includes/Rdf/Values/GeoShapeRdfBuilder.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace Wikibase\Repo\Rdf\Values;

use DataValues\DataValue;
use Wikibase\Repo\Rdf\RdfVocabulary;

/**
 * @license GPL-2.0-or-later
 */
class GeoShapeRdfBuilder extends ObjectUriRdfBuilder {

    /**
     * @var RdfVocabulary
     */
    private $vocabulary;

    public function __construct( RdfVocabulary $vocabulary ) {
        $this->vocabulary = $vocabulary;
    }

    /**
     * @param DataValue $value
     *
     * @return string the object URI
     */
    protected function getValueUri( DataValue $value ) {
        return $this->vocabulary->getGeoShapeURI( $value->getValue() );
    }

}