/** * Getter for the read only view onto the RDF data of this representation. * * @return The RDF graph of this Representation */ public Graph getRdfGraph(){ return graphNode.getGraph(); }
/** * Getter for the read only view onto the RDF data of this representation. * * @return The RDF graph of this Representation */ public Graph getRdfGraph(){ return graphNode.getGraph(); }
/** * Get a list for the specified resource node. * * @param listNode */ public RdfList(GraphNode listNode) { this((BlankNodeOrIRI)listNode.getNode(), listNode.getGraph()); }
/** * @return a ReadLock if the underlying ImmutableGraph is a LockableGraph it returns its lock, otherwise null */ public Lock readLock() { return getGraph().getLock().readLock(); }
private ExpandedNode(RDFTerm value) { this.value = value; final Graph tc = expandedNode.node.getGraph(); doListInitialization(tc); }
/** * * @return */ public Lock writeLock() { return (getGraph()).getLock().writeLock(); } }
@Override public int hashCode() { return 13 * getNode().hashCode() + getGraph().hashCode(); }
private ExpandedNode(GraphNode node, RDFTerm value) { this.value = value; this.node = node; doListInitialization(node.getGraph()); }
@Override public int hashCode() { return 13 * getNode().hashCode() + getGraph().hashCode(); }
/** * @return a ReadLock if the underlying ImmutableGraph is a LockableGraph it returns its lock, otherwise null */ public Lock readLock() { return getGraph().getLock().readLock(); }
/** * Get a list for the specified resource node. * * @param listNode */ public RdfList(GraphNode listNode) { this((BlankNodeOrIRI)listNode.getNode(), listNode.getGraph()); }
/** * * @return */ public Lock writeLock() { return (getGraph()).getLock().writeLock(); } }
static void respondFromNode(HttpServletResponse response, final GraphNode node) throws IOException, UnsupportedFormatException { //TODO content negotiation final String responseFormat = SupportedFormat.TURTLE; response.setContentType(responseFormat); final ServletOutputStream outputStream = response.getOutputStream(); try { Serializer.getInstance().serialize(outputStream, node.getGraph(), responseFormat); } catch (RuntimeException ex) { final PrintWriter printWriter = new PrintWriter(outputStream); ex.printStackTrace(printWriter); printWriter.flush(); } }
/** * * @param obj * @return true if obj is an instance of the same class represening the same * node in the same graph, subclasses may have different identity criteria. */ @Override public boolean equals(Object obj) { if (obj == null || !(obj.getClass().equals(getClass()))) { return false; } GraphNode other = (GraphNode) obj; return getNode().equals(other.getNode()) && getGraph().equals(other.getGraph()); }
@Override public void render(GraphNode res, GraphNode context, Map<String, Object> sharedRenderingValues, CallbackRenderer callbackRenderer, URI renderingSpecification, String mode, MediaType mediaType, RequestProperties requestProperties, OutputStream os) throws IOException { try { RenderingFunctions renderingFunctions = new WebRenderingFunctions( res.getGraph(), context, callbackRenderer, mode); seedsnipeEngine.process(res, context, renderingFunctions, renderingSpecification.toURL(), os); } catch (MalformedURLException ex) { throw new WebApplicationException(ex); } } }
private List<VirtualProperty> getVirtualPropertyList(GraphNode r, List<VirtualProperty> vPropertyList) { List<Resource> rdfList = getPropertyList(r); for (Resource childPropertyResource : rdfList) { vPropertyList.add(asVirtualProperty(new GraphNode(childPropertyResource, r.getGraph()), vPropertyList)); } return vPropertyList; }
@Override public GraphNode addUserContext(GraphNode node) { node.addProperty(GLOBALMENU.globalMenu, asRdfList(createMenus(), node.getGraph())); return node; }
private Graph getExpandedContext(GraphNode node, GraphNode recipe) { final Graph result = new SimpleGraph(node.getNodeContext()); final Set<RDFTerm> expandedResources = new HashSet<RDFTerm>(); expandedResources.add(node.getNode()); while (true) { Set<RDFTerm> additionalExpansionRes = getAdditionalExpansionResources(result, recipe); additionalExpansionRes.removeAll(expandedResources); if (additionalExpansionRes.size() == 0) { return result; } for (RDFTerm resource : additionalExpansionRes) { final GraphNode additionalNode = new GraphNode(resource, node.getGraph()); result.addAll(additionalNode.getNodeContext()); expandedResources.add(resource); } } }
private void addCustomPropertiesOfRole(GraphNode role, GraphNode result) { Iterator<Literal> titles = role.getLiterals(DC.title); String title = ""; if(titles.hasNext()) { title = titles.next().getLexicalForm(); } NonLiteral customFieldCollection = customPropertyManager.getCustomPropertyCollection(PERMISSION.Role, title); result.getGraph().add(new TripleImpl((NonLiteral) role.getNode(), USERMANAGER.custominformation, customFieldCollection)); } }
private void removeCachedConcepts(GraphNode conceptCacheEntryGraphNode) { Iterator<Resource> searchResults = conceptCacheEntryGraphNode.getObjects(CONCEPTS.searchResult); while (searchResults.hasNext()) { Resource concept = searchResults.next(); GraphNode conceptGraphNode = new GraphNode(concept, conceptCacheEntryGraphNode.getGraph()); conceptGraphNode.deleteProperties(OWL.sameAs); conceptGraphNode.deleteProperties(RDFS.comment); conceptGraphNode.deleteProperties(SKOS.prefLabel); conceptGraphNode.deleteProperties(RDF.type); } conceptCacheEntryGraphNode.deleteProperties(CONCEPTS.searchResult); conceptCacheEntryGraphNode.deleteProperties(DC.date); conceptCacheEntryGraphNode.deleteProperties(CONCEPTS.searchTerm); conceptCacheEntryGraphNode.deleteProperties(RDF.type); }