Source Code Cross Referenced for BaseGraphMaker.java in  » RSS-RDF » Jena-2.5.5 » com » hp » hpl » jena » graph » impl » 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.graph.impl 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:          (c) Copyright 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
003:          [See end of file]
004:          $Id: BaseGraphMaker.java,v 1.19 2008/01/02 12:05:20 andy_seaborne Exp $
005:         */
006:
007:        package com.hp.hpl.jena.graph.impl;
008:
009:        import com.hp.hpl.jena.graph.*;
010:        import com.hp.hpl.jena.shared.*;
011:        import com.hp.hpl.jena.vocabulary.*;
012:
013:        /**
014:         This base class provides convenience functions for the three "usual" graph
015:         makers and a place to hold the reification style for the graphs it constructs.   
016:        
017:         @author kers
018:         */
019:        public abstract class BaseGraphMaker implements  GraphMaker {
020:            /**
021:                Construct the base level of a graph maker.
022:             	@param style the reification style for all the graphs it makes
023:             */
024:            public BaseGraphMaker(ReificationStyle style) {
025:                this .style = style;
026:            }
027:
028:            private int counter = 0;
029:            protected ReificationStyle style;
030:
031:            /**
032:                Answer our reification style.
033:             */
034:            public ReificationStyle getReificationStyle() {
035:                return style;
036:            }
037:
038:            /**
039:                Answer the default graph for this maker. If we haven't already made it, make it
040:                now.
041:             */
042:            public Graph getGraph() {
043:                if (defaultGraph == null) {
044:                    defaultGraph = createGraph();
045:                }
046:                return defaultGraph;
047:            }
048:
049:            private Graph defaultGraph;
050:
051:            public Graph openGraph() {
052:                if (defaultGraph == null)
053:                    throw new DoesNotExistException(
054:                            "no default graph in this GraphMaker ["
055:                                    + this .getClass() + "]");
056:                return defaultGraph;
057:            }
058:
059:            /**
060:                Make a fresh anonymous graph.
061:             */
062:            public Graph createGraph() {
063:                return createGraph("anon_" + counter++ + "", false);
064:            }
065:
066:            /**
067:               A non-strict create.
068:             	@see com.hp.hpl.jena.graph.GraphMaker#createGraph(java.lang.String)
069:             */
070:            public Graph createGraph(String name) {
071:                return createGraph(name, false);
072:            }
073:
074:            /**
075:                A non-strict open.
076:             	@see com.hp.hpl.jena.graph.GraphMaker#openGraph(java.lang.String)
077:             */
078:            public Graph openGraph(String name) {
079:                return openGraph(name, false);
080:            }
081:
082:            /**
083:                Answer an RDF specification of this GraphMaker, adequate to constructing one
084:                just like it.
085:                
086:                @return a Graph describing the Maker using the JenaModelSpec vocabulary.
087:             */
088:            public Graph getDescription() {
089:                return getDescription(Node.createAnon());
090:            }
091:
092:            public Graph getDescription(Node root) {
093:                Graph result = Factory.createGraphMem();
094:                addDescription(result, root);
095:                return result;
096:            }
097:
098:            public Graph addDescription(Graph desc, Node self) {
099:                Node mode = JenaModelSpec.styleAsJMS(style);
100:                desc.add(Triple.create(self, JenaModelSpec.reificationMode
101:                        .asNode(), mode));
102:                desc.add(Triple.create(self, RDF.Nodes.type, getMakerClass()));
103:                augmentDescription(desc, self);
104:                return desc;
105:            }
106:
107:            /**
108:                Update the graph g with any other descriptive information for this GraphMaker.
109:                @param d the description to be augmented
110:                @param self the node that represents this GraphMaker
111:             */
112:            protected abstract void augmentDescription(Graph d, Node self);
113:
114:            /**
115:                Answer the Class node for this GraphMaker's description.
116:                
117:                @return a URI node which is some RDFS subclass of MakerSpec
118:             */
119:            public abstract Node getMakerClass();
120:        }
121:
122:        /*
123:         (c) Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
124:         All rights reserved.
125:
126:         Redistribution and use in source and binary forms, with or without
127:         modification, are permitted provided that the following conditions
128:         are met:
129:
130:         1. Redistributions of source code must retain the above copyright
131:         notice, this list of conditions and the following disclaimer.
132:
133:         2. Redistributions in binary form must reproduce the above copyright
134:         notice, this list of conditions and the following disclaimer in the
135:         documentation and/or other materials provided with the distribution.
136:
137:         3. The name of the author may not be used to endorse or promote products
138:         derived from this software without specific prior written permission.
139:
140:         THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
141:         IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
142:         OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
143:         IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
144:         INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
145:         NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
146:         DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
147:         THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
148:         (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
149:         THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
150:         */
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.