/** * Return the raw RDF model being processed (i.e. the argument * to the Reasonder.bind call that created this InfModel). */ @Override public Model getRawModel() { return new ModelCom(getInfGraph().getRawGraph()); }
public NodeFormatter(Model model) { if(model == null) throw new NullPointerException("No model given!"); //renderer = new ATermAbstractSyntaxRenderer(); renderer = new ATermManchesterSyntaxRenderer(); sw = new StringWriter(); formatter = new PrintWriter(sw); renderer.setWriter(formatter); qnames = JenaUtils.makeQNameProvider(model); // formatter.setQNames(qnames); if(model instanceof InfModel) { InfGraph graph = (InfGraph) model.getGraph(); rawModel = ModelFactory.createModelForGraph( graph.getRawGraph() ); } else rawModel = model; }
private void collectLeafGraphs(Graph graph, Set<Graph> prevLeaves) { if( graph instanceof Polyadic ) { Polyadic union = ((Polyadic) graph); if( union.getBaseGraph() != null ) collectLeafGraphs( union.getBaseGraph(), prevLeaves ); for( Iterator<Graph> i = union.getSubGraphs().iterator(); i.hasNext(); ) collectLeafGraphs( i.next(), prevLeaves ); } else if( graph instanceof Dyadic ) { Dyadic dyadic = ((Dyadic) graph); if( dyadic.getL() instanceof Graph ) collectLeafGraphs( (Graph) dyadic.getL(), prevLeaves ); if( dyadic.getR() instanceof Graph ) collectLeafGraphs( (Graph) dyadic.getR(), prevLeaves ); } else if( graph instanceof InfGraph ) { collectLeafGraphs( ((InfGraph) graph).getRawGraph(), prevLeaves ); } else if( leafGraphs.add( graph ) && !prevLeaves.contains( graph ) ) { changedGraphs.add( graph ); graph.getEventManager().register( this ); } }
private static void syncGraph(Graph graph) { // "Temporary" hack. Graph ought to implement sync and casade it down. if ( graph instanceof InfGraph ) syncGraph(((InfGraph)graph).getRawGraph()) ; else if ( graph instanceof Polyadic ) // MultiUnion // Only the base graph is updatable. syncGraph(((Polyadic)graph).getBaseGraph()) ; else if ( graph instanceof GraphWrapper ) syncGraph(((GraphWrapper)graph).get()) ; // else if ( graph instanceof WrappedGraph ) // // Does not expose the WrappedGraph : checking, no subclass needs a sync(). // syncGraph(((WrappedGraph)graph).get()) ; else syncObject(graph) ; }
(MultiUnion) ((InfGraph) getGraph()).getRawGraph();
boolean ok = false; InfGraph inf = context.getGraph(); Graph raw = inf.getRawGraph(); Graph deductions = inf.getDeductionsGraph(); for (int i = 0; i < length; i++) {
Graph rawPreload = ((InfGraph)schemaGraph).getRawGraph(); if (rawPreload != null) { dataFind = FinderUtil.cascade(dataFind, new FGraph(rawPreload));
Model model = old.getModel() ; Graph graph = model.getGraph() ; Graph rawGraph = graph instanceof InfGraph ? ((InfGraph) graph).getRawGraph() : graph ; Resource newRes = model.createResource(uri) ; Node newResAsNode = newRes.asNode() ;