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


001:        /*****************************************************************************
002:         * Source code information
003:         * -----------------------
004:         * Original author    Ian Dickinson, HP Labs Bristol
005:         * Author email       Ian.Dickinson@hp.com
006:         * Package            Jena 2
007:         * Web                http://sourceforge.net/projects/jena/
008:         * Created            22-Jun-2003
009:         * Filename           $RCSfile: RDFSProfile.java,v $
010:         * Revision           $Revision: 1.14 $
011:         * Release status     $State: Exp $
012:         *
013:         * Last modified on   $Date: 2008/01/02 12:08:03 $
014:         *               by   $Author: andy_seaborne $
015:         *
016:         * (c) Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
017:         * (see footer for full conditions)
018:         *****************************************************************************/package com.hp.hpl.jena.ontology.impl;
019:
020:        // Imports
021:        ///////////////
022:        import com.hp.hpl.jena.enhanced.*;
023:        import com.hp.hpl.jena.graph.*;
024:        import com.hp.hpl.jena.ontology.*;
025:        import com.hp.hpl.jena.rdf.model.*;
026:        import com.hp.hpl.jena.vocabulary.*;
027:
028:        import java.util.*;
029:
030:        /**
031:         * <p>
032:         * Ontology language profile for working with RDFS ontologies.  RDFS is a (small)
033:         * sub-set of OWL, mostly.
034:         * </p>
035:         *
036:         * @author Ian Dickinson, HP Labs
037:         *         (<a  href="mailto:Ian.Dickinson@hp.com" >email</a>)
038:         * @version CVS $Id: RDFSProfile.java,v 1.14 2008/01/02 12:08:03 andy_seaborne Exp $
039:         */
040:        public class RDFSProfile extends AbstractProfile {
041:            // Constants
042:            //////////////////////////////////
043:
044:            // Static variables
045:            //////////////////////////////////
046:
047:            // Instance variables
048:            //////////////////////////////////
049:
050:            // Constructors
051:            //////////////////////////////////
052:
053:            // External signature methods
054:            //////////////////////////////////
055:
056:            public String NAMESPACE() {
057:                return RDFS.getURI();
058:            }
059:
060:            public Resource CLASS() {
061:                return RDFS.Class;
062:            }
063:
064:            public Resource RESTRICTION() {
065:                return null;
066:            }
067:
068:            public Resource THING() {
069:                return null;
070:            }
071:
072:            public Resource NOTHING() {
073:                return null;
074:            }
075:
076:            public Resource PROPERTY() {
077:                return RDF.Property;
078:            }
079:
080:            public Resource OBJECT_PROPERTY() {
081:                return null;
082:            }
083:
084:            public Resource DATATYPE_PROPERTY() {
085:                return null;
086:            }
087:
088:            public Resource TRANSITIVE_PROPERTY() {
089:                return null;
090:            }
091:
092:            public Resource SYMMETRIC_PROPERTY() {
093:                return null;
094:            }
095:
096:            public Resource FUNCTIONAL_PROPERTY() {
097:                return null;
098:            }
099:
100:            public Resource INVERSE_FUNCTIONAL_PROPERTY() {
101:                return null;
102:            }
103:
104:            public Resource ALL_DIFFERENT() {
105:                return null;
106:            }
107:
108:            public Resource ONTOLOGY() {
109:                return null;
110:            }
111:
112:            public Resource DEPRECATED_CLASS() {
113:                return null;
114:            }
115:
116:            public Resource DEPRECATED_PROPERTY() {
117:                return null;
118:            }
119:
120:            public Resource ANNOTATION_PROPERTY() {
121:                return null;
122:            }
123:
124:            public Resource ONTOLOGY_PROPERTY() {
125:                return null;
126:            }
127:
128:            public Resource LIST() {
129:                return RDF.List;
130:            }
131:
132:            public Resource NIL() {
133:                return RDF.nil;
134:            }
135:
136:            public Resource DATARANGE() {
137:                return null;
138:            }
139:
140:            public Property EQUIVALENT_PROPERTY() {
141:                return null;
142:            }
143:
144:            public Property EQUIVALENT_CLASS() {
145:                return null;
146:            }
147:
148:            public Property DISJOINT_WITH() {
149:                return null;
150:            }
151:
152:            public Property SAME_INDIVIDUAL_AS() {
153:                return null;
154:            }
155:
156:            public Property SAME_AS() {
157:                return null;
158:            }
159:
160:            public Property DIFFERENT_FROM() {
161:                return null;
162:            }
163:
164:            public Property DISTINCT_MEMBERS() {
165:                return null;
166:            }
167:
168:            public Property UNION_OF() {
169:                return null;
170:            }
171:
172:            public Property INTERSECTION_OF() {
173:                return null;
174:            }
175:
176:            public Property COMPLEMENT_OF() {
177:                return null;
178:            }
179:
180:            public Property ONE_OF() {
181:                return null;
182:            }
183:
184:            public Property ON_PROPERTY() {
185:                return null;
186:            }
187:
188:            public Property ALL_VALUES_FROM() {
189:                return null;
190:            }
191:
192:            public Property HAS_VALUE() {
193:                return null;
194:            }
195:
196:            public Property SOME_VALUES_FROM() {
197:                return null;
198:            }
199:
200:            public Property MIN_CARDINALITY() {
201:                return null;
202:            }
203:
204:            public Property MAX_CARDINALITY() {
205:                return null;
206:            }
207:
208:            public Property CARDINALITY() {
209:                return null;
210:            }
211:
212:            public Property INVERSE_OF() {
213:                return null;
214:            }
215:
216:            public Property IMPORTS() {
217:                return null;
218:            }
219:
220:            public Property PRIOR_VERSION() {
221:                return null;
222:            }
223:
224:            public Property BACKWARD_COMPATIBLE_WITH() {
225:                return null;
226:            }
227:
228:            public Property INCOMPATIBLE_WITH() {
229:                return null;
230:            }
231:
232:            public Property SUB_PROPERTY_OF() {
233:                return RDFS.subPropertyOf;
234:            }
235:
236:            public Property SUB_CLASS_OF() {
237:                return RDFS.subClassOf;
238:            }
239:
240:            public Property DOMAIN() {
241:                return RDFS.domain;
242:            }
243:
244:            public Property RANGE() {
245:                return RDFS.range;
246:            }
247:
248:            public Property FIRST() {
249:                return RDF.first;
250:            }
251:
252:            public Property REST() {
253:                return RDF.rest;
254:            }
255:
256:            public Property MIN_CARDINALITY_Q() {
257:                return null;
258:            }
259:
260:            public Property MAX_CARDINALITY_Q() {
261:                return null;
262:            }
263:
264:            public Property CARDINALITY_Q() {
265:                return null;
266:            }
267:
268:            public Property HAS_CLASS_Q() {
269:                return null;
270:            }
271:
272:            // Annotations
273:            public Property VERSION_INFO() {
274:                return null;
275:            }
276:
277:            public Property LABEL() {
278:                return RDFS.label;
279:            }
280:
281:            public Property COMMENT() {
282:                return RDFS.comment;
283:            }
284:
285:            public Property SEE_ALSO() {
286:                return RDFS.seeAlso;
287:            }
288:
289:            public Property IS_DEFINED_BY() {
290:                return RDFS.isDefinedBy;
291:            }
292:
293:            protected Resource[][] aliasTable() {
294:                return new Resource[][] { {} };
295:            }
296:
297:            /** The only first-class axiom type in OWL is AllDifferent */
298:            public Iterator getAxiomTypes() {
299:                return Arrays.asList(new Resource[] {}).iterator();
300:            }
301:
302:            /** The annotation properties of OWL */
303:            public Iterator getAnnotationProperties() {
304:                return Arrays.asList(
305:                        new Resource[] { RDFS.label, RDFS.seeAlso,
306:                                RDFS.comment, RDFS.isDefinedBy }).iterator();
307:            }
308:
309:            public Iterator getClassDescriptionTypes() {
310:                return Arrays.asList(new Resource[] { RDFS.Class }).iterator();
311:            }
312:
313:            /**
314:             * <p>
315:             * Answer true if the given graph supports a view of this node as the given
316:             * language element, according to the semantic constraints of the profile.
317:             * If strict checking on the ontology model is turned off, this check is
318:             * skipped.
319:             * </p>
320:             *
321:             * @param n A node to test
322:             * @param g The enhanced graph containing <code>n</code>, which is assumed to
323:             * be an {@link OntModel}.
324:             * @param type A class indicating the facet that we are testing against.
325:             * @return True if strict checking is off, or if <code>n</code> can be
326:             * viewed according to the facet resource <code>res</code>
327:             */
328:            public boolean isSupported(Node n, EnhGraph g, Class type) {
329:                if (g instanceof  OntModel) {
330:                    OntModel m = (OntModel) g;
331:
332:                    if (!m.strictMode()) {
333:                        // checking turned off
334:                        return true;
335:                    } else {
336:                        // lookup the profile check for this resource
337:                        SupportsCheck check = (SupportsCheck) s_supportsChecks
338:                                .get(type);
339:
340:                        // a check must be defined for the test to succeed
341:                        return (check == null) || check.doCheck(n, g);
342:                    }
343:                } else {
344:                    return false;
345:                }
346:            }
347:
348:            /**
349:             * <p>
350:             * Answer a descriptive string for this profile, for use in debugging and other output.
351:             * </p>
352:             * @return "OWL Full"
353:             */
354:            public String getLabel() {
355:                return "RDFS";
356:            }
357:
358:            // Internal implementation methods
359:            //////////////////////////////////
360:
361:            //==============================================================================
362:            // Inner class definitions
363:            //==============================================================================
364:
365:            /** Helper class for doing syntactic/semantic checks on a node */
366:            protected static class SupportsCheck {
367:                public boolean doCheck(Node n, EnhGraph g) {
368:                    return true;
369:                }
370:            }
371:
372:            // Table of check data
373:            //////////////////////
374:
375:            private static Object[][] s_supportsCheckTable = new Object[][] {
376:            // Resource (key),              check method
377:                    { OntClass.class, new SupportsCheck() {
378:                        public boolean doCheck(Node n, EnhGraph g) {
379:                            return g.asGraph().contains(n, RDF.type.asNode(),
380:                                    RDFS.Class.asNode())
381:                                    || g.asGraph().contains(n,
382:                                            RDF.type.asNode(),
383:                                            RDFS.Datatype.asNode())
384:                                    ||
385:                                    // These are common cases that we should support
386:                                    n.equals(RDFS.Resource.asNode())
387:                                    || g.asGraph().contains(Node.ANY,
388:                                            RDFS.domain.asNode(), n)
389:                                    || g.asGraph().contains(Node.ANY,
390:                                            RDFS.range.asNode(), n);
391:                        }
392:                    } }, { RDFList.class, new SupportsCheck() {
393:                        public boolean doCheck(Node n, EnhGraph g) {
394:                            return n.equals(RDF.nil.asNode())
395:                                    || g.asGraph().contains(n,
396:                                            RDF.type.asNode(),
397:                                            RDF.List.asNode());
398:                        }
399:                    } }, { OntProperty.class, new SupportsCheck() {
400:                        public boolean doCheck(Node n, EnhGraph g) {
401:                            return g.asGraph().contains(n, RDF.type.asNode(),
402:                                    RDF.Property.asNode());
403:                        }
404:                    } }, };
405:
406:            // Static variables
407:            //////////////////////////////////
408:
409:            /** Map from resource to syntactic/semantic checks that a node can be seen as the given facet */
410:            protected static HashMap s_supportsChecks = new HashMap();
411:
412:            static {
413:                // initialise the map of supports checks from a table of static data
414:                for (int i = 0; i < s_supportsCheckTable.length; i++) {
415:                    s_supportsChecks.put(s_supportsCheckTable[i][0],
416:                            s_supportsCheckTable[i][1]);
417:                }
418:            }
419:
420:            //==============================================================================
421:            // Inner class definitions
422:            //==============================================================================
423:
424:        }
425:
426:        /*
427:         (c) Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
428:         All rights reserved.
429:
430:         Redistribution and use in source and binary forms, with or without
431:         modification, are permitted provided that the following conditions
432:         are met:
433:
434:         1. Redistributions of source code must retain the above copyright
435:         notice, this list of conditions and the following disclaimer.
436:
437:         2. Redistributions in binary form must reproduce the above copyright
438:         notice, this list of conditions and the following disclaimer in the
439:         documentation and/or other materials provided with the distribution.
440:
441:         3. The name of the author may not be used to endorse or promote products
442:         derived from this software without specific prior written permission.
443:
444:         THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
445:         IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
446:         OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
447:         IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
448:         INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
449:         NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
450:         DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
451:         THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
452:         (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
453:         THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
454:         */
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.