@Override public ImmutableGraph getImmutableGraph() { return this.triples.getImmutableGraph(); }
@Override public ImmutableGraph getImmutableGraph() { return wrapped.getImmutableGraph(); }
@Override public ImmutableGraph getImmutableGraph() { return wrapped.getImmutableGraph(); }
@Override public ImmutableGraph getImmutableGraph() { return this.triples.getImmutableGraph(); }
/** * Getter for the {@link ImmutableGraph} * @return the {@link ImmutableGraph} * @throws IllegalStateException if this {@link ModelGraph} is * {@link #readWrite} */ public ImmutableGraph getImmutableGraph() { if(readWrite){ throw new IllegalStateException("Unable to return ImmutableGraph for read/write models."); } return graph.getImmutableGraph(); } /**
private ImmutableGraph getNodeContext(BlankNodeOrIRI resource, Graph graph) { final HashSet<BlankNode> dontExpand = new HashSet<BlankNode>(); if (resource instanceof BlankNode) { dontExpand.add((BlankNode) resource); } return getContextOf(resource, dontExpand, graph).getImmutableGraph(); }
private ImmutableGraph getNodeContext(BlankNodeOrIRI resource, Graph graph) { final HashSet<BlankNode> dontExpand = new HashSet<BlankNode>(); if (resource instanceof BlankNode) { dontExpand.add((BlankNode) resource); } return getContextOf(resource, dontExpand, graph).getImmutableGraph(); }
private ImmutableGraph getImmutableGraph(File tcDir) { return getGraph(tcDir).getImmutableGraph(); }
private ImmutableGraph parseResponse(InputStream is) { JenaParserProvider jenaParserProvider = new JenaParserProvider(); //NOTE(rw): the new third parameter is the base URI used to resolve relative paths Graph g = new SimpleGraph(); jenaParserProvider.parse(g,is, SupportedFormat.RDF_XML,null); log.debug("graph: " + g.toString()); return g.getImmutableGraph(); }
@Override public Object getService(Bundle arg0, ServiceRegistration arg1) { Graph tc = new SecuredGraph(tcManager.getImmutableGraph(name), name, tcAccessController); return tc.getImmutableGraph(); }
@SuppressWarnings("unchecked") @Override public <O> O export(Class<O> returnType, boolean merge, org.semanticweb.owlapi.model.IRI universalPrefix) { if (OWLOntology.class.isAssignableFrom(returnType)) { return (O) exportToOWLOntology(merge, universalPrefix); } if (Graph.class.isAssignableFrom(returnType)) { Graph root = exportToGraph(merge, universalPrefix); // A Clerezza graph has to be cast properly. if (returnType == ImmutableGraph.class) root = ((Graph) root).getImmutableGraph(); else if (returnType == Graph.class) {} return (O) root; } throw new UnsupportedOperationException("Cannot export scope " + getID() + " to a " + returnType); }
@Override public Object getService(Bundle arg0, ServiceRegistration arg1) { Graph tc = new SecuredGraph(tcManager.getImmutableGraph(name), name, tcAccessController); return tc.getImmutableGraph(); }
@SuppressWarnings("unchecked") @Override public <O> O getOntology(OWLOntologyID ontologyId, Class<O> returnType, boolean merge, org.semanticweb.owlapi.model.IRI universalPrefix) { if (OWLOntology.class.isAssignableFrom(returnType)) return (O) getOntologyAsOWLOntology(ontologyId, merge, universalPrefix); if (Graph.class.isAssignableFrom(returnType)) { Graph root = getOntologyAsGraph(ontologyId, merge, universalPrefix); // A Clerezza graph has to be cast properly. if (returnType == ImmutableGraph.class) root = ((Graph) root).getImmutableGraph(); else if (returnType == Graph.class) {} // We don't know of other Graph subclasses: just try to cast the Graph. return (O) root; } throw new UnsupportedOperationException("Cannot export ontology collector " + getID() + " to a " + returnType); }
@SuppressWarnings("unchecked") @Override public <O> O export(Class<O> returnType, boolean merge, org.semanticweb.owlapi.model.IRI universalPrefix) { if (OWLOntology.class.isAssignableFrom(returnType)) { return (O) exportToOWLOntology(merge, universalPrefix); } if (Graph.class.isAssignableFrom(returnType)) { Graph root = exportToGraph(merge, universalPrefix); // A Clerezza graph has to be cast properly. if (returnType == ImmutableGraph.class) root = ((Graph) root).getImmutableGraph(); else if (returnType == Graph.class) {} return (O) root; } throw new UnsupportedOperationException("Cannot export ontology collector " + getID() + " to a " + returnType); }
@SuppressWarnings("unchecked") @Override public <O> O export(Class<O> returnType, boolean merge, org.semanticweb.owlapi.model.IRI universalPrefix) { if (OWLOntology.class.isAssignableFrom(returnType)) { return (O) exportToOWLOntology(merge, universalPrefix); } if (Graph.class.isAssignableFrom(returnType)) { Graph root = exportToGraph(merge, universalPrefix); // A Clerezza graph has to be cast properly. if (returnType == ImmutableGraph.class) root = ((Graph) root).getImmutableGraph(); else if (returnType == Graph.class) {} return (O) root; } throw new UnsupportedOperationException("Cannot export ontology collector " + getID() + " to a " + returnType); }
@SuppressWarnings("unchecked") @Override public <O> O getOntology(OWLOntologyID ontologyId, Class<O> returnType, boolean merge, org.semanticweb.owlapi.model.IRI universalPrefix) { if (OWLOntology.class.isAssignableFrom(returnType)) return (O) getOntologyAsOWLOntology(ontologyId, merge, universalPrefix); if (Graph.class.isAssignableFrom(returnType)) { Graph root = getOntologyAsGraph(ontologyId, merge, universalPrefix); // A Clerezza graph has to be cast properly. if (returnType == ImmutableGraph.class) root = ((Graph) root).getImmutableGraph(); else if (returnType == Graph.class) {} // We don't know of other Graph subclasses: just try to cast the Graph. return (O) root; } throw new UnsupportedOperationException("Cannot export ontology collector " + getID() + " to a " + returnType); }
@SuppressWarnings("unchecked") @Override public <O> O export(Class<O> returnType, boolean merge, org.semanticweb.owlapi.model.IRI universalPrefix) { if (OWLOntology.class.isAssignableFrom(returnType)) { return (O) exportToOWLOntology(merge, universalPrefix); } if (Graph.class.isAssignableFrom(returnType)) { Graph root = exportToGraph(merge, universalPrefix); // A Clerezza graph has to be cast properly. if (returnType == ImmutableGraph.class) root = ((Graph) root).getImmutableGraph(); else if (returnType == Graph.class) {} return (O) root; } throw new UnsupportedOperationException("Cannot export scope " + getID() + " to a " + returnType); }
/** * Wraps the supplied <code>graph</code> into a new input source. No origin will be set. * * @param graph * the RDF graph * @throws IllegalArgumentException * if <code>graph</code> is neither a {@link ImmutableGraph} nor a {@link Graph}. */ public GraphSource(Graph graph) { if (graph instanceof ImmutableGraph) bindRootOntology(graph); else if (graph instanceof Graph) bindRootOntology(((Graph) graph).getImmutableGraph()); else throw new IllegalArgumentException("GraphSource supports only ImmutableGraph and Graph types. " + graph.getClass() + " is not supported."); bindPhysicalOrigin(null); }
/** * Wraps the supplied <code>graph</code> into a new input source. No origin will be set. * * @param graph * the RDF graph * @throws IllegalArgumentException * if <code>graph</code> is neither a {@link ImmutableGraph} nor a {@link Graph}. */ public GraphSource(Graph graph) { if (graph instanceof ImmutableGraph) bindRootOntology(graph); else if (graph instanceof Graph) bindRootOntology(((Graph) graph).getImmutableGraph()); else throw new IllegalArgumentException("GraphSource supports only ImmutableGraph and Graph types. " + graph.getClass() + " is not supported."); bindPhysicalOrigin(null); }
/** * Parses a serialized ImmutableGraph from an InputStream. This delegates the * processing to the provider registered for the specified format, if * the formatIdentifier contains a ';'-character only the section before * that character is used for choosing the provider. * * @param serializedGraph an inputstream with the serialization * @param formatIdentifier a string identifying the format (usually the MIME-type) * @param baseUri the uri against which relative uri-refs are evaluated * @return the ImmutableGraph read from the stream * @throws UnsupportedFormatException */ public ImmutableGraph parse(InputStream serializedGraph, String formatIdentifier, IRI baseUri) throws UnsupportedFormatException { Graph graph = new SimpleMGraph(); parse(graph, serializedGraph, formatIdentifier, baseUri); return graph.getImmutableGraph(); }