Java Doc for OntTools.java in  » RSS-RDF » Jena-2.5.5 » com » hp » hpl » jena » ontology » 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.ontology 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.hp.hpl.jena.ontology.OntTools

OntTools
public class OntTools (Code)

Some general utilities and algorithms to support developers working with the general classes in the Jena ontology API. Warning these utilities are experimental. Extensive testing has not yet occurred (see TestOntTools for basic unit tests), and in particular performance testing has not been carried out yet. Users are advised to exercise caution before relying on these utilities in production code. Please send any comments or suggestions to the Jena support email list.


author:
   Ian Dickinson, HP Labs (email)

Inner Class :public static class DisjointSet
Inner Class :public static class LCAIndex
Inner Class :public static class Path extends ArrayList
Inner Class :public static class PredicatesFilter extends Filter



Method Summary
protected static  voidcheckSolution(OntClass uCls, OntClass vCls, LCAIndex index)
     Check to see if we have found a solution to the problem.
public static  PathfindShortestPath(Model m, Resource start, RDFNode end, Filter onPath)
    

Answer the shortest path from the start resource to the end RDF node, such that every step on the path is accepted by the given filter.

public static  OntClassgetLCA(OntModel m, OntClass u, OntClass v)
    

Answer the lowest common ancestor of two classes in a given ontology.

public static  OntClassgetLCA(OntModel m, OntClass root, OntClass u, OntClass v)
     Answer the lowest common ancestor of two classes, assuming that the given class is the root concept to start searching from.
protected static  DisjointSetlca(OntClass cls, OntClass uCls, OntClass vCls, LCAIndex index)
     Compute the LCA disjoint set at cls, noting that we are searching for the LCA of uCls and vCls.
Parameters:
  cls - The class we are testing (this is 'u' in the Wiki article)
Parameters:
  uCls - One of the two classes we are searching for the LCA of.
public static  ListnamedHierarchyRoots(OntModel m)
     Answer a list of the named hierarchy roots of a given OntModel .
protected static  voidpartitionByNamed(Iterator i, List named, List anon)
    



Method Detail
checkSolution
protected static void checkSolution(OntClass uCls, OntClass vCls, LCAIndex index)(Code)
Check to see if we have found a solution to the problem. TODO: we could throw an exception to simulate a non-local exit here, since we've assumed that P is the unity set.
Parameters:
  uCls -
Parameters:
  vCls -
Parameters:
  index -



findShortestPath
public static Path findShortestPath(Model m, Resource start, RDFNode end, Filter onPath)(Code)

Answer the shortest path from the start resource to the end RDF node, such that every step on the path is accepted by the given filter. A path is a List of RDF Statement s. The subject of the first statement in the list is start, and the object of the last statement in the list is end.

The onPath argument is a Filter , which accepts a statement and returns true if the statement should be considered to be on the path. To search for an unconstrained path, pass Filter.any as an argument. To search for a path whose predicates match a fixed restricted set of property names, pass an instance of PredicatesFilter .

If there is more than one path of minimal length from start to end, this method returns an arbitrary one. The algorithm is blind breadth-first search, with loop detection.


Parameters:
  m - The model in which we are seeking a path
Parameters:
  start - The starting resource
Parameters:
  end - The end, or goal, node
Parameters:
  onPath - A filter which determines whether a given statement can be considered partof the path A path, consisting of a list of statements whose first subject is start,and whose last object is end, or null if no such path exists.



getLCA
public static OntClass getLCA(OntModel m, OntClass u, OntClass v)(Code)

Answer the lowest common ancestor of two classes in a given ontology. This is the class that is farthest from the root concept (defaulting to owl:Thing which is a super-class of both u and v. The algorithm is based on Tarjan's off-line LCA. The current implementation expects that the given model:

  • is transitively closed over the subClassOf relation
  • can cheaply determine direct sub-class relations

Both of these conditions are true of the built-in Jena OWL reasoners, such as OntModelSpec.OWL_MEM_MICRO_RULE_INF , and external DL reasoners such as Pellet.


Parameters:
  m - The ontology model being queried to find the LCA, which should conformto the reasoner capabilities described above
Parameters:
  u - An ontology class
Parameters:
  v - An ontology class The LCA of u and v
exception:
  JenaException - if the language profile of the given model does notdefine a top concept (e.g. owl:Thing)



getLCA
public static OntClass getLCA(OntModel m, OntClass root, OntClass u, OntClass v)(Code)
Answer the lowest common ancestor of two classes, assuming that the given class is the root concept to start searching from. See OntTools.getLCA(OntModel,OntClass,OntClass) for details.
Parameters:
  m - The ontology model being queried to find the LCA, which should conformto the reasoner capabilities described above
Parameters:
  root - The root concept, which will be the starting point for the algorithm
Parameters:
  u - An ontology class
Parameters:
  v - An ontology class The LCA of u and v
exception:
  JenaException - if the language profile of the given model does notdefine a top concept (e.g. owl:Thing)



lca
protected static DisjointSet lca(OntClass cls, OntClass uCls, OntClass vCls, LCAIndex index)(Code)
Compute the LCA disjoint set at cls, noting that we are searching for the LCA of uCls and vCls.
Parameters:
  cls - The class we are testing (this is 'u' in the Wiki article)
Parameters:
  uCls - One of the two classes we are searching for the LCA of. Wehave simplified the set P of pairs to the unity set {uCls,vCls}
Parameters:
  vCls - One of the two classes we are searching for the LCA of. Wehave simplified the set P of pairs to the unity set {uCls,vCls}
Parameters:
  index - A data structure mapping resources to disjoint sets (sincewe can't side-effect Jena resources), and which is used to record theLCA pairs



namedHierarchyRoots
public static List namedHierarchyRoots(OntModel m)(Code)
Answer a list of the named hierarchy roots of a given OntModel . This will be similar to the results of OntModel.listHierarchyRootClasses , with the added constraint that every member of the returned iterator will be a named class, not an anonymous class expression. The named root classes are calculated from the root classes, by recursively replacing every anonymous class with its direct sub-classes. Thus it can be seen that the values in the list consists of the shallowest fringe of named classes in the hierarchy.
Parameters:
  m - An ontology model A list of classes whose members are the named root classes of theclass hierarchy in m



partitionByNamed
protected static void partitionByNamed(Iterator i, List named, List anon)(Code)
Partition the members of an iterator into two lists, according to whether they are named or anonymous classes
Parameters:
  i - An iterator to partition
Parameters:
  named - A list of named classes
Parameters:
  anon - A list of anonymous classes



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.