Exemplo n.º 1
0
 public function __construct(\Vocabulary $vocab)
 {
     $this->itemArray["@context"] = "http://rdaregistry.info/Contexts/concepts_langmap.jsonld";
     $this->vocab = $vocab;
     $this->setReleaseFromGithub();
     $this->vocabArray["@id"] = $vocab->getUri();
     $this->vocabArray["@type"] = "ConceptScheme";
     $this->vocabArray['title'] = [$vocab->getLanguage() => $vocab->getName()];
     $this->vocabArray['description'] = [$vocab->getLanguage() => $vocab->getNote()];
     $this->vocabArray["token"] = $vocab->getToken();
     $this->vocabArray["prefix"] = $vocab->getPrefix();
     $status = \ConceptPeer::getConceptByUri($vocab->getStatus()->getUri());
     $this->vocabArray['status'] = ["@id" => $status->getUri(), "label" => $status->getPrefLabel()];
     $this->vocabArray['omr_api'] = "http://api.metadataregistry.org/vocabularies/" . $vocab->getId();
     $this->vocabArray['omr_home'] = "http://metadataregistry.org/vocabulary/show/id/" . $vocab->getId() . ".html";
     $this->vocabArray['documentation'] = $vocab->getUrl();
     $this->vocabArray['tags'] = ["en" => $this->getTags($this->vocab->getCommunity())];
     $this->vocabArray["count"] = $vocab->countConcepts();
     $this->vocabArray["languages"] = $this->getLanguages($vocab->getLanguages());
     $this->vocabArray["dateOfPublication"] = $this->getDateOfPublication();
     $this->itemArray["@graph"][] = $this->vocabArray;
     $concepts = $this->getConcepts();
     if ($concepts) {
         foreach ($concepts as $concept) {
             $this->itemArray["@graph"][] = $this->getConceptPropertyArray($concept);
         }
     }
 }