Source Code Cross Referenced for RDFPredicate.java in  » Rule-Engine » Mandarax » org » mandarax » rdf » 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 » Rule Engine » Mandarax » org.mandarax.rdf 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (C) 1999-2004 <a href="mailto:mandarax@jbdietrich.com">Jens Dietrich</a>
003:         *
004:         * This library is free software; you can redistribute it and/or
005:         * modify it under the terms of the GNU Lesser General Public
006:         * License as published by the Free Software Foundation; either
007:         * version 2 of the License, or (at your option) any later version.
008:         *
009:         * This library is distributed in the hope that it will be useful,
010:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
011:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
012:         * Lesser General Public License for more details.
013:         *
014:         * You should have received a copy of the GNU Lesser General Public
015:         * License along with this library; if not, write to the Free Software
016:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
017:         */
018:
019:        package org.mandarax.rdf;
020:
021:        import org.mandarax.kernel.*;
022:
023:        /** 
024:         * RDF predicate implementation.  
025:         * @author <A HREF="mailto:j.b.dietrich@massey.ac.nz">Jens Dietrich</A> <A HREF="mailto:paschke@in.tum.de">Adrian Paschke</A>
026:         * @version 1.1 <01 August 2004>
027:         * @since 0.1
028:         */
029:
030:        public class RDFPredicate implements  Predicate, RDFLogger {
031:            private static final String[] slotNames = { "subject", "object" };
032:            // TODO inventing our own classes Resource and Literals seems to be the easiest way, but is memory intensive
033:            // should we just use the respective JENA types??
034:            private static final Class[] structure = { Object.class,
035:                    Object.class };
036:
037:            private String nameSpace = null;
038:            private String localName = null;
039:
040:            /**
041:             * Constructor.
042:             */
043:            public RDFPredicate() {
044:                super ();
045:            }
046:
047:            /**
048:             * Constructor.
049:             * @param nameSpace a name space
050:             * @param localName a local name
051:             */
052:            public RDFPredicate(String nameSpace, String localName) {
053:                super ();
054:                this .nameSpace = nameSpace;
055:                this .localName = localName;
056:            }
057:
058:            /**
059:             * Get the slot names.
060:             * @return an array of strings
061:             */
062:            public String[] getSlotNames() {
063:                return slotNames;
064:            }
065:
066:            /**
067:             * Set the slot names. This method is ignored, the slot names are fixed
068:             * @param names an array of strings
069:             */
070:            public void setSlotNames(String[] names) {
071:                throw new UnsupportedOperationException(
072:                        "The slot names cannot be changed ");
073:            }
074:
075:            /**
076:             * Indicates whether the slot names can be modified.
077:             * @return a boolean
078:             */
079:            public boolean slotNamesCanBeEdited() {
080:                return false;
081:            }
082:
083:            /**
084:             * Get the name of the object.
085:             * @return the name of the constructor
086:             */
087:            public String getName() {
088:                return (nameSpace == null ? "" : nameSpace) + localName;
089:            }
090:
091:            /**
092:             * Get the type structure of the object, e.g. the types of terms
093:             * that can be used with this constructor.
094:             * @return the structure of this constructor
095:             */
096:            public Class[] getStructure() {
097:
098:                return structure;
099:            }
100:
101:            /**
102:             * Perform the function or predicate using an array of terms as parameters.
103:             * @return the result of the perform operation
104:             * @param parameter an array of terms
105:             * @param session a session object
106:             * @throws java.lang.UnsupportedOperationException thrown if this constructor does not have a sematics and this operation cannot be supported
107:             * @throws java.lang.IllegalArgumentException
108:             */
109:            public Object perform(Term[] parameter, Session session)
110:                    throws IllegalArgumentException,
111:                    UnsupportedOperationException {
112:                throw new UnsupportedOperationException(
113:                        "RDF Predicates do not support \"perform\"");
114:            }
115:
116:            /**
117:             * Indicates whether this predicate is executable.
118:             * @return a boolean
119:             */
120:            public boolean isExecutable() {
121:                return false;
122:            }
123:
124:            /**
125:             * Get the local name.
126:             * @return Returns the localName.
127:             */
128:            public String getLocalName() {
129:                return localName;
130:            }
131:
132:            /**
133:             * Set the local name.
134:             * @param localName The localName to set.
135:             */
136:            public void setLocalName(String localName) {
137:                this .localName = localName;
138:            }
139:
140:            /**
141:             * Get the name space.
142:             * @return Returns the nameSpace.
143:             */
144:            public String getNameSpace() {
145:                return nameSpace;
146:            }
147:
148:            /**
149:             * Set the name space.
150:             * @param nameSpace The nameSpace to set.
151:             */
152:            public void setNameSpace(String nameSpace) {
153:                this .nameSpace = nameSpace;
154:            }
155:
156:            /**
157:             * Convert this object to a string.
158:             * @return the string representation of the object.
159:             */
160:            public String toString() {
161:                return new StringBuffer().append("anRDFPredicate(").append(
162:                        nameSpace == null ? "" : nameSpace).append(localName)
163:                        .append(')').toString();
164:            }
165:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.