@Override protected Representation getRepresentation(SiteManager sm, String id, boolean offlineMode) throws EntityhubException { Entity entity = sm.getEntity(id); return entity == null ? null : entity.getRepresentation(); }
@Override protected Representation getRepresentation(String id) throws EntityhubException { Entity entity = siteManager.getEntity(id); return entity != null ? entity.getRepresentation() : null; } @Override
Entity sign = referencedSiteManager.getEntity(id); if (sign != null) { ResponseBuilder rb = Response.ok(sign);
@Override public final Entity importEntity(String reference) throws IllegalStateException, IllegalArgumentException, YardException { Entity entity = getEntity(reference); if(entity == null){ Entity entityMapping = getMappingBySource(reference); if(entityMapping == null){ Entity remoteEntity = siteManager.getEntity(reference); if(remoteEntity == null){ return null; } else { return importEntity(remoteEntity); } } else { throw new IllegalStateException(String.format( "The reference %s is already imported to the Entityhub " + "(local Entity %s)",reference, EntityMapping.getTargetId(entityMapping))); } } else { throw new IllegalStateException("The parsed id "+reference+" refers " + "to an Entity managed by the Entityhub (entity="+entity+")!"); } } /**
@Override public final Entity importEntity(String reference) throws IllegalStateException, IllegalArgumentException, YardException { Entity entity = getEntity(reference); if(entity == null){ Entity entityMapping = getMappingBySource(reference); if(entityMapping == null){ Entity remoteEntity = siteManager.getEntity(reference); if(remoteEntity == null){ return null; } else { return importEntity(remoteEntity); } } else { throw new IllegalStateException(String.format( "The reference %s is already imported to the Entityhub " + "(local Entity %s)",reference, EntityMapping.getTargetId(entityMapping))); } } else { throw new IllegalStateException("The parsed id "+reference+" refers " + "to an Entity managed by the Entityhub (entity="+entity+")!"); } } /**
/** * Fetch the OWLOntology containing the graph associated to an entity from Linked Data. It uses the Entity * Hub for accessing LOD and fetching entities. * * @param entityURI * {@link String} * @return the {@link OWLOntology} of the entity */ private Graph populateWithEntity(String entityURI, Graph target) { log.debug("Requesting signature of entity {}", entityURI); Graph graph = target != null ? target : new IndexedGraph(); // Query the Entity Hub Entity signature = referencedSiteManager.getEntity(entityURI); if (signature != null) { RdfRepresentation rdfSignature = RdfValueFactory.getInstance().toRdfRepresentation( signature.getRepresentation()); graph.addAll(rdfSignature.getRdfGraph()); } return graph; }
Entity remoteEntity = siteManager.getEntity(entityId); if(remoteEntity == null){ //id not found by any referred site return null;
Entity remoteEntity = siteManager.getEntity(entityId); if(remoteEntity == null){ //id not found by any referred site return null;
entity = referencedSiteManager.getEntity(topic.conceptUri);
entity = referencedSiteManager.getEntity(topic.conceptUri);