acdh-oeaw/arche-lib-schema

An API providing commonly used views on the ARCHE ontology

5.0.3 2021-05-19 17:35 UTC

This package is auto-updated.

Last update: 2021-05-19 17:36:03 UTC


README

Latest Stable Version Build status Coverage Status License

An API for the ACDH ontology stored in an ARCHE repository.

Installation

composer require acdh-oeaw/arche-lib-schema

Documentation

https://acdh-oeaw.github.io/arche-docs/arche-lib-schema/

Usage

$conn = new PDO('pgsql: repo db connection details');
$cfg = (object) [
    'ontologyNamespace' => 'https://vocabs.acdh.oeaw.ac.at/schema#',
    'parent'            => 'https://vocabs.acdh.oeaw.ac.at/schema#isPartOf',
    'label'             => 'https://vocabs.acdh.oeaw.ac.at/schema#hasTitle',
];

$ontology = new \acdhOeaw\arche\lib\schema\Ontology($conn, $cfg);

$class = $ontology->getClass('https://vocabs.acdh.oeaw.ac.at/schema#Person');
print_r($class);

$property = $ontology->getProperty('https://vocabs.acdh.oeaw.ac.at/schema#RepoObject', 'https://vocabs.acdh.oeaw.ac.at/schema#hasContact');
print_r($property);

$property = $ontology->getProperty(null, 'https://vocabs.acdh.oeaw.ac.at/schema#hasContact');
print_r($property);

$property = $ontology->getProperty(null, 'https://vocabs.acdh.oeaw.ac.at/schema#hasLicense');
print_r($property->vocabsValues);
echo $property->vocabsValues['https://vocabs.acdh.oeaw.ac.at/archelicenses/cc-by-4-0']->getLabel('de');