Update of /cvsroot/javaowl/JavaOWL/src/org/javaowl/editor/remote
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13658/src/org/javaowl/editor/remote
Modified Files:
RemoteModelEditor.java RemoteModelEditorBase.java
RemoteModelEditorWrapper.java
Log Message:
More tests and fixes to remote model editor implementation.
Index: RemoteModelEditorWrapper.java
===================================================================
RCS file: /cvsroot/javaowl/JavaOWL/src/org/javaowl/editor/remote/RemoteModelEditorWrapper.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** RemoteModelEditorWrapper.java 28 Aug 2004 00:43:02 -0000 1.13
--- RemoteModelEditorWrapper.java 1 Sep 2004 21:44:17 -0000 1.14
***************
*** 88,92 ****
return classes;
}
!
private OntProperty[] createOntPropertiesFromURIs(String[] uris) {
OntProperty[] properties = new OntProperty[uris.length];
--- 88,92 ----
return classes;
}
!
private OntProperty[] createOntPropertiesFromURIs(String[] uris) {
OntProperty[] properties = new OntProperty[uris.length];
***************
*** 169,173 ****
return ModelEditorBean
.getStatementEditor(ontModel.createStatement((Resource) subject,
! (Property) predicate, object), this);
}
--- 169,175 ----
return ModelEditorBean
.getStatementEditor(ontModel.createStatement((Resource) subject,
! (Property) predicate
! .as(Property.class),
! object), this);
}
***************
*** 213,217 ****
boolean uri) {
try {
! return remote.getPropertyValue(resource.getURI(), property.getURI(), uri);
} catch (RemoteException e) {
throw new RuntimeException(e);
--- 215,219 ----
boolean uri) {
try {
! return remote.getResourcePropertyValue(resource.getURI(), property.getURI(), uri);
} catch (RemoteException e) {
throw new RuntimeException(e);
***************
*** 219,223 ****
}
! public OntClass[] getSubClasses(OntClass clazz) {
try {
String[] uris = remote.getSubClasses(clazz.getURI());
--- 221,225 ----
}
! public OntClass[] getSubClasses(OntClass clazz) {
try {
String[] uris = remote.getSubClasses(clazz.getURI());
***************
*** 235,239 ****
try {
String uri = remote.getValidLeafClass(property.getURI());
! return ontModel.createClass(uri);
} catch (RemoteException e) {
throw new RuntimeException(e);
--- 237,241 ----
try {
String uri = remote.getValidLeafClass(property.getURI());
! return (uri == null) ? null : ontModel.createClass(uri);
} catch (RemoteException e) {
throw new RuntimeException(e);
Index: RemoteModelEditor.java
===================================================================
RCS file: /cvsroot/javaowl/JavaOWL/src/org/javaowl/editor/remote/RemoteModelEditor.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** RemoteModelEditor.java 28 Aug 2004 00:43:01 -0000 1.10
--- RemoteModelEditor.java 1 Sep 2004 21:44:17 -0000 1.11
***************
*** 55,58 ****
--- 55,61 ----
throws RemoteException;
+ String getResourcePropertyValue(String resource, String property, boolean uri)
+ throws RemoteException;
+
String[] getSubClasses(String clazz) throws RemoteException;
Index: RemoteModelEditorBase.java
===================================================================
RCS file: /cvsroot/javaowl/JavaOWL/src/org/javaowl/editor/remote/RemoteModelEditorBase.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** RemoteModelEditorBase.java 28 Aug 2004 00:43:01 -0000 1.2
--- RemoteModelEditorBase.java 1 Sep 2004 21:44:17 -0000 1.3
***************
*** 1,8 ****
/*
! * Created on Aug 25, 2004
! *
! * TODO To change the template for this generated file go to
! * Window - Preferences - Java - Code Style - Code Templates
*/
package org.javaowl.editor.remote;
--- 1,21 ----
/*
! * RemoteModelEditorWrapper.java Copyright (C) 2004 Gerardo Horvilleur Martinez, Elmer
! * Garduno Hernandez
! *
! * This library is free software; you can redistribute it and/or modify it under
! * the terms of the GNU Lesser General Public License as published by the Free
! * Software Foundation; either version 2.1 of the License, or (at your option)
! * any later version.
! *
! * This library is distributed in the hope that it will be useful, but WITHOUT
! * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
! * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
! * details.
! *
! * You should have received a copy of the GNU Lesser General Public License
! * along with this library; if not, write to the Free Software Foundation, Inc.,
! * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+
package org.javaowl.editor.remote;
***************
*** 15,18 ****
--- 28,32 ----
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.RDFNode;
+ import com.hp.hpl.jena.ontology.OntClass;
import org.javaowl.editor.ModelEditor;
***************
*** 93,96 ****
--- 107,116 ----
}
+ public String getResourcePropertyValue(String resource, String property, boolean uri) {
+ return editor.getPropertyValue(editor.getResourceEditor(resource),
+ editor.getOntProperty(property),
+ uri);
+ }
+
public String[] getSubClasses(String clazz) {
return getURIsFromResources
***************
*** 99,103 ****
public String getValidLeafClass(String property) {
! return editor.getValidLeafClass(editor.getOntProperty(property)).getURI();
}
--- 119,124 ----
public String getValidLeafClass(String property) {
! OntClass oc = editor.getValidLeafClass(editor.getOntProperty(property));
! return (oc == null) ? null : oc.getURI();
}
|