/** Answer a model that encapsulates the given graph. Existing prefixes are undisturbed. @param g A graph structure @return A model presenting an API view of graph g */ public static Model createModelForGraph( Graph g ) { return new ModelCom( g ); }
public Model asModel( Graph g ) { return new ModelCom( g ); }
protected Model makeModel( Graph g ) { return new ModelCom( g ); }
/** Answer a fresh Model with the default specification. */ public static Model createDefaultModel() { return new ModelCom( Factory.createGraphMem( ) ); }
/** Answer a new memory-based model with the given reification style @deprecated Hidden partial reifications not supported -- only style "Standard" */ @Deprecated public static Model createDefaultModel( ReificationStyle style ) { return new ModelCom( Factory.createGraphMem( ) ); }
public Model openModel() { return new ModelCom( maker.openGraph() ); }
/** * 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()); }
/** Construct a new FileGraph who's name is given by the specified File, If create is true, this is a new file, and any existing file will be destroyed; if create is false, this is an existing file, and its current contents will be loaded. The language code for the file is supplied. @param f the File naming the associated file-system file @param lang the language string for the file @param create true to create a new one, false to read an existing one @param strict true to throw exceptions for create: existing, open: not found @param style the reification style for the graph */ public FileGraph( NotifyOnClose notify, File f, String lang, boolean create, boolean strict ) { this.name = f; this.notify = notify; this.model = new ModelCom( this ); this.lang = lang; if (create) { if (f.exists() && strict) throw new AlreadyExistsException( f.toString() ); } else readModel( this.model, strict ); }
/** * Returns a derivations model. The rule reasoners typically create a * graph containing those triples added to the base graph due to rule firings. * In some applications it can useful to be able to access those deductions * directly, without seeing the raw data which triggered them. In particular, * this allows the forward rules to be used as if they were rewrite transformation * rules. * @return the deductions model, if relevant for this class of inference * engine or null if not. */ @Override public Model getDeductionsModel() { Graph deductionsGraph = getInfGraph().getDeductionsGraph(); if (deductionsGraph != null) { if (deductionsModel == null || (deductionsModel.getGraph() != deductionsGraph) ) { deductionsModel = new ModelCom(deductionsGraph); } } return deductionsModel; }