Ontology
in package
Description of Ontology
Tags
Table of Contents
Properties
- $collections : array<string|int, string>
- restrictions go first as checkRestriction() can affect the whole graph
- $ontology : Dataset
- $schema : Schema
Methods
- __construct() : mixed
- check() : bool
- getVocabularies() : array<string|int, string>
- Returns an array of vocabulary URIs used by the ontology
- import() : void
- importOwlFile() : bool
- loadFile() : void
- loadRepo() : void
- createCollection() : RepoResource
- removeObsoleteChildren() : void
- sanitizeOwlObject() : DatasetNode
- Prepares an RDF resource representing an OWL object (class/dataProperty/objectProperty/restriction) for repository import.
Properties
$collections
restrictions go first as checkRestriction() can affect the whole graph
private
static array<string|int, string>
$collections
= [\zozlak\RdfConstants::OWL_ANNOTATION_PROPERTY, \zozlak\RdfConstants::OWL_RESTRICTION, \zozlak\RdfConstants::OWL_CLASS, \zozlak\RdfConstants::OWL_OBJECT_PROPERTY, \zozlak\RdfConstants::OWL_DATATYPE_PROPERTY]
$ontology
private
Dataset
$ontology
$schema
private
Schema
$schema
Methods
__construct()
public
__construct(Schema $schema) : mixed
Parameters
- $schema : Schema
check()
public
check() : bool
Return values
boolgetVocabularies()
Returns an array of vocabulary URIs used by the ontology
public
getVocabularies() : array<string|int, string>
Return values
array<string|int, string>import()
public
import(Repo $repo[, bool $verbose = false ][, int $concurrency = 3 ]) : void
Parameters
- $repo : Repo
- $verbose : bool = false
- $concurrency : int = 3
importOwlFile()
public
importOwlFile(Repo $repo, string $owlPath, bool $verbose[, DatasetNode|null $collectionMeta = null ][, DatasetNode|null $resourceMeta = null ]) : bool
Parameters
- $repo : Repo
- $owlPath : string
- $verbose : bool
- $collectionMeta : DatasetNode|null = null
- $resourceMeta : DatasetNode|null = null
Tags
Return values
bool —if owl file has been uploaded
loadFile()
public
loadFile(string $filename) : void
Parameters
- $filename : string
loadRepo()
public
loadRepo(Repo $repo) : void
Parameters
- $repo : Repo
createCollection()
private
createCollection(Repo $repo, string $id[, RepoResource|null $topColl = null ]) : RepoResource
Parameters
- $repo : Repo
- $id : string
- $topColl : RepoResource|null = null
Return values
RepoResourceremoveObsoleteChildren()
private
removeObsoleteChildren(Repo $repo, string $collectionId, string $parentProp, array<string|int, string> $imported, bool $verbose[, int $concurrency = 3 ]) : void
Parameters
- $repo : Repo
- $collectionId : string
- $parentProp : string
- $imported : array<string|int, string>
- $verbose : bool
- $concurrency : int = 3
sanitizeOwlObject()
Prepares an RDF resource representing an OWL object (class/dataProperty/objectProperty/restriction) for repository import.
private
sanitizeOwlObject(DatasetNode $res, NamedNodeInterface $id, NamedNodeInterface $parentId, array<string|int, PredicateTemplate> $annotationTmpls, NamedNodeInterface $delProp) : DatasetNode
Parameters
- $res : DatasetNode
-
an owl object metadata to be sanitized
- $id : NamedNodeInterface
-
desired owl object identifier (may differ from $res node)
- $parentId : NamedNodeInterface
-
collection in which a repository resource should be created
- $annotationTmpls : array<string|int, PredicateTemplate>
-
templates for annotation property matching
- $delProp : NamedNodeInterface
Return values
DatasetNode —created/updated repository resource metadata