コード例 #1
0
 /**
  * Adds meta-information about an entity (such as the ID and type) to the RDF graph.
  *
  * @todo: extract into MetaDataRdfBuilder
  *
  * @param EntityDocument $entity
  */
 private function addEntityMetaData(EntityDocument $entity)
 {
     $entityLName = $this->vocabulary->getEntityLName($entity->getId());
     $this->writer->about(RdfVocabulary::NS_ENTITY, $entityLName)->a(RdfVocabulary::NS_ONTOLOGY, $this->vocabulary->getEntityTypeName($entity->getType()));
     if ($entity instanceof Property) {
         $this->writer->say(RdfVocabulary::NS_ONTOLOGY, 'propertyType')->is(RdfVocabulary::NS_ONTOLOGY, $this->vocabulary->getDataTypeName($entity));
         $id = $entity->getId()->getSerialization();
         $this->writePropertyPredicates($id, $this->propertyIsLink($entity));
         $this->writeNovalueClass($id);
     }
 }