Java Doc for BaseInfGraph.java in  » RSS-RDF » Jena-2.5.5 » com » hp » hpl » jena » reasoner » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » RSS RDF » Jena 2.5.5 » com.hp.hpl.jena.reasoner 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.hp.hpl.jena.graph.impl.GraphBase
      com.hp.hpl.jena.reasoner.BaseInfGraph

All known Subclasses:   com.hp.hpl.jena.reasoner.rulesys.LPBackwardRuleInfGraph,  com.hp.hpl.jena.reasoner.transitiveReasoner.TransitiveInfGraph,  com.hp.hpl.jena.reasoner.rulesys.BasicForwardRuleInfGraph,  com.hp.hpl.jena.reasoner.rdfsReasoner1.RDFSInfGraph,  com.hp.hpl.jena.reasoner.dig.DIGInfGraph,  com.hp.hpl.jena.reasoner.rulesys.impl.oldCode.BasicBackwardRuleInfGraph,
BaseInfGraph
abstract public class BaseInfGraph extends GraphBase implements InfGraph(Code)
A base level implementation of the InfGraph interface.
author:
   Dave Reynolds
version:
   $Revision: 1.48 $ on $Date: 2008/01/02 12:07:00 $

Inner Class :public static class InfCapabilities extends AllCapabilities
Inner Class :public static class InfFindSafeCapabilities extends InfCapabilities
Inner Class :static class InfBulkUpdateHandler extends SimpleBulkUpdateHandler
Inner Class :public static class InfTransactionHandler extends TransactionHandlerBase implements TransactionHandler

Field Summary
protected  FGraphfdata
    
protected  booleanisPrepared
    
protected  Reasonerreasoner
    
protected  booleanrecordDerivations
    
protected volatile  intversion
    

Constructor Summary
public  BaseInfGraph(Graph data, Reasoner reasoner)
    
public  BaseInfGraph(Graph data, Reasoner reasoner, ReificationStyle style)
    

Method Summary
public  InfGraphcloneWithPremises(Graph premises)
     Return a new inference graph which is a clone of the current graph together with an additional set of data premises.
public  voidclose()
     Free all resources, any further use of this Graph is an error.
public  ReifierconstructReifier()
     Inference graphs share the reifiers of their underlying raw graphs.
protected  voiddiscardState()
     discard any state that depends on the content of fdata, because it's just been majorly trashed, solid gone.
public  ExtendedIteratorfind(Node subject, Node property, Node object, Graph param)
     An extension of the Graph.find interface which allows the caller to encode complex expressions in RDF and then refer to those expressions within the query triple.
public  ExtendedIteratorfind(TriplePattern pattern)
     Basic pattern lookup interface.
abstract public  ExtendedIteratorfindWithContinuation(TriplePattern pattern, Finder continuation)
     Extended find interface used in situations where the implementator may or may not be able to answer the complete query.
public  BulkUpdateHandlergetBulkUpdateHandler()
    
public  CapabilitiesgetCapabilities()
     Answer the InfCapabilities of this InfGraph.
public  GraphgetDeductionsGraph()
     Returns a derivations graph.
public  IteratorgetDerivation(Triple triple)
     Return the derivation of the given triple (which is the result of some previous find operation).
public  NodegetGlobalProperty(Node property)
     Test a global boolean property of the graph.
public  PrefixMappinggetPrefixMapping()
     Inference graphs share the prefix-mapping of their underlying raw graph.
public  GraphgetRawGraph()
     Return the raw RDF data Graph being processed (i.e.
public  ReasonergetReasoner()
     Return the Reasoner which is being used to answer queries to this graph.
abstract public  GraphgetSchemaGraph()
     Return the schema graph, if any, bound into this inference graph.
public  TransactionHandlergetTransactionHandler()
    
public  intgetVersion()
     Return a version stamp for this graph which can be used to fast-fail concurrent modification exceptions.
public  ExtendedIteratorgraphBaseFind(TripleMatch m)
     Returns an iterator over Triples.

This code used to have the .filterKeep component uncommented.

public  ExtendedIteratorgraphBaseFind(Node subject, Node property, Node object)
     Returns an iterator over Triples.
public  intgraphBaseSize()
    
public  booleanisEmpty()
     Answer true iff this graph is empty.
public  booleanisPrepared()
     Answer true iff this graph has been through the prepare() step.
public synchronized  voidperformAdd(Triple t)
     Add one triple to the data graph, run any rules triggered by the new data item, recursively adding any generated triples.
public  voidperformDelete(Triple t)
     Removes the triple t (if possible) from the set belonging to this graph.
public  voidprepare()
     Perform any initial processing and caching.
public  voidrebind(Graph data)
     Replace the underlying data graph for this inference graph and start any inferences over again.
public  voidrebind()
     Cause the inference graph to reconsult the underlying graph to take into account changes.
public  voidreset()
     Reset any internal caches.
public  voidsetDerivationLogging(boolean logOn)
    
public  booleantestGlobalProperty(Node property)
     A convenience version of getGlobalProperty which can only return a boolean result.
public  ValidityReportvalidate()
     Test the consistency of the bound data.

Field Detail
fdata
protected FGraph fdata(Code)
The graph of raw data which is being reasoned over



isPrepared
protected boolean isPrepared(Code)
Flag to record if the preparation call has been made and so the graph is ready for queries



reasoner
protected Reasoner reasoner(Code)
The Reasoner instance which performs all inferences and Tbox lookups



recordDerivations
protected boolean recordDerivations(Code)
Flag, if set to true then derivations are recorded



version
protected volatile int version(Code)
version count




Constructor Detail
BaseInfGraph
public BaseInfGraph(Graph data, Reasoner reasoner)(Code)
Constructor
Parameters:
  data - the raw data file to be augmented with entailments
Parameters:
  reasoner - the engine, with associated tbox data, whose find interfacecan be used to extract all entailments from the data.



BaseInfGraph
public BaseInfGraph(Graph data, Reasoner reasoner, ReificationStyle style)(Code)




Method Detail
cloneWithPremises
public InfGraph cloneWithPremises(Graph premises)(Code)
Return a new inference graph which is a clone of the current graph together with an additional set of data premises. The default implementation loses ALL partial deductions so far. Some subclasses may be able to a more efficient job.



close
public void close()(Code)
Free all resources, any further use of this Graph is an error.



constructReifier
public Reifier constructReifier()(Code)
Inference graphs share the reifiers of their underlying raw graphs. This may be too simplistic - they won't see quads flying past. TODO write a test case that reveals this.
See Also:   com.hp.hpl.jena.graph.Graph.getReifier



discardState
protected void discardState()(Code)
discard any state that depends on the content of fdata, because it's just been majorly trashed, solid gone.



find
public ExtendedIterator find(Node subject, Node property, Node object, Graph param)(Code)
An extension of the Graph.find interface which allows the caller to encode complex expressions in RDF and then refer to those expressions within the query triple. For example, one might encode a class expression and then ask if there are any instances of this class expression in the InfGraph.
Parameters:
  subject - the subject Node of the query triple, may be a Node inthe graph or a node in the parameter micro-graph or null
Parameters:
  property - the property to be retrieved or null
Parameters:
  object - the object Node of the query triple, may be a Node inthe graph or a node in the parameter micro-graph.
Parameters:
  param - a small graph encoding an expression which the subject and/orobject nodes refer.



find
public ExtendedIterator find(TriplePattern pattern)(Code)
Basic pattern lookup interface. This implementation assumes that the underlying findWithContinuation will have also consulted the raw data.
Parameters:
  pattern - a TriplePattern to be matched against the data a ExtendedIterator over all Triples in the data setthat match the pattern



findWithContinuation
abstract public ExtendedIterator findWithContinuation(TriplePattern pattern, Finder continuation)(Code)
Extended find interface used in situations where the implementator may or may not be able to answer the complete query. It will attempt to answer the pattern but if its answers are not known to be complete then it will also pass the request on to the nested Finder to append more results.
Parameters:
  pattern - a TriplePattern to be matched against the data
Parameters:
  continuation - either a Finder or a normal Graph whichwill be asked for additional match results if the implementormay not have completely satisfied the query.



getBulkUpdateHandler
public BulkUpdateHandler getBulkUpdateHandler()(Code)



getCapabilities
public Capabilities getCapabilities()(Code)
Answer the InfCapabilities of this InfGraph.



getDeductionsGraph
public Graph getDeductionsGraph()(Code)
Returns a derivations graph. 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. the deductions graph, if relevant for this class of inferenceengine or null if not.



getDerivation
public Iterator getDerivation(Triple triple)(Code)
Return the derivation of the given triple (which is the result of some previous find operation). Not all reasoneers will support derivations. an iterator over Derivation records or null if there is no derivation informationavailable for this triple.



getGlobalProperty
public Node getGlobalProperty(Node property)(Code)
Test a global boolean property of the graph. This might included properties like consistency, OWLSyntacticValidity etc. It remains to be seen what level of generality is needed here. We could replace this by a small number of specific tests for common concepts.
Parameters:
  property - the URI of the property to be tested a Node giving the value of the global property, this maybe a boolean literal, some other literal value (e.g. a size).



getPrefixMapping
public PrefixMapping getPrefixMapping()(Code)
Inference graphs share the prefix-mapping of their underlying raw graph.
See Also:   com.hp.hpl.jena.graph.Graph.getPrefixMapping



getRawGraph
public Graph getRawGraph()(Code)
Return the raw RDF data Graph being processed (i.e. the argument to the Reasonder.bind call that created this InfGraph).



getReasoner
public Reasoner getReasoner()(Code)
Return the Reasoner which is being used to answer queries to this graph.



getSchemaGraph
abstract public Graph getSchemaGraph()(Code)
Return the schema graph, if any, bound into this inference graph.



getTransactionHandler
public TransactionHandler getTransactionHandler()(Code)



getVersion
public int getVersion()(Code)
Return a version stamp for this graph which can be used to fast-fail concurrent modification exceptions.



graphBaseFind
public ExtendedIterator graphBaseFind(TripleMatch m)(Code)
Returns an iterator over Triples.

This code used to have the .filterKeep component uncommented. We think this is because of earlier history, before .matches on a literal node was implemented as sameValueAs rather than equals. If it turns out that the filter is needed, it can be commented back in, AND a corresponding filter added to find(Node x 3) -- and test cases, of course.

[Chris, after discussion with Dave]




graphBaseFind
public ExtendedIterator graphBaseFind(Node subject, Node property, Node object)(Code)
Returns an iterator over Triples. This implementation assumes that the underlying findWithContinuation will have also consulted the raw data.



graphBaseSize
public int graphBaseSize()(Code)
Return the number of triples in the just the base graph



isEmpty
public boolean isEmpty()(Code)
Answer true iff this graph is empty. [Used to be in QueryHandler, but moved in here because it's a more primitive operation.]



isPrepared
public boolean isPrepared()(Code)
Answer true iff this graph has been through the prepare() step. For testing purposes.



performAdd
public synchronized void performAdd(Triple t)(Code)
Add one triple to the data graph, run any rules triggered by the new data item, recursively adding any generated triples.



performDelete
public void performDelete(Triple t)(Code)
Removes the triple t (if possible) from the set belonging to this graph.



prepare
public void prepare()(Code)
Perform any initial processing and caching. This call is optional. Most engines either have negligable set up work or will perform an implicit "prepare" if necessary. The call is provided for those occasions where substantial preparation work is possible (e.g. running a forward chaining rule system) and where an application might wish greater control over when this prepration is done.



rebind
public void rebind(Graph data)(Code)
Replace the underlying data graph for this inference graph and start any inferences over again. This is primarily using in setting up ontology imports processing to allow an imports multiunion graph to be inserted between the inference graph and the raw data, before processing.
Parameters:
  data - the new raw data graph



rebind
public void rebind()(Code)
Cause the inference graph to reconsult the underlying graph to take into account changes. Normally changes are made through the InfGraph's add and remove calls are will be handled appropriately. However, in some cases changes are made "behind the InfGraph's back" and this forces a full reconsult of the changed data.



reset
public void reset()(Code)
Reset any internal caches. Some systems, such as the tabled backchainer, retain information after each query. A reset will wipe this information preventing unbounded memory use at the expense of more expensive future queries. A reset does not cause the raw data to be reconsulted and so is less expensive than a rebind.



setDerivationLogging
public void setDerivationLogging(boolean logOn)(Code)
Switch on/off drivation logging



testGlobalProperty
public boolean testGlobalProperty(Node property)(Code)
A convenience version of getGlobalProperty which can only return a boolean result.



validate
public ValidityReport validate()(Code)
Test the consistency of the bound data. This normally tests the validity of the bound instance data against the bound schema data. a ValidityReport structure



Fields inherited from com.hp.hpl.jena.graph.impl.GraphBase
protected BulkUpdateHandler bulkHandler(Code)(Java Doc)
protected Capabilities capabilities(Code)(Java Doc)
protected boolean closed(Code)(Java Doc)
protected GraphEventManager gem(Code)(Java Doc)
protected PrefixMapping pm(Code)(Java Doc)
protected QueryHandler queryHandler(Code)(Java Doc)
protected Reifier reifier(Code)(Java Doc)
protected GraphStatisticsHandler statisticsHandler(Code)(Java Doc)
final protected ReificationStyle style(Code)(Java Doc)

Methods inherited from com.hp.hpl.jena.graph.impl.GraphBase
public void add(Triple t)(Code)(Java Doc)
protected void checkOpen()(Code)(Java Doc)
public void close()(Code)(Java Doc)
protected Reifier constructReifier()(Code)(Java Doc)
final public boolean contains(Triple t)(Code)(Java Doc)
final public boolean contains(Node s, Node p, Node o)(Code)(Java Doc)
final protected boolean containsByFind(Triple t)(Code)(Java Doc)
protected GraphStatisticsHandler createStatisticsHandler()(Code)(Java Doc)
final public void delete(Triple t)(Code)(Java Doc)
public boolean dependsOn(Graph other)(Code)(Java Doc)
final public ExtendedIterator find(TripleMatch m)(Code)(Java Doc)
final public ExtendedIterator find(Node s, Node p, Node o)(Code)(Java Doc)
public ExtendedIterator forTestingOnly_graphBaseFind(TripleMatch tm)(Code)(Java Doc)
public BulkUpdateHandler getBulkUpdateHandler()(Code)(Java Doc)
public Capabilities getCapabilities()(Code)(Java Doc)
public GraphEventManager getEventManager()(Code)(Java Doc)
public PrefixMapping getPrefixMapping()(Code)(Java Doc)
public Reifier getReifier()(Code)(Java Doc)
public GraphStatisticsHandler getStatisticsHandler()(Code)(Java Doc)
public TransactionHandler getTransactionHandler()(Code)(Java Doc)
protected boolean graphBaseContains(Triple t)(Code)(Java Doc)
abstract protected ExtendedIterator graphBaseFind(TripleMatch m)(Code)(Java Doc)
protected ExtendedIterator graphBaseFind(Node s, Node p, Node o)(Code)(Java Doc)
protected int graphBaseSize()(Code)(Java Doc)
public boolean isClosed()(Code)(Java Doc)
public boolean isEmpty()(Code)(Java Doc)
public boolean isIsomorphicWith(Graph g)(Code)(Java Doc)
public void notifyAdd(Triple t)(Code)(Java Doc)
public void notifyDelete(Triple t)(Code)(Java Doc)
public void performAdd(Triple t)(Code)(Java Doc)
public void performDelete(Triple t)(Code)(Java Doc)
public QueryHandler queryHandler()(Code)(Java Doc)
protected boolean reifierContains(Triple t)(Code)(Java Doc)
protected int reifierSize()(Code)(Java Doc)
protected ExtendedIterator reifierTriples(TripleMatch m)(Code)(Java Doc)
final public int size()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
public static String toString(String prefix, Graph that)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.