You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(32) |
Aug
(65) |
Sep
(15) |
Oct
(35) |
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(5) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Elmer G. <ega...@us...> - 2004-08-17 23:46:21
|
Update of /cvsroot/javaowl/JavaOWL/src/org/javaowl/editor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7281/src/org/javaowl/editor Modified Files: ModelEditor.java Log Message: Added remote model editor Index: ModelEditor.java =================================================================== RCS file: /cvsroot/javaowl/JavaOWL/src/org/javaowl/editor/ModelEditor.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** ModelEditor.java 9 Aug 2004 19:40:22 -0000 1.22 --- ModelEditor.java 17 Aug 2004 23:46:02 -0000 1.23 *************** *** 20,25 **** package org.javaowl.editor; - import java.rmi.Remote; - import java.rmi.RemoteException; import java.util.Set; --- 20,23 ---- *************** *** 33,69 **** import com.hp.hpl.jena.rdf.model.Statement; ! public interface ModelEditor extends Remote{ ! public OntResource[] getAllClasses() throws RemoteException; ! public Set getPropertiesURIs(Resource clazz, boolean all) throws RemoteException; ! public OntProperty[] getProperties(Resource clazz, boolean all) throws RemoteException; ! public OntProperty[] getAllDatatypeProperties() throws RemoteException; ! public Resource[] getInstances(OntResource clazz, boolean all) throws RemoteException; ! public OntClass getOntClass(Resource resource) throws RemoteException; ! public OntProperty getOntProperty(Property property) throws RemoteException; ! public Literal getTypedLiteral(Object value, OntResource type) throws RemoteException; ! public void removeStatement(Statement statement) throws RemoteException; ! public void removeResource(Resource resource) throws RemoteException; ! public OntClass[] getSubClasses(OntClass resourceClass) throws RemoteException; ! public ResourceEditorBean createResource(OntResource classResource) throws RemoteException; ! public ResourceEditorBean createResource(String uri, ! OntResource classResource) throws RemoteException; ! public ResourceEditorBean getResource(Resource resource) throws RemoteException; ! public Model getOntology() throws RemoteException; ! public Model getData() throws RemoteException; } --- 31,66 ---- import com.hp.hpl.jena.rdf.model.Statement; ! public interface ModelEditor { ! public OntResource[] getAllClasses(); ! public Set getPropertiesURIs(Resource clazz, boolean all); ! public OntProperty[] getProperties(Resource clazz, boolean all); ! public OntProperty[] getAllDatatypeProperties(); ! public Resource[] getInstances(OntResource clazz, boolean all); ! public OntClass getOntClass(Resource resource); ! public OntProperty getOntProperty(Property property); ! public Literal getTypedLiteral(Object value, OntResource type); ! public void removeStatement(Statement statement); ! public void removeResource(Resource resource); ! public OntClass[] getSubClasses(OntClass resourceClass); ! public ResourceEditorBean createResource(OntResource classResource); ! public ResourceEditorBean createResource(String uri, OntResource classResource); ! public ResourceEditorBean getResource(Resource resource); ! public Model getOntology(); ! public Model getData(); } |
|
From: Elmer G. <ega...@us...> - 2004-08-17 23:46:06
|
Update of /cvsroot/javaowl/JavaOWL/src/org/javaowl/editor/remote In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7261/src/org/javaowl/editor/remote Log Message: Directory /cvsroot/javaowl/JavaOWL/src/org/javaowl/editor/remote added to the repository |
|
From: Elmer G. <ega...@us...> - 2004-08-17 21:35:37
|
Update of /cvsroot/javaowl/JavaOWL/src/org/javaowl/models/prevalence In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1692/src/org/javaowl/models/prevalence Modified Files: TripleUtil.java Log Message: More changes in remote graph. Index: TripleUtil.java =================================================================== RCS file: /cvsroot/javaowl/JavaOWL/src/org/javaowl/models/prevalence/TripleUtil.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TripleUtil.java 11 Aug 2004 02:06:04 -0000 1.2 --- TripleUtil.java 17 Aug 2004 20:18:12 -0000 1.3 *************** *** 100,103 **** --- 100,105 ---- public static String nodeToString(Node node) throws RDFRDBException { + if (node == null) + return null; String res; if (node.isURI()) { *************** *** 134,138 **** } ! public static Node stringToNode(String rdbString) throws RDFRDBException { Node res = null; int len = rdbString.length(); --- 136,142 ---- } ! public static Node stringToNode(String rdbString) throws RDFRDBException { ! if (rdbString == null) ! return null; Node res = null; int len = rdbString.length(); |
|
From: Elmer G. <ega...@us...> - 2004-08-17 20:24:10
|
Update of /cvsroot/javaowl/JavaOWL/src/org/javaowl/models/remote In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1692/src/org/javaowl/models/remote Modified Files: RemoteGraph.java RemoteGraphWrapper.java Added Files: SerializableTriple.java Log Message: More changes in remote graph. Index: RemoteGraphWrapper.java =================================================================== RCS file: /cvsroot/javaowl/JavaOWL/src/org/javaowl/models/remote/RemoteGraphWrapper.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** RemoteGraphWrapper.java 11 Aug 2004 02:06:04 -0000 1.4 --- RemoteGraphWrapper.java 17 Aug 2004 20:18:13 -0000 1.5 *************** *** 22,25 **** --- 22,26 ---- import java.rmi.RemoteException; import java.util.List; + import java.util.ArrayList; import java.util.Iterator; import com.hp.hpl.jena.graph.BulkUpdateHandler; *************** *** 37,41 **** import com.hp.hpl.jena.shared.PrefixMapping; import com.hp.hpl.jena.util.iterator.ExtendedIterator; ! import com.hp.hpl.jena.graph.TripleMatchIterator; import com.hp.hpl.jena.graph.GraphUtil; --- 38,42 ---- import com.hp.hpl.jena.shared.PrefixMapping; import com.hp.hpl.jena.util.iterator.ExtendedIterator; ! import com.hp.hpl.jena.util.iterator.WrappedIterator; import com.hp.hpl.jena.graph.GraphUtil; *************** *** 66,78 **** return contains(triple.getSubject(), triple.getPredicate(), triple.getObject()); } ! public ExtendedIterator find(Node subject, Node predicate, Node object) { try { ! return new TripleMatchIterator(new Triple(subject, predicate, object), ! remote.find(name, ! TripleUtil.nodeToString(subject), ! TripleUtil.nodeToString(predicate), ! TripleUtil.nodeToString(object)). ! iterator()); } catch (RemoteException e) { throw new RuntimeException(e); --- 67,84 ---- return contains(triple.getSubject(), triple.getPredicate(), triple.getObject()); } ! public ExtendedIterator find(Node subject, Node predicate, Node object) { try { ! SerializableTriple[] triples = remote.find(name, ! TripleUtil.nodeToString(subject), ! TripleUtil.nodeToString(predicate), ! TripleUtil.nodeToString(object)); ! List result = new ArrayList(); ! for (int i = 0 ; i < triples.length; i++) { ! result.add(new Triple(TripleUtil.stringToNode(triples[i].getSubject()), ! TripleUtil.stringToNode(triples[i].getPredicate()), ! TripleUtil.stringToNode(triples[i].getObject()))); ! } ! return WrappedIterator.create(result.iterator()); } catch (RemoteException e) { throw new RuntimeException(e); *************** *** 197,205 **** public PrefixMapping getPrefixMapping() { ! throw new UnsupportedOperationException(); } public Reifier getReifier() { ! throw new UnsupportedOperationException(); } --- 203,212 ---- public PrefixMapping getPrefixMapping() { ! return PrefixMapping.Factory.create(); } public Reifier getReifier() { ! return null; ! //throw new UnsupportedOperationException(); } Index: RemoteGraph.java =================================================================== RCS file: /cvsroot/javaowl/JavaOWL/src/org/javaowl/models/remote/RemoteGraph.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RemoteGraph.java 11 Aug 2004 02:06:04 -0000 1.5 --- RemoteGraph.java 17 Aug 2004 20:18:13 -0000 1.6 *************** *** 45,52 **** public void delete(String name, String subject, String predicate, String object) throws RemoteException; ! public List find(String name, String subject, String predicate, String object) ! throws RemoteException; public boolean contains(String name, String subject, String predicate, String object) throws RemoteException; //public boolean dependsOn(String name, String graph) throws RemoteException; --- 45,54 ---- public void delete(String name, String subject, String predicate, String object) throws RemoteException; ! public SerializableTriple[] find(String name, String subject, String predicate, ! String object) throws RemoteException; public boolean contains(String name, String subject, String predicate, String object) throws RemoteException; + public void removeGraph(String name) throws RemoteException; + public void dump(String name) throws RemoteException; //public boolean dependsOn(String name, String graph) throws RemoteException; --- NEW FILE: SerializableTriple.java --- /* * RemoteGraph.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.models.remote; import java.io.Serializable; import com.hp.hpl.jena.graph.Triple; import org.javaowl.models.prevalence.TripleUtil; public class SerializableTriple implements Serializable { private String subject; private String predicate; private String object; public SerializableTriple() {} public SerializableTriple(Triple triple) { subject = TripleUtil.nodeToString(triple.getSubject()); predicate = TripleUtil.nodeToString(triple.getPredicate()); object = TripleUtil.nodeToString(triple.getObject()); } public String getObject() { return object; } public String getPredicate(){ return predicate; } public String getSubject(){ return subject; } public void setObject(String object){ this.object = object; } public void setPredicate(String predicate){ this.predicate = predicate; } public void setSubject(String subject){ this.subject = subject; } } |
|
From: Gerardo H. <ma...@us...> - 2004-08-14 18:40:03
|
Update of /cvsroot/javaowl/reasoner/design In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27294 Modified Files: draft.scm Added Files: ALC-Reasoner.scm Log Message: Added generalized existential quantifier. Index: draft.scm =================================================================== RCS file: /cvsroot/javaowl/reasoner/design/draft.scm,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** draft.scm 8 Aug 2004 05:32:53 -0000 1.8 --- draft.scm 14 Aug 2004 18:39:53 -0000 1.9 *************** *** 64,65 **** --- 64,76 ---- '((Parent Gerardo) (Childless Gerardo))) + + (define tbox7 + '(($= Woman ($intersection Person Female)) + ($= Man ($intersection Person ($complement Female))) + ($= Childless ($allValuesFrom hasChild $BOTTOM)) + ($= Parent ($someValuesFrom hasChild $TOP)))) + + (define abox7 + '((Parent Gerardo) + (Childless Gerardo))) + --- NEW FILE: ALC-Reasoner.scm --- (require 'list-lib) (define (find-definition tbox predicate) (if (null? tbox) #f (if (predicate (car tbox)) (car tbox) (find-definition (cdr tbox) predicate)))) (define (definition? tbox-term) (equal? (first tbox-term) '$=)) (define (concept-definition? tbox-term concept) (and (definition? tbox-term) (equal? (second tbox-term) concept))) (define (get-concept-definition tbox concept) (let ((tbox-term (find-definition tbox (lambda (x) (concept-definition? x concept))))) (if tbox-term (third tbox-term) #f))) (define (replace-concept-definition tbox concept new-definition) (if (null? tbox) () (let ((tbox-term (car tbox)) (tbox-terms (cdr tbox))) (if (concept-definition? tbox-term concept) (cons `($= ,concept ,new-definition) tbox-terms) (cons tbox-term (replace-concept-definition tbox-terms concept new-definition)))))) (define (complement concept) (letrec ((complement-intersection (lambda (concepts) `($union ,@(map (lambda (x) (complement x)) concepts)))) (complement-union (lambda (concepts) `($intersection ,@(map (lambda (x) (complement x)) concepts)))) (complement-allValuesFrom (lambda (role-concept) (let ((role (first role-concept)) (concept (second role-concept))) `($someValuesFrom ,role ,(complement concept))))) (complement-someValuesFrom (lambda (role-concept) (let ((role (first role-concept)) (concept (second role-concept))) `($allValuesFrom ,role ,(complement concept))))) (complement-complement (lambda (concepts) (first concepts)))) (if (symbol? concept) `($complement ,concept) (let ((constr (car concept)) (concepts (cdr concept))) (cond ((eq? constr '$intersection) (complement-intersection concepts)) ((eq? constr '$union) (complement-union concepts)) ((eq? constr '$allValuesFrom) (complement-allValuesFrom concepts)) ((eq? constr '$someValuesFrom) (complement-someValuesFrom concepts)) ((eq? constr '$complement) (complement-complement concepts)) (#t (error "unexpected constructor: " constr))))))) (define (simplify definition) (letrec ((simplify-complement (lambda (concepts) (let ((concept (first concepts))) (if (symbol? concept) `($complement ,concept) (simplify (complement concept)))))) (flatten-intersection (lambda (concepts) (if (null? concepts) () (let ((concept (car concepts)) (other-concepts (cdr concepts))) (if (and (pair? concept) (eq? (first concept) '$intersection)) (append (cdr concept) (flatten-intersection other-concepts)) (cons concept (flatten-intersection other-concepts))))))) (reduce-intersection (lambda (concepts) (cond ((memq '$BOTTOM concepts) '($BOTTOM)) ((null? concepts) ()) (#t (let ((concept (car concepts)) (other-concepts (cdr concepts))) (if (or (eq? concept '$TOP) (member concept other-concepts)) (reduce-intersection other-concepts) (cons concept (reduce-intersection other-concepts)))))))) (check-unary-intersection (lambda (concepts) (if (= (length concepts) 1) (first concepts) `($intersection ,@concepts)))) (simplify-intersection (lambda (concepts) (check-unary-intersection (reduce-intersection (flatten-intersection (map simplify concepts)))))) (flatten-union (lambda (concepts) (if (null? concepts) () (let ((concept (car concepts)) (other-concepts (cdr concepts))) (if (and (pair? concept) (eq? (first concept) '$union)) (append (cdr concept) (flatten-union other-concepts)) (cons concept (flatten-union other-concepts))))))) (reduce-union (lambda (concepts) (cond ((memq '$TOP concepts) '($TOP)) ((null? concepts) ()) (#t (let ((concept (car concepts)) (other-concepts (cdr concepts))) (if (or (eq? concept '$BOTTOM) (member concept other-concepts)) (reduce-union other-concepts) (cons concept (reduce-union other-concepts)))))))) (check-unary-union (lambda (concepts) (if (= (length concepts) 1) (first concepts) `($union ,@concepts)))) (simplify-union (lambda (concepts) (check-unary-union (reduce-union (flatten-union (map simplify concepts)))))) (simplify-allValuesFrom (lambda (concepts) (let ((sarg (simplify (second concepts))) (role (first concepts))) (cond ((and (pair? sarg) (eq? (first sarg) '$intersection)) `($intersection ,@(map (lambda (x) `($allValuesFrom ,role , x)) (cdr sarg)))) ((and (pair? sarg) (eq? (first sarg) '$union)) `($union ,@(map (lambda (x) `($allValuesFrom ,role , x)) (cdr sarg)))) ((eq? sarg '$TOP) '$TOP) (#t `($allValuesFrom ,role ,sarg)))))) (simplify-someValuesFrom (lambda (concepts) (let ((role (first concepts)) (sarg (simplify (second concepts)))) `($someValuesFrom ,role ,sarg))))) (if (symbol? definition) definition (let ((constr (car definition)) (concepts (cdr definition))) (cond ((eq? constr '$intersection) (simplify-intersection concepts)) ((eq? constr '$union) (simplify-union concepts)) ((eq? constr '$allValuesFrom) (simplify-allValuesFrom concepts)) ((eq? constr '$complement) (simplify-complement concepts)) ((eq? constr '$someValuesFrom) (simplify-someValuesFrom concepts)) (#t (error "unexpected constructor: " constr))))))) (define (expand-concept-definition tbox definition) (if (symbol? definition) (let ((expansion (get-concept-definition tbox definition))) (if expansion (expand-concept-definition tbox expansion) definition)) (cons (car definition) (map (lambda (x) (expand-concept-definition tbox x)) (cdr definition))))) (define (expand-tbox tbox) (letrec ((rec-expand-tbox (lambda (tbox exp-tbox) (if (null? tbox) exp-tbox (let ((tbox-term (car tbox)) (tbox-terms (cdr tbox))) (if (definition? tbox-term) (let* ((concept (second tbox-term)) (definition (third tbox-term)) (new-exp-tbox (replace-concept-definition exp-tbox concept (simplify (expand-concept-definition exp-tbox definition))))) (rec-expand-tbox tbox-terms new-exp-tbox)) (cons tbox-term (rec-expand-tbox tbox-terms exp-tbox)))))))) (cons '($= $BOTTOM ($complement $TOP)) (rec-expand-tbox tbox tbox)))) (define (apply-rules abox) (letrec ((apply-intersection (lambda (concepts instance r-abox) (if (null? concepts) r-abox (let* ((concept (car concepts)) (other-concepts (cdr concepts)) (term `(,concept ,instance))) (apply-intersection other-concepts instance (if (member term r-abox) r-abox (apply-rules (cons term r-abox)))))))) (check-allValuesFrom (lambda (instances concept r-abox) (if (null? instances) r-abox (let* ((instance (car instances)) (other-instances (cdr instances)) (term `(,concept ,instance))) (check-allValuesFrom other-instances concept (if (member term r-abox) r-abox (apply-rules (cons term r-abox)))))))) (apply-allValuesFrom (lambda (role-concept instance r-abox) (let ((role (first role-concept)) (concept (second role-concept))) (check-allValuesFrom (map third (filter (lambda (x) (and (equal? role (first x)) (equal? instance (second x)))) r-abox)) concept r-abox)))) (some-values-from? (lambda (instances concept r-abox) (> (length (filter (lambda (x) (member `(,concept ,x) r-abox)) instances)) 0))) (apply-someValuesFrom (lambda (role-concept instance r-abox) (let* ((role (first role-concept)) (concept (second role-concept)) (roles (filter (lambda (x) (and (equal? role (first x)) (equal? instance (second x)))) r-abox))) (if (not (some-values-from? (map third roles) concept r-abox)) (let ((tmp (gentemp))) (apply-rules `((,concept ,tmp) (,role ,instance ,tmp) ,@r-abox))) r-abox)))) (apply-concept (lambda (concept instance r-abox) (if (not (eq? concept '$TOP)) (let ((term `($TOP ,instance))) (if (member term r-abox) r-abox (cons term r-abox))) r-abox))) (rec-apply-rules (lambda (abox r-abox) (if (null? abox) r-abox (let* ((term (car abox)) (concept (first term)) (instance (second term)) (terms (cdr abox))) (cond ((symbol? concept) (if (= (length term) 3) (rec-apply-rules terms r-abox) (rec-apply-rules terms (apply-concept concept instance r-abox)))) ((eq? (car concept) '$intersection) (rec-apply-rules terms (apply-intersection (cdr concept) instance r-abox))) ((eq? (car concept) '$allValuesFrom) (rec-apply-rules terms (apply-allValuesFrom (cdr concept) instance r-abox))) ((eq? (car concept) '$someValuesFrom) (rec-apply-rules terms (apply-someValuesFrom (cdr concept) instance r-abox))) (#t (rec-apply-rules terms (apply-concept concept instance r-abox))))))))) (rec-apply-rules abox abox))) (define (has-contradiction? abox) (letrec ((complement (lambda (t) (let ((concept (first t)) (instance (second t))) (cond ((symbol? concept) `(($complement ,concept) ,instance)) (#t `(,(second concept) ,instance)))))) (base-concept? (lambda (c) (or (symbol? c) (eq? (first c) '$complement))))) (if (null? abox) #f (let ((term (car abox)) (terms (cdr abox))) (if (= (length term) 3) (has-contradiction? terms) (if (and (base-concept? (first term)) (member (complement term) terms)) #t (has-contradiction? terms))))))) (define (consistent? abox) (not (has-contradiction? (apply-rules abox)))) (define (expand-wrt-tbox abox tbox) (letrec ((etbox (expand-tbox tbox)) (rec-expand-wrt-tbox (lambda (abox eabox) (if (null? abox) eabox (let ((term (car abox)) (other-terms (cdr abox))) (if (= (length term) 2) (rec-expand-wrt-tbox other-terms (cons `(,(simplify (expand-concept-definition etbox (first term))) ,(second term)) eabox)) (rec-expand-wrt-tbox other-terms (cons term eabox)))))))) (rec-expand-wrt-tbox abox ()))) (define (consistent-wrt-tbox? abox tbox) (consistent? (expand-wrt-tbox abox tbox))) |
|
From: Elmer G. <ega...@us...> - 2004-08-11 02:06:14
|
Update of /cvsroot/javaowl/JavaOWL/src/org/javaowl/models/remote In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18976/src/org/javaowl/models/remote Modified Files: RemoteGraph.java RemoteGraphWrapper.java Log Message: Changes in remote interface. Index: RemoteGraphWrapper.java =================================================================== RCS file: /cvsroot/javaowl/JavaOWL/src/org/javaowl/models/remote/RemoteGraphWrapper.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RemoteGraphWrapper.java 9 Aug 2004 20:59:52 -0000 1.3 --- RemoteGraphWrapper.java 11 Aug 2004 02:06:04 -0000 1.4 *************** *** 21,25 **** import java.rmi.RemoteException; ! import com.hp.hpl.jena.graph.BulkUpdateHandler; import com.hp.hpl.jena.graph.Capabilities; --- 21,26 ---- import java.rmi.RemoteException; ! import java.util.List; ! import java.util.Iterator; import com.hp.hpl.jena.graph.BulkUpdateHandler; import com.hp.hpl.jena.graph.Capabilities; *************** *** 36,170 **** import com.hp.hpl.jena.shared.PrefixMapping; import com.hp.hpl.jena.util.iterator.ExtendedIterator; ! public class RemoteGraphWrapper implements Graph { ! private RemoteGraph remote; ! public void add(Triple triple) throws AddDeniedException{ ! try { ! remote.add(triple); ! } catch (RemoteException e) { ! throw new AddDeniedException(e.toString()); ! } ! } ! public void close() { ! try { ! remote.close(); ! } catch (RemoteException e) { ! throw new RuntimeException(e); ! } } public boolean contains(Node subject, Node predicate, Node object) { try { ! return remote.contains(subject, predicate, object); } catch (RemoteException e) { throw new RuntimeException(e); } } public boolean contains(Triple triple) { try { ! return remote.contains(triple); } catch (RemoteException e) { throw new RuntimeException(e); } } ! public void delete(Triple triple) throws DeleteDeniedException { ! try { ! remote.delete(triple); ! } catch (RemoteException e) { ! throw new DeleteDeniedException(e.toString()); ! } } ! public boolean dependsOn(Graph graph) { try { ! return remote.dependsOn(graph); } catch (RemoteException e) { throw new RuntimeException(e); } } ! public ExtendedIterator find(Node subject, Node predicate, Node object) { try { ! return remote.find(subject, predicate, object); } catch (RemoteException e) { throw new RuntimeException(e); } } ! public ExtendedIterator find(TripleMatch tripleMatch) { try { ! return remote.find(tripleMatch); } catch (RemoteException e) { throw new RuntimeException(e); } } public BulkUpdateHandler getBulkUpdateHandler() { ! try { ! return remote.getBulkUpdateHandler(); ! } catch (RemoteException e) { ! throw new RuntimeException(e); ! } } ! public Capabilities getCapabilities() { try { ! return remote.getCapabilities(); } catch (RemoteException e) { ! throw new RuntimeException(e); } } ! public GraphEventManager getEventManager() { ! try { ! return remote.getEventManager(); ! } catch (RemoteException e) { ! throw new RuntimeException(e); } } ! public PrefixMapping getPrefixMapping() { ! try { ! return remote.getPrefixMapping(); ! } catch (RemoteException e) { ! throw new RuntimeException(e); ! } } ! public Reifier getReifier() { ! try { ! return remote.getReifier(); ! } catch (RemoteException e) { ! throw new RuntimeException(e); } } ! public TransactionHandler getTransactionHandler() { try { ! return remote.getTransactionHandler(); } catch (RemoteException e) { ! throw new RuntimeException(e); } } ! public boolean isEmpty() { ! try { ! return remote.isEmpty(); ! } catch (RemoteException e) { ! throw new RuntimeException(e); } } public boolean isIsomorphicWith(Graph graph) { ! try { ! return remote.isIsomorphicWith(graph); ! } catch (RemoteException e) { ! throw new RuntimeException(e); ! } } public QueryHandler queryHandler() { ! try { ! return remote.queryHandler(); ! } catch (RemoteException e) { ! throw new RuntimeException(e); ! } ! } ! public int size() { ! try { ! return remote.size(); ! } catch (RemoteException e) { ! throw new RuntimeException(e); ! } } } --- 37,217 ---- import com.hp.hpl.jena.shared.PrefixMapping; import com.hp.hpl.jena.util.iterator.ExtendedIterator; + import com.hp.hpl.jena.graph.TripleMatchIterator; + import com.hp.hpl.jena.graph.GraphUtil; + import org.javaowl.models.prevalence.TripleUtil; ! public class RemoteGraphWrapper implements Graph, BulkUpdateHandler { ! private final RemoteGraph remote; ! private final String name; ! public RemoteGraphWrapper(String name, RemoteGraph remote) { ! this.remote = remote; ! this.name = name; } + public boolean contains(Node subject, Node predicate, Node object) { try { ! return remote.contains(name, ! TripleUtil.nodeToString(subject), ! TripleUtil.nodeToString(predicate), ! TripleUtil.nodeToString(object)); } catch (RemoteException e) { throw new RuntimeException(e); } } + public boolean contains(Triple triple) { + return contains(triple.getSubject(), triple.getPredicate(), triple.getObject()); + } + + public ExtendedIterator find(Node subject, Node predicate, Node object) { try { ! return new TripleMatchIterator(new Triple(subject, predicate, object), ! remote.find(name, ! TripleUtil.nodeToString(subject), ! TripleUtil.nodeToString(predicate), ! TripleUtil.nodeToString(object)). ! iterator()); } catch (RemoteException e) { throw new RuntimeException(e); } } ! ! public ExtendedIterator find(TripleMatch triple) { ! return find(triple.asTriple().getSubject(), ! triple.asTriple().getPredicate(), ! triple.asTriple().getObject()); } ! ! public boolean isEmpty() { try { ! return remote.isEmpty(name); } catch (RemoteException e) { throw new RuntimeException(e); } } ! ! public int size() { try { ! return remote.size(name); } catch (RemoteException e) { throw new RuntimeException(e); } } ! ! public void close() { try { ! remote.close(name); } catch (RemoteException e) { throw new RuntimeException(e); } } + public BulkUpdateHandler getBulkUpdateHandler() { ! return this; } ! ! public void add(Triple triple) throws AddDeniedException{ try { ! remote.add(name, ! TripleUtil.nodeToString(triple.getSubject()), ! TripleUtil.nodeToString(triple.getPredicate()), ! TripleUtil.nodeToString(triple.getObject())); } catch (RemoteException e) { ! throw new AddDeniedException(e.toString()); } } ! ! public void add(Triple[] triples) { ! for (int i = 0; i < triples.length; i++) { ! add(triples[i]); } } ! ! public void add(List triples) { ! add(triples.iterator()); } ! ! public void add(Iterator it) { ! while (it.hasNext()) { ! add((Triple) it.next()); } } ! ! public void add(Graph graph, boolean withReifications) { ! add(GraphUtil.findAll(graph)); ! } ! ! public void add(Graph graph) { ! add(graph, false); ! } ! ! public void delete(Triple triple) throws DeleteDeniedException { try { ! remote.delete(name, ! TripleUtil.nodeToString(triple.getSubject()), ! TripleUtil.nodeToString(triple.getPredicate()), ! TripleUtil.nodeToString(triple.getObject())); } catch (RemoteException e) { ! throw new DeleteDeniedException(e.toString()); } } ! ! public void delete(Triple[] triples) { ! for (int i = 0; i < triples.length; i++) { ! delete(triples[i]); } } + + public void delete(List triples) { + delete(triples.iterator()); + } + + public void delete(Iterator it) { + while (it.hasNext()) { + delete((Triple) it.next()); + } + } + + public void delete(Graph graph) { + delete(graph, false); + } + + public void delete(Graph graph, boolean withReifications) { + delete(GraphUtil.findAll(graph)); + } + + public boolean dependsOn(Graph graph) { + throw new UnsupportedOperationException(); + } + + public Capabilities getCapabilities() { + throw new UnsupportedOperationException(); + } + + public GraphEventManager getEventManager() { + throw new UnsupportedOperationException(); + } + + public PrefixMapping getPrefixMapping() { + throw new UnsupportedOperationException(); + } + + public Reifier getReifier() { + throw new UnsupportedOperationException(); + } + + public TransactionHandler getTransactionHandler() { + throw new UnsupportedOperationException(); + } + public boolean isIsomorphicWith(Graph graph) { ! throw new UnsupportedOperationException(); } + public QueryHandler queryHandler() { ! throw new UnsupportedOperationException(); } } Index: RemoteGraph.java =================================================================== RCS file: /cvsroot/javaowl/JavaOWL/src/org/javaowl/models/remote/RemoteGraph.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** RemoteGraph.java 9 Aug 2004 20:59:52 -0000 1.4 --- RemoteGraph.java 11 Aug 2004 02:06:04 -0000 1.5 *************** *** 23,26 **** --- 23,28 ---- import java.rmi.RemoteException; + import java.util.List; + import com.hp.hpl.jena.graph.BulkUpdateHandler; import com.hp.hpl.jena.graph.Capabilities; *************** *** 37,57 **** public interface RemoteGraph extends Remote { ! public boolean dependsOn(Graph graph) throws RemoteException; ! public QueryHandler queryHandler() throws RemoteException; ! public TransactionHandler getTransactionHandler() throws RemoteException; ! public BulkUpdateHandler getBulkUpdateHandler() throws RemoteException; ! public Capabilities getCapabilities() throws RemoteException; ! public GraphEventManager getEventManager() throws RemoteException; ! public Reifier getReifier() throws RemoteException; ! public PrefixMapping getPrefixMapping() throws RemoteException; ! public void delete(Triple triple) throws RemoteException; ! public ExtendedIterator find(TripleMatch tripleMatch) throws RemoteException; ! public ExtendedIterator find(Node subject, Node predicate, Node object) throws RemoteException; ! public boolean isIsomorphicWith(Graph graph) throws RemoteException; ! public boolean contains(Node subject, Node predicate, Node object) throws RemoteException; ! public boolean contains(Triple triple) throws RemoteException; ! public void close() throws RemoteException; ! public boolean isEmpty() throws RemoteException; ! public int size() throws RemoteException; ! public void add(Triple triple) throws RemoteException; } --- 39,64 ---- public interface RemoteGraph extends Remote { ! ! ! public void add(String name, String subject, String predicate, String object) ! throws RemoteException; ! public void delete(String name, String subject, String predicate, String object) ! throws RemoteException; ! public List find(String name, String subject, String predicate, String object) ! throws RemoteException; ! public boolean contains(String name, String subject, String predicate, String object) ! throws RemoteException; ! ! //public boolean dependsOn(String name, String graph) throws RemoteException; ! //public QueryHandler queryHandler() throws RemoteException; ! //public TransactionHandler getTransactionHandler() throws RemoteException; ! //public BulkUpdateHandler getBulkUpdateHandler() throws RemoteException; ! //public Capabilities getCapabilities() throws RemoteException; ! //public GraphEventManager getEventManager() throws RemoteException; ! //public Reifier getReifier() throws RemoteException; ! //public PrefixMapping getPrefixMapping() throws RemoteException; ! //public boolean isIsomorphicWith(String name, String graph) throws RemoteException; ! public void close(String name) throws RemoteException; ! public boolean isEmpty(String name) throws RemoteException; ! public int size(String name) throws RemoteException; } |
|
From: Elmer G. <ega...@us...> - 2004-08-11 02:06:14
|
Update of /cvsroot/javaowl/JavaOWL/src/org/javaowl/models/prevalence In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18976/src/org/javaowl/models/prevalence Modified Files: PrevalentGraph.java StorageGraph.java TripleUtil.java Log Message: Changes in remote interface. Index: PrevalentGraph.java =================================================================== RCS file: /cvsroot/javaowl/JavaOWL/src/org/javaowl/models/prevalence/PrevalentGraph.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PrevalentGraph.java 28 Jul 2004 16:44:17 -0000 1.4 --- PrevalentGraph.java 11 Aug 2004 02:06:04 -0000 1.5 *************** *** 155,159 **** for (int i = 0; i < triples.length; i++) { add(triples[i]); ! } } --- 155,159 ---- for (int i = 0; i < triples.length; i++) { add(triples[i]); ! } } *************** *** 179,183 **** for (int i = 0; i < triples.length; i++) { delete(triples[i]); ! } } --- 179,183 ---- for (int i = 0; i < triples.length; i++) { delete(triples[i]); ! } } Index: StorageGraph.java =================================================================== RCS file: /cvsroot/javaowl/JavaOWL/src/org/javaowl/models/prevalence/StorageGraph.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** StorageGraph.java 28 Jul 2004 06:54:07 -0000 1.3 --- StorageGraph.java 11 Aug 2004 02:06:04 -0000 1.4 *************** *** 122,126 **** for(int i = 0; i < size; i++) { add(TripleUtil.readTriple(in)); ! } } } --- 122,126 ---- for(int i = 0; i < size; i++) { add(TripleUtil.readTriple(in)); ! } } } Index: TripleUtil.java =================================================================== RCS file: /cvsroot/javaowl/JavaOWL/src/org/javaowl/models/prevalence/TripleUtil.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TripleUtil.java 28 Jul 2004 06:54:07 -0000 1.1 --- TripleUtil.java 11 Aug 2004 02:06:04 -0000 1.2 *************** *** 99,103 **** private static char RDB_CODE_DELIM_CHAR = ':'; ! private static String nodeToString(Node node) throws RDFRDBException { String res; if (node.isURI()) { --- 99,103 ---- private static char RDB_CODE_DELIM_CHAR = ':'; ! public static String nodeToString(Node node) throws RDFRDBException { String res; if (node.isURI()) { *************** *** 134,138 **** } ! private static Node stringToNode(String rdbString) throws RDFRDBException { Node res = null; int len = rdbString.length(); --- 134,138 ---- } ! public static Node stringToNode(String rdbString) throws RDFRDBException { Node res = null; int len = rdbString.length(); |
|
From: Elmer G. <ega...@us...> - 2004-08-09 21:00:02
|
Update of /cvsroot/javaowl/JavaOWL/src/org/javaowl/models/remote In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24166/src/org/javaowl/models/remote Added Files: RemoteGraph.java RemoteGraphWrapper.java Log Message: Readded RemoteGraph. --- NEW FILE: RemoteGraphWrapper.java --- /* * RemoteGraphWrapper.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.models.remote; import java.rmi.RemoteException; import com.hp.hpl.jena.graph.BulkUpdateHandler; import com.hp.hpl.jena.graph.Capabilities; import com.hp.hpl.jena.graph.Graph; import com.hp.hpl.jena.graph.GraphEventManager; import com.hp.hpl.jena.graph.Node; import com.hp.hpl.jena.graph.Reifier; import com.hp.hpl.jena.graph.TransactionHandler; import com.hp.hpl.jena.graph.Triple; import com.hp.hpl.jena.graph.TripleMatch; import com.hp.hpl.jena.graph.query.QueryHandler; import com.hp.hpl.jena.shared.AddDeniedException; import com.hp.hpl.jena.shared.DeleteDeniedException; import com.hp.hpl.jena.shared.PrefixMapping; import com.hp.hpl.jena.util.iterator.ExtendedIterator; public class RemoteGraphWrapper implements Graph { private RemoteGraph remote; public void add(Triple triple) throws AddDeniedException{ try { remote.add(triple); } catch (RemoteException e) { throw new AddDeniedException(e.toString()); } } public void close() { try { remote.close(); } catch (RemoteException e) { throw new RuntimeException(e); } } public boolean contains(Node subject, Node predicate, Node object) { try { return remote.contains(subject, predicate, object); } catch (RemoteException e) { throw new RuntimeException(e); } } public boolean contains(Triple triple) { try { return remote.contains(triple); } catch (RemoteException e) { throw new RuntimeException(e); } } public void delete(Triple triple) throws DeleteDeniedException { try { remote.delete(triple); } catch (RemoteException e) { throw new DeleteDeniedException(e.toString()); } } public boolean dependsOn(Graph graph) { try { return remote.dependsOn(graph); } catch (RemoteException e) { throw new RuntimeException(e); } } public ExtendedIterator find(Node subject, Node predicate, Node object) { try { return remote.find(subject, predicate, object); } catch (RemoteException e) { throw new RuntimeException(e); } } public ExtendedIterator find(TripleMatch tripleMatch) { try { return remote.find(tripleMatch); } catch (RemoteException e) { throw new RuntimeException(e); } } public BulkUpdateHandler getBulkUpdateHandler() { try { return remote.getBulkUpdateHandler(); } catch (RemoteException e) { throw new RuntimeException(e); } } public Capabilities getCapabilities() { try { return remote.getCapabilities(); } catch (RemoteException e) { throw new RuntimeException(e); } } public GraphEventManager getEventManager() { try { return remote.getEventManager(); } catch (RemoteException e) { throw new RuntimeException(e); } } public PrefixMapping getPrefixMapping() { try { return remote.getPrefixMapping(); } catch (RemoteException e) { throw new RuntimeException(e); } } public Reifier getReifier() { try { return remote.getReifier(); } catch (RemoteException e) { throw new RuntimeException(e); } } public TransactionHandler getTransactionHandler() { try { return remote.getTransactionHandler(); } catch (RemoteException e) { throw new RuntimeException(e); } } public boolean isEmpty() { try { return remote.isEmpty(); } catch (RemoteException e) { throw new RuntimeException(e); } } public boolean isIsomorphicWith(Graph graph) { try { return remote.isIsomorphicWith(graph); } catch (RemoteException e) { throw new RuntimeException(e); } } public QueryHandler queryHandler() { try { return remote.queryHandler(); } catch (RemoteException e) { throw new RuntimeException(e); } } public int size() { try { return remote.size(); } catch (RemoteException e) { throw new RuntimeException(e); } } } --- NEW FILE: RemoteGraph.java --- /* * RemoteGraph.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.models.remote; import java.rmi.Remote; import java.rmi.RemoteException; import com.hp.hpl.jena.graph.BulkUpdateHandler; import com.hp.hpl.jena.graph.Capabilities; import com.hp.hpl.jena.graph.Graph; import com.hp.hpl.jena.graph.GraphEventManager; import com.hp.hpl.jena.graph.Node; import com.hp.hpl.jena.graph.Reifier; import com.hp.hpl.jena.graph.TransactionHandler; import com.hp.hpl.jena.graph.Triple; import com.hp.hpl.jena.graph.TripleMatch; import com.hp.hpl.jena.graph.query.QueryHandler; import com.hp.hpl.jena.shared.PrefixMapping; import com.hp.hpl.jena.util.iterator.ExtendedIterator; public interface RemoteGraph extends Remote { public boolean dependsOn(Graph graph) throws RemoteException; public QueryHandler queryHandler() throws RemoteException; public TransactionHandler getTransactionHandler() throws RemoteException; public BulkUpdateHandler getBulkUpdateHandler() throws RemoteException; public Capabilities getCapabilities() throws RemoteException; public GraphEventManager getEventManager() throws RemoteException; public Reifier getReifier() throws RemoteException; public PrefixMapping getPrefixMapping() throws RemoteException; public void delete(Triple triple) throws RemoteException; public ExtendedIterator find(TripleMatch tripleMatch) throws RemoteException; public ExtendedIterator find(Node subject, Node predicate, Node object) throws RemoteException; public boolean isIsomorphicWith(Graph graph) throws RemoteException; public boolean contains(Node subject, Node predicate, Node object) throws RemoteException; public boolean contains(Triple triple) throws RemoteException; public void close() throws RemoteException; public boolean isEmpty() throws RemoteException; public int size() throws RemoteException; public void add(Triple triple) throws RemoteException; } |
|
From: Elmer G. <ega...@us...> - 2004-08-09 20:54:11
|
Update of /cvsroot/javaowl/JavaOWL/src/org/javaowl/models/remote In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22848/src/org/javaowl/models/remote Removed Files: RemoteGraphWrapper.java RemoteGraph.java Log Message: . --- RemoteGraphWrapper.java DELETED --- --- RemoteGraph.java DELETED --- |
|
From: Elmer G. <ega...@us...> - 2004-08-09 19:40:31
|
Update of /cvsroot/javaowl/JavaOWL/src/org/javaowl/editor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8329/src/org/javaowl/editor Modified Files: ModelEditor.java Log Message: Removes extra ; Index: ModelEditor.java =================================================================== RCS file: /cvsroot/javaowl/JavaOWL/src/org/javaowl/editor/ModelEditor.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** ModelEditor.java 9 Aug 2004 19:07:31 -0000 1.21 --- ModelEditor.java 9 Aug 2004 19:40:22 -0000 1.22 *************** *** 35,69 **** public interface ModelEditor extends Remote{ ! public OntResource[] getAllClasses() throws RemoteException;; ! public Set getPropertiesURIs(Resource clazz, boolean all) throws RemoteException;; ! public OntProperty[] getProperties(Resource clazz, boolean all) throws RemoteException;; ! public OntProperty[] getAllDatatypeProperties() throws RemoteException;; ! public Resource[] getInstances(OntResource clazz, boolean all) throws RemoteException;; ! public OntClass getOntClass(Resource resource) throws RemoteException;; ! public OntProperty getOntProperty(Property property) throws RemoteException;; ! public Literal getTypedLiteral(Object value, OntResource type) throws RemoteException;; ! public void removeStatement(Statement statement) throws RemoteException;; ! public void removeResource(Resource resource) throws RemoteException;; ! public OntClass[] getSubClasses(OntClass resourceClass) throws RemoteException;; ! public ResourceEditorBean createResource(OntResource classResource) throws RemoteException;; public ResourceEditorBean createResource(String uri, OntResource classResource) throws RemoteException; ! public ResourceEditorBean getResource(Resource resource) throws RemoteException;; ! public Model getOntology() throws RemoteException;; ! public Model getData() throws RemoteException;; ! } \ No newline at end of file --- 35,69 ---- public interface ModelEditor extends Remote{ ! public OntResource[] getAllClasses() throws RemoteException; ! public Set getPropertiesURIs(Resource clazz, boolean all) throws RemoteException; ! public OntProperty[] getProperties(Resource clazz, boolean all) throws RemoteException; ! public OntProperty[] getAllDatatypeProperties() throws RemoteException; ! public Resource[] getInstances(OntResource clazz, boolean all) throws RemoteException; ! public OntClass getOntClass(Resource resource) throws RemoteException; ! public OntProperty getOntProperty(Property property) throws RemoteException; ! public Literal getTypedLiteral(Object value, OntResource type) throws RemoteException; ! public void removeStatement(Statement statement) throws RemoteException; ! public void removeResource(Resource resource) throws RemoteException; ! public OntClass[] getSubClasses(OntClass resourceClass) throws RemoteException; ! public ResourceEditorBean createResource(OntResource classResource) throws RemoteException; public ResourceEditorBean createResource(String uri, OntResource classResource) throws RemoteException; ! public ResourceEditorBean getResource(Resource resource) throws RemoteException; ! public Model getOntology() throws RemoteException; ! public Model getData() throws RemoteException; ! } |
|
From: Elmer G. <ega...@us...> - 2004-08-09 19:07:42
|
Update of /cvsroot/javaowl/JavaOWL/src/org/javaowl/editor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2509/src/org/javaowl/editor Modified Files: ModelEditorBean.java Added Files: ModelEditor.java Log Message: Added Interface ModelEditor Index: ModelEditorBean.java =================================================================== RCS file: /cvsroot/javaowl/JavaOWL/src/org/javaowl/editor/ModelEditorBean.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ModelEditorBean.java 28 Jul 2004 07:17:03 -0000 1.9 --- ModelEditorBean.java 9 Aug 2004 19:07:31 -0000 1.10 *************** *** 46,50 **** import com.hp.hpl.jena.vocabulary.RDF; ! public class ModelEditorBean { private final OntModel ontModel; --- 46,50 ---- import com.hp.hpl.jena.vocabulary.RDF; ! public class ModelEditorBean implements ModelEditor { private final OntModel ontModel; --- NEW FILE: ModelEditor.java --- /* * ModelEditor.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; import java.rmi.Remote; import java.rmi.RemoteException; import java.util.Set; import com.hp.hpl.jena.ontology.OntClass; import com.hp.hpl.jena.ontology.OntProperty; import com.hp.hpl.jena.ontology.OntResource; import com.hp.hpl.jena.rdf.model.Literal; import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.Property; import com.hp.hpl.jena.rdf.model.Resource; import com.hp.hpl.jena.rdf.model.Statement; public interface ModelEditor extends Remote{ public OntResource[] getAllClasses() throws RemoteException;; public Set getPropertiesURIs(Resource clazz, boolean all) throws RemoteException;; public OntProperty[] getProperties(Resource clazz, boolean all) throws RemoteException;; public OntProperty[] getAllDatatypeProperties() throws RemoteException;; public Resource[] getInstances(OntResource clazz, boolean all) throws RemoteException;; public OntClass getOntClass(Resource resource) throws RemoteException;; public OntProperty getOntProperty(Property property) throws RemoteException;; public Literal getTypedLiteral(Object value, OntResource type) throws RemoteException;; public void removeStatement(Statement statement) throws RemoteException;; public void removeResource(Resource resource) throws RemoteException;; public OntClass[] getSubClasses(OntClass resourceClass) throws RemoteException;; public ResourceEditorBean createResource(OntResource classResource) throws RemoteException;; public ResourceEditorBean createResource(String uri, OntResource classResource) throws RemoteException; public ResourceEditorBean getResource(Resource resource) throws RemoteException;; public Model getOntology() throws RemoteException;; public Model getData() throws RemoteException;; } |
|
From: Elmer G. <ega...@us...> - 2004-08-09 18:30:08
|
Update of /cvsroot/javaowl/reasoner/design In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25198 Modified Files: AL-Reasoner.scm Log Message: Fixed apply-concept was adding ($TOP instance) each time. Index: AL-Reasoner.scm =================================================================== RCS file: /cvsroot/javaowl/reasoner/design/AL-Reasoner.scm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AL-Reasoner.scm 7 Aug 2004 04:06:31 -0000 1.1 --- AL-Reasoner.scm 9 Aug 2004 18:29:58 -0000 1.2 *************** *** 162,166 **** (lambda (concept instance r-abox) (if (not (eq? concept '$TOP)) ! (cons `($TOP ,instance) r-abox) r-abox))) --- 162,169 ---- (lambda (concept instance r-abox) (if (not (eq? concept '$TOP)) ! (let ((term `($TOP ,instance))) ! (if (member term r-abox) ! r-abox ! (cons term r-abox))) r-abox))) |
|
From: Gerardo H. <ma...@us...> - 2004-08-08 05:33:01
|
Update of /cvsroot/javaowl/reasoner/design In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21978 Modified Files: draft.scm Log Message: Fixed draft.scm Index: draft.scm =================================================================== RCS file: /cvsroot/javaowl/reasoner/design/draft.scm,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** draft.scm 7 Aug 2004 04:06:31 -0000 1.7 --- draft.scm 8 Aug 2004 05:32:53 -0000 1.8 *************** *** 64,67 **** '((Parent Gerardo) (Childless Gerardo))) - - --- 64,65 ---- |
|
From: Gerardo H. <ma...@us...> - 2004-08-07 04:06:40
|
Update of /cvsroot/javaowl/reasoner/design In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11171 Modified Files: draft.scm reasoner.scm Added Files: AL-Reasoner.scm Log Message: Working AL reasoner. Index: draft.scm =================================================================== RCS file: /cvsroot/javaowl/reasoner/design/draft.scm,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** draft.scm 7 Aug 2004 03:18:00 -0000 1.6 --- draft.scm 7 Aug 2004 04:06:31 -0000 1.7 *************** *** 7,10 **** --- 7,11 ---- ;($= C ($allValuesFrom R D)) ;($= C ($someValuesFrom R D)) + ;($= C ($someValue R)) ;($<= C D) ;(R a b) *************** *** 54,55 **** --- 55,67 ---- (Childless Gerardo))) + (define tbox6 + '(($= Woman ($intersection Person Female)) + ($= Man ($intersection Person ($complement Female))) + ($= Childless ($allValuesFrom hasChild $BOTTOM)) + ($= Parent ($someValue hasChild)))) + + (define abox6 + '((Parent Gerardo) + (Childless Gerardo))) + + Index: reasoner.scm =================================================================== RCS file: /cvsroot/javaowl/reasoner/design/reasoner.scm,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** reasoner.scm 7 Aug 2004 03:18:00 -0000 1.4 --- reasoner.scm 7 Aug 2004 04:06:31 -0000 1.5 *************** *** 75,79 **** `($intersection ,@(map (lambda (x) `($allValuesFrom ,role , x)) (cdr sarg)))) ((eq? sarg '$TOP) '$TOP) ! (#t `($allValuesFrom ,role ,sarg))))))) (if (symbol? definition) --- 75,83 ---- `($intersection ,@(map (lambda (x) `($allValuesFrom ,role , x)) (cdr sarg)))) ((eq? sarg '$TOP) '$TOP) ! (#t `($allValuesFrom ,role ,sarg)))))) ! ! (simplify-someValue ! (lambda (role) ! `($someValue ,@role)))) (if (symbol? definition) *************** *** 84,87 **** --- 88,92 ---- ((eq? constr '$allValuesFrom) (simplify-allValuesFrom concepts)) ((eq? constr '$complement) (simplify-complement concepts)) + ((eq? constr '$someValue) (simplify-someValue concepts)) (#t (error "unexpected constructor: " constr))))))) *************** *** 144,147 **** --- 149,161 ---- (equal? instance (second x)))) r-abox)) concept r-abox)))) + + (apply-someValue + (lambda (role instance r-abox) + (let ((roles (filter (lambda (x) (and (equal? role (first x)) + (equal? instance (second x)))) r-abox))) + (if (= (length roles) 0) + (let ((tmp (gentemp))) + (apply-rules `(($TOP ,tmp) (,role ,instance ,tmp) ,@r-abox))) + r-abox)))) (apply-concept *************** *** 167,170 **** --- 181,186 ---- ((eq? (car concept) '$allValuesFrom) (rec-apply-rules terms (apply-allValuesFrom (cdr concept) instance r-abox))) + ((eq? (car concept) '$someValue) + (rec-apply-rules terms (apply-someValue (second concept) instance r-abox))) (#t (rec-apply-rules terms (apply-concept concept instance r-abox))))))))) (rec-apply-rules abox abox))) --- NEW FILE: AL-Reasoner.scm --- (require 'list-lib) (define (find-definition tbox predicate) (if (null? tbox) #f (if (predicate (car tbox)) (car tbox) (find-definition (cdr tbox) predicate)))) (define (definition? tbox-term) (equal? (first tbox-term) '$=)) (define (concept-definition? tbox-term concept) (and (definition? tbox-term) (equal? (second tbox-term) concept))) (define (get-concept-definition tbox concept) (let ((tbox-term (find-definition tbox (lambda (x) (concept-definition? x concept))))) (if tbox-term (third tbox-term) #f))) (define (replace-concept-definition tbox concept new-definition) (if (null? tbox) () (let ((tbox-term (car tbox)) (tbox-terms (cdr tbox))) (if (concept-definition? tbox-term concept) (cons `($= ,concept ,new-definition) tbox-terms) (cons tbox-term (replace-concept-definition tbox-terms concept new-definition)))))) (define (simplify definition) (letrec ((simplify-complement (lambda (concepts) `($complement ,@concepts))) (flatten-intersection (lambda (concepts) (if (null? concepts) () (let ((concept (car concepts)) (other-concepts (cdr concepts))) (if (and (pair? concept) (eq? (first concept) '$intersection)) (append (cdr concept) (flatten-intersection other-concepts)) (cons concept (flatten-intersection other-concepts))))))) (reduce-intersection (lambda (concepts) (cond ((memq '$BOTTOM concepts) '($BOTTOM)) ((null? concepts) ()) (#t (let ((concept (car concepts)) (other-concepts (cdr concepts))) (if (or (eq? concept '$TOP) (member concept other-concepts)) (reduce-intersection other-concepts) (cons concept (reduce-intersection other-concepts)))))))) (check-unary (lambda (concepts) (if (= (length concepts) 1) (first concepts) `($intersection ,@concepts)))) (simplify-intersection (lambda (concepts) (check-unary (reduce-intersection (flatten-intersection (map simplify concepts)))))) (simplify-allValuesFrom (lambda (concepts) (let ((sarg (simplify (second concepts))) (role (first concepts))) (cond ((and (pair? sarg) (eq? (first sarg) '$intersection)) `($intersection ,@(map (lambda (x) `($allValuesFrom ,role , x)) (cdr sarg)))) ((eq? sarg '$TOP) '$TOP) (#t `($allValuesFrom ,role ,sarg)))))) (simplify-someValue (lambda (role) `($someValue ,@role)))) (if (symbol? definition) definition (let ((constr (car definition)) (concepts (cdr definition))) (cond ((eq? constr '$intersection) (simplify-intersection concepts)) ((eq? constr '$allValuesFrom) (simplify-allValuesFrom concepts)) ((eq? constr '$complement) (simplify-complement concepts)) ((eq? constr '$someValue) (simplify-someValue concepts)) (#t (error "unexpected constructor: " constr))))))) (define (expand-concept-definition tbox definition) (if (symbol? definition) (let ((expansion (get-concept-definition tbox definition))) (if expansion (expand-concept-definition tbox expansion) definition)) (cons (car definition) (map (lambda (x) (expand-concept-definition tbox x)) (cdr definition))))) (define (expand-tbox tbox) (letrec ((rec-expand-tbox (lambda (tbox exp-tbox) (if (null? tbox) exp-tbox (let ((tbox-term (car tbox)) (tbox-terms (cdr tbox))) (if (definition? tbox-term) (let* ((concept (second tbox-term)) (definition (third tbox-term)) (new-exp-tbox (replace-concept-definition exp-tbox concept (simplify (expand-concept-definition exp-tbox definition))))) (rec-expand-tbox tbox-terms new-exp-tbox)) (cons tbox-term (rec-expand-tbox tbox-terms exp-tbox)))))))) (cons '($= $BOTTOM ($complement $TOP)) (rec-expand-tbox tbox tbox)))) (define (apply-rules abox) (letrec ((apply-intersection (lambda (concepts instance r-abox) (if (null? concepts) r-abox (let* ((concept (car concepts)) (other-concepts (cdr concepts)) (term `(,concept ,instance))) (apply-intersection other-concepts instance (if (member term r-abox) r-abox (apply-rules (cons term r-abox)))))))) (check-allValuesFrom (lambda (instances concept r-abox) (if (null? instances) r-abox (let* ((instance (car instances)) (other-instances (cdr instances)) (term `(,concept ,instance))) (check-allValuesFrom other-instances concept (if (member term r-abox) r-abox (apply-rules (cons term r-abox)))))))) (apply-allValuesFrom (lambda (role-concept instance r-abox) (let ((role (first role-concept)) (concept (second role-concept))) (check-allValuesFrom (map third (filter (lambda (x) (and (equal? role (first x)) (equal? instance (second x)))) r-abox)) concept r-abox)))) (apply-someValue (lambda (role instance r-abox) (let ((roles (filter (lambda (x) (and (equal? role (first x)) (equal? instance (second x)))) r-abox))) (if (= (length roles) 0) (let ((tmp (gentemp))) (apply-rules `(($TOP ,tmp) (,role ,instance ,tmp) ,@r-abox))) r-abox)))) (apply-concept (lambda (concept instance r-abox) (if (not (eq? concept '$TOP)) (cons `($TOP ,instance) r-abox) r-abox))) (rec-apply-rules (lambda (abox r-abox) (if (null? abox) r-abox (let* ((term (car abox)) (concept (first term)) (instance (second term)) (terms (cdr abox))) (cond ((symbol? concept) (if (= (length term) 3) (rec-apply-rules terms r-abox) (rec-apply-rules terms (apply-concept concept instance r-abox)))) ((eq? (car concept) '$intersection) (rec-apply-rules terms (apply-intersection (cdr concept) instance r-abox))) ((eq? (car concept) '$allValuesFrom) (rec-apply-rules terms (apply-allValuesFrom (cdr concept) instance r-abox))) ((eq? (car concept) '$someValue) (rec-apply-rules terms (apply-someValue (second concept) instance r-abox))) (#t (rec-apply-rules terms (apply-concept concept instance r-abox))))))))) (rec-apply-rules abox abox))) (define (has-contradiction? abox) (letrec ((complement (lambda (t) (let ((concept (first t)) (instance (second t))) (cond ((symbol? concept) `(($complement ,concept) ,instance)) (#t `(,(second concept) ,instance)))))) (base-concept? (lambda (c) (or (symbol? c) (eq? (first c) '$complement))))) (if (null? abox) #f (let ((term (car abox)) (terms (cdr abox))) (if (= (length term) 3) (has-contradiction? terms) (if (and (base-concept? (first term)) (member (complement term) terms)) #t (has-contradiction? terms))))))) (define (consistent? abox) (not (has-contradiction? (apply-rules abox)))) (define (expand-wrt-tbox abox tbox) (letrec ((etbox (expand-tbox tbox)) (rec-expand-wrt-tbox (lambda (abox eabox) (if (null? abox) eabox (let ((term (car abox)) (other-terms (cdr abox))) (if (= (length term) 2) (rec-expand-wrt-tbox other-terms (cons `(,(simplify (expand-concept-definition etbox (first term))) ,(second term)) eabox)) (rec-expand-wrt-tbox other-terms (cons term eabox)))))))) (rec-expand-wrt-tbox abox ()))) (define (consistent-wrt-tbox? abox tbox) (consistent? (expand-wrt-tbox abox tbox))) |
|
From: Gerardo H. <ma...@us...> - 2004-08-07 03:18:10
|
Update of /cvsroot/javaowl/reasoner/design In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3775 Modified Files: draft.scm reasoner.scm Log Message: Added knowledge about $TOP and $BOTTOM. Index: draft.scm =================================================================== RCS file: /cvsroot/javaowl/reasoner/design/draft.scm,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** draft.scm 7 Aug 2004 02:24:49 -0000 1.5 --- draft.scm 7 Aug 2004 03:18:00 -0000 1.6 *************** *** 20,29 **** ($= Grandmother ($intersection Mother ($someValuesFrom hasChild Parent))))) - (define tbox2 - '(($= Woman ($intersection Person Female)) - ($= Man ($intersection Person Male)) - ($= Mother ($intersection Woman ($allValuesFrom hasChild Person))) - ($= Father ($intersection Man ($allValuesFrom hasChild Person))))) - (define tbox3 '(($= Woman ($intersection Person Female)) --- 20,23 ---- *************** *** 33,52 **** ($= Test2 ($allValuesFrom hasChild $TOP)))) - (define tbox4 - '(($= Woman ($intersection Person Female)) - ($= Man ($intersection Person ($complement Female))) - ($= OnlySons ($allValuesFrom hasChild Man)))) - - ;(Woman x) - ;(Man y) - ;(Undefined z) - - (define abox1 - '((($intersection Person Female) x) - (($intersection Person ($complement Female)) y) - ; (($intersection Person Female ($complement Female)) z) - (($allValuesFrom hasChild Person) a) - (hasChild a b))) - (define abox3 '((Woman x) --- 27,30 ---- *************** *** 55,58 **** --- 33,41 ---- )) + (define tbox4 + '(($= Woman ($intersection Person Female)) + ($= Man ($intersection Person ($complement Female))) + ($= OnlySons ($allValuesFrom hasChild Man)))) + (define abox4 '((hasChild Gerardo David) *************** *** 60,62 **** (Man David) (Man Daniel) ! (OnlySons Gerardo))) \ No newline at end of file --- 43,55 ---- (Man David) (Man Daniel) ! (OnlySons Gerardo))) ! ! (define tbox5 ! '(($= Woman ($intersection Person Female)) ! ($= Man ($intersection Person ($complement Female))) ! ($= Childless ($allValuesFrom hasChild $BOTTOM)))) ! ! (define abox5 ! '((hasChild Gerardo David) ! (Childless Gerardo))) ! Index: reasoner.scm =================================================================== RCS file: /cvsroot/javaowl/reasoner/design/reasoner.scm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** reasoner.scm 7 Aug 2004 02:24:49 -0000 1.3 --- reasoner.scm 7 Aug 2004 03:18:00 -0000 1.4 *************** *** 112,116 **** (rec-expand-tbox tbox-terms new-exp-tbox)) (cons tbox-term (rec-expand-tbox tbox-terms exp-tbox)))))))) ! (rec-expand-tbox tbox tbox))) (define (apply-rules abox) --- 112,116 ---- (rec-expand-tbox tbox-terms new-exp-tbox)) (cons tbox-term (rec-expand-tbox tbox-terms exp-tbox)))))))) ! (cons '($= $BOTTOM ($complement $TOP)) (rec-expand-tbox tbox tbox)))) (define (apply-rules abox) *************** *** 135,139 **** (check-allValuesFrom other-instances concept (if (member term r-abox) r-abox ! (cons term r-abox))))))) (apply-allValuesFrom --- 135,139 ---- (check-allValuesFrom other-instances concept (if (member term r-abox) r-abox ! (apply-rules (cons term r-abox)))))))) (apply-allValuesFrom *************** *** 144,147 **** --- 144,153 ---- (equal? instance (second x)))) r-abox)) concept r-abox)))) + + (apply-concept + (lambda (concept instance r-abox) + (if (not (eq? concept '$TOP)) + (cons `($TOP ,instance) r-abox) + r-abox))) (rec-apply-rules *************** *** 153,162 **** (instance (second term)) (terms (cdr abox))) ! (cond ((symbol? concept) (rec-apply-rules terms r-abox)) ((eq? (car concept) '$intersection) (rec-apply-rules terms (apply-intersection (cdr concept) instance r-abox))) ((eq? (car concept) '$allValuesFrom) (rec-apply-rules terms (apply-allValuesFrom (cdr concept) instance r-abox))) ! (#t (rec-apply-rules terms r-abox)))))))) (rec-apply-rules abox abox))) --- 159,171 ---- (instance (second term)) (terms (cdr abox))) ! (cond ((symbol? concept) ! (if (= (length term) 3) ! (rec-apply-rules terms r-abox) ! (rec-apply-rules terms (apply-concept concept instance r-abox)))) ((eq? (car concept) '$intersection) (rec-apply-rules terms (apply-intersection (cdr concept) instance r-abox))) ((eq? (car concept) '$allValuesFrom) (rec-apply-rules terms (apply-allValuesFrom (cdr concept) instance r-abox))) ! (#t (rec-apply-rules terms (apply-concept concept instance r-abox))))))))) (rec-apply-rules abox abox))) |
|
From: Gerardo H. <ma...@us...> - 2004-08-07 02:24:58
|
Update of /cvsroot/javaowl/reasoner/design In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29684 Modified Files: draft.scm reasoner.scm Log Message: Now it really works... Index: draft.scm =================================================================== RCS file: /cvsroot/javaowl/reasoner/design/draft.scm,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** draft.scm 7 Aug 2004 01:41:57 -0000 1.4 --- draft.scm 7 Aug 2004 02:24:49 -0000 1.5 *************** *** 33,36 **** --- 33,41 ---- ($= Test2 ($allValuesFrom hasChild $TOP)))) + (define tbox4 + '(($= Woman ($intersection Person Female)) + ($= Man ($intersection Person ($complement Female))) + ($= OnlySons ($allValuesFrom hasChild Man)))) + ;(Woman x) ;(Man y) *************** *** 44,50 **** (hasChild a b))) ! (define abox2 '((Woman x) (Man y) ;(Undefined z) ! )) \ No newline at end of file --- 49,62 ---- (hasChild a b))) ! (define abox3 '((Woman x) (Man y) ;(Undefined z) ! )) ! ! (define abox4 ! '((hasChild Gerardo David) ! (hasChild Gerardo Daniel) ! (Man David) ! (Man Daniel) ! (OnlySons Gerardo))) \ No newline at end of file Index: reasoner.scm =================================================================== RCS file: /cvsroot/javaowl/reasoner/design/reasoner.scm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** reasoner.scm 7 Aug 2004 01:41:57 -0000 1.2 --- reasoner.scm 7 Aug 2004 02:24:49 -0000 1.3 *************** *** 125,129 **** (apply-intersection other-concepts instance (if (member term r-abox) r-abox ! (cons term r-abox))))))) (check-allValuesFrom (lambda (instances concept r-abox) --- 125,129 ---- (apply-intersection other-concepts instance (if (member term r-abox) r-abox ! (apply-rules (cons term r-abox)))))))) (check-allValuesFrom (lambda (instances concept r-abox) *************** *** 142,146 **** (concept (second role-concept))) (check-allValuesFrom (map third (filter (lambda (x) (and (equal? role (first x)) ! (eq? instance (second x)))) r-abox)) concept r-abox)))) --- 142,146 ---- (concept (second role-concept))) (check-allValuesFrom (map third (filter (lambda (x) (and (equal? role (first x)) ! (equal? instance (second x)))) r-abox)) concept r-abox)))) |
|
From: Gerardo H. <ma...@us...> - 2004-08-07 01:42:06
|
Update of /cvsroot/javaowl/reasoner/design In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24912 Modified Files: draft.scm reasoner.scm Log Message: First working reasoner! Index: draft.scm =================================================================== RCS file: /cvsroot/javaowl/reasoner/design/draft.scm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** draft.scm 7 Aug 2004 00:50:19 -0000 1.3 --- draft.scm 7 Aug 2004 01:41:57 -0000 1.4 *************** *** 40,57 **** '((($intersection Person Female) x) (($intersection Person ($complement Female)) y) ! (($intersection Person Female ($complement Female)) z) (($allValuesFrom hasChild Person) a) (hasChild a b))) ! ;(($intersection Person Female) x) ! ;(Person x) ! ;(Female x) ! ;(($intersection Person ($complement Female)) y) ! ;(Person y) ! ;(($complement Female) y) ! ;(($intersection Person Female ($complement Female)) z) ! ;(Person z) ! ;(Female z) ! ;(($complement Female) z) ! ! --- 40,50 ---- '((($intersection Person Female) x) (($intersection Person ($complement Female)) y) ! ; (($intersection Person Female ($complement Female)) z) (($allValuesFrom hasChild Person) a) (hasChild a b))) ! (define abox2 ! '((Woman x) ! (Man y) ! ;(Undefined z) ! )) \ No newline at end of file Index: reasoner.scm =================================================================== RCS file: /cvsroot/javaowl/reasoner/design/reasoner.scm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** reasoner.scm 7 Aug 2004 00:24:06 -0000 1.1 --- reasoner.scm 7 Aug 2004 01:41:57 -0000 1.2 *************** *** 161,164 **** (rec-apply-rules abox abox))) (define (consistent? abox) ! (not (has-contradiction? (apply-rules abox)))) \ No newline at end of file --- 161,210 ---- (rec-apply-rules abox abox))) + (define (has-contradiction? abox) + (letrec + ((complement + (lambda (t) + (let ((concept (first t)) + (instance (second t))) + (cond ((symbol? concept) `(($complement ,concept) ,instance)) + (#t `(,(second concept) ,instance)))))) + (base-concept? + (lambda (c) + (or (symbol? c) + (eq? (first c) '$complement))))) + + (if (null? abox) + #f + (let ((term (car abox)) + (terms (cdr abox))) + (if (= (length term) 3) + (has-contradiction? terms) + (if (and (base-concept? (first term)) + (member (complement term) terms)) + #t + (has-contradiction? terms))))))) + (define (consistent? abox) ! (not (has-contradiction? (apply-rules abox)))) ! ! (define (expand-wrt-tbox abox tbox) ! (letrec ! ((etbox (expand-tbox tbox)) ! ! (rec-expand-wrt-tbox ! (lambda (abox eabox) ! (if (null? abox) ! eabox ! (let ((term (car abox)) ! (other-terms (cdr abox))) ! (if (= (length term) 2) ! (rec-expand-wrt-tbox other-terms ! (cons `(,(simplify (expand-concept-definition etbox (first term))) ! ,(second term)) ! eabox)) ! (rec-expand-wrt-tbox other-terms (cons term eabox)))))))) ! ! (rec-expand-wrt-tbox abox ()))) ! ! (define (consistent-wrt-tbox? abox tbox) ! (consistent? (expand-wrt-tbox abox tbox))) \ No newline at end of file |
|
From: Gerardo H. <ma...@us...> - 2004-08-07 00:50:30
|
Update of /cvsroot/javaowl/reasoner/design In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17171 Modified Files: draft.scm Log Message: Fixed. Index: draft.scm =================================================================== RCS file: /cvsroot/javaowl/reasoner/design/draft.scm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** draft.scm 7 Aug 2004 00:24:06 -0000 1.2 --- draft.scm 7 Aug 2004 00:50:19 -0000 1.3 *************** *** 40,44 **** '((($intersection Person Female) x) (($intersection Person ($complement Female)) y) ! (($intersection Person Female ($complement Female)) z))) ;(($intersection Person Female) x) --- 40,46 ---- '((($intersection Person Female) x) (($intersection Person ($complement Female)) y) ! (($intersection Person Female ($complement Female)) z) ! (($allValuesFrom hasChild Person) a) ! (hasChild a b))) ;(($intersection Person Female) x) |
|
From: Gerardo H. <ma...@us...> - 2004-08-07 00:24:15
|
Update of /cvsroot/javaowl/reasoner/design In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12965 Modified Files: draft.scm Added Files: reasoner.scm Log Message: Reasoner draft. Index: draft.scm =================================================================== RCS file: /cvsroot/javaowl/reasoner/design/draft.scm,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** draft.scm 6 Aug 2004 16:48:44 -0000 1.1.1.1 --- draft.scm 7 Aug 2004 00:24:06 -0000 1.2 *************** *** 0 **** --- 1,55 ---- + ;($= C A) + ;($= C $TOP) + ;($= C $BOTTOM) + ;($= C ($intersection A B)) + ;($= C ($union A B)) + ;($= C ($complement A)) + ;($= C ($allValuesFrom R D)) + ;($= C ($someValuesFrom R D)) + ;($<= C D) + ;(R a b) + ;(C a) + + (define tbox1 + '(($= Woman ($intersection Person Female)) + ($= Woman2 Woman) + ($= Man ($intersection Person ($complement Woman2))) + ($= Mother ($intersection Woman ($someValuesFrom hasChild Person))) + ($= Father ($intersection Man ($someValuesFrom hasChild Person))) + ($= Parent ($union Father Mother)) + ($= Grandmother ($intersection Mother ($someValuesFrom hasChild Parent))))) + + (define tbox2 + '(($= Woman ($intersection Person Female)) + ($= Man ($intersection Person Male)) + ($= Mother ($intersection Woman ($allValuesFrom hasChild Person))) + ($= Father ($intersection Man ($allValuesFrom hasChild Person))))) + + (define tbox3 + '(($= Woman ($intersection Person Female)) + ($= Man ($intersection Person ($complement Female))) + ($= Undefined ($intersection Man Woman)) + ($= Test ($allValuesFrom hasChild Undefined)) + ($= Test2 ($allValuesFrom hasChild $TOP)))) + + ;(Woman x) + ;(Man y) + ;(Undefined z) + + (define abox1 + '((($intersection Person Female) x) + (($intersection Person ($complement Female)) y) + (($intersection Person Female ($complement Female)) z))) + + ;(($intersection Person Female) x) + ;(Person x) + ;(Female x) + ;(($intersection Person ($complement Female)) y) + ;(Person y) + ;(($complement Female) y) + ;(($intersection Person Female ($complement Female)) z) + ;(Person z) + ;(Female z) + ;(($complement Female) z) + + --- NEW FILE: reasoner.scm --- (require 'list-lib) (define (find-definition tbox predicate) (if (null? tbox) #f (if (predicate (car tbox)) (car tbox) (find-definition (cdr tbox) predicate)))) (define (definition? tbox-term) (equal? (first tbox-term) '$=)) (define (concept-definition? tbox-term concept) (and (definition? tbox-term) (equal? (second tbox-term) concept))) (define (get-concept-definition tbox concept) (let ((tbox-term (find-definition tbox (lambda (x) (concept-definition? x concept))))) (if tbox-term (third tbox-term) #f))) (define (replace-concept-definition tbox concept new-definition) (if (null? tbox) () (let ((tbox-term (car tbox)) (tbox-terms (cdr tbox))) (if (concept-definition? tbox-term concept) (cons `($= ,concept ,new-definition) tbox-terms) (cons tbox-term (replace-concept-definition tbox-terms concept new-definition)))))) (define (simplify definition) (letrec ((simplify-complement (lambda (concepts) `($complement ,@concepts))) (flatten-intersection (lambda (concepts) (if (null? concepts) () (let ((concept (car concepts)) (other-concepts (cdr concepts))) (if (and (pair? concept) (eq? (first concept) '$intersection)) (append (cdr concept) (flatten-intersection other-concepts)) (cons concept (flatten-intersection other-concepts))))))) (reduce-intersection (lambda (concepts) (cond ((memq '$BOTTOM concepts) '($BOTTOM)) ((null? concepts) ()) (#t (let ((concept (car concepts)) (other-concepts (cdr concepts))) (if (or (eq? concept '$TOP) (member concept other-concepts)) (reduce-intersection other-concepts) (cons concept (reduce-intersection other-concepts)))))))) (check-unary (lambda (concepts) (if (= (length concepts) 1) (first concepts) `($intersection ,@concepts)))) (simplify-intersection (lambda (concepts) (check-unary (reduce-intersection (flatten-intersection (map simplify concepts)))))) (simplify-allValuesFrom (lambda (concepts) (let ((sarg (simplify (second concepts))) (role (first concepts))) (cond ((and (pair? sarg) (eq? (first sarg) '$intersection)) `($intersection ,@(map (lambda (x) `($allValuesFrom ,role , x)) (cdr sarg)))) ((eq? sarg '$TOP) '$TOP) (#t `($allValuesFrom ,role ,sarg))))))) (if (symbol? definition) definition (let ((constr (car definition)) (concepts (cdr definition))) (cond ((eq? constr '$intersection) (simplify-intersection concepts)) ((eq? constr '$allValuesFrom) (simplify-allValuesFrom concepts)) ((eq? constr '$complement) (simplify-complement concepts)) (#t (error "unexpected constructor: " constr))))))) (define (expand-concept-definition tbox definition) (if (symbol? definition) (let ((expansion (get-concept-definition tbox definition))) (if expansion (expand-concept-definition tbox expansion) definition)) (cons (car definition) (map (lambda (x) (expand-concept-definition tbox x)) (cdr definition))))) (define (expand-tbox tbox) (letrec ((rec-expand-tbox (lambda (tbox exp-tbox) (if (null? tbox) exp-tbox (let ((tbox-term (car tbox)) (tbox-terms (cdr tbox))) (if (definition? tbox-term) (let* ((concept (second tbox-term)) (definition (third tbox-term)) (new-exp-tbox (replace-concept-definition exp-tbox concept (simplify (expand-concept-definition exp-tbox definition))))) (rec-expand-tbox tbox-terms new-exp-tbox)) (cons tbox-term (rec-expand-tbox tbox-terms exp-tbox)))))))) (rec-expand-tbox tbox tbox))) (define (apply-rules abox) (letrec ((apply-intersection (lambda (concepts instance r-abox) (if (null? concepts) r-abox (let* ((concept (car concepts)) (other-concepts (cdr concepts)) (term `(,concept ,instance))) (apply-intersection other-concepts instance (if (member term r-abox) r-abox (cons term r-abox))))))) (check-allValuesFrom (lambda (instances concept r-abox) (if (null? instances) r-abox (let* ((instance (car instances)) (other-instances (cdr instances)) (term `(,concept ,instance))) (check-allValuesFrom other-instances concept (if (member term r-abox) r-abox (cons term r-abox))))))) (apply-allValuesFrom (lambda (role-concept instance r-abox) (let ((role (first role-concept)) (concept (second role-concept))) (check-allValuesFrom (map third (filter (lambda (x) (and (equal? role (first x)) (eq? instance (second x)))) r-abox)) concept r-abox)))) (rec-apply-rules (lambda (abox r-abox) (if (null? abox) r-abox (let* ((term (car abox)) (concept (first term)) (instance (second term)) (terms (cdr abox))) (cond ((symbol? concept) (rec-apply-rules terms r-abox)) ((eq? (car concept) '$intersection) (rec-apply-rules terms (apply-intersection (cdr concept) instance r-abox))) ((eq? (car concept) '$allValuesFrom) (rec-apply-rules terms (apply-allValuesFrom (cdr concept) instance r-abox))) (#t (rec-apply-rules terms r-abox)))))))) (rec-apply-rules abox abox))) (define (consistent? abox) (not (has-contradiction? (apply-rules abox)))) |
|
From: Gerardo H. <ma...@us...> - 2004-08-02 20:02:58
|
Update of /cvsroot/javaowl/JavaOWL/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22575/lib Modified Files: prevayler1.02.002production.jar Log Message: Fixed binary attribute |
|
From: Elmer G. <ega...@us...> - 2004-07-28 16:44:33
|
Update of /cvsroot/javaowl/JavaOWL/src/org/javaowl/models/remote In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12197/src/org/javaowl/models/remote Modified Files: RemoteGraph.java Added Files: RemoteGraphWrapper.java Log Message: Added remote interfaces. --- NEW FILE: RemoteGraphWrapper.java --- /* * RemoteGraphWrapper.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.models.remote; import java.rmi.RemoteException; import com.hp.hpl.jena.graph.BulkUpdateHandler; import com.hp.hpl.jena.graph.Capabilities; import com.hp.hpl.jena.graph.Graph; import com.hp.hpl.jena.graph.GraphEventManager; import com.hp.hpl.jena.graph.Node; import com.hp.hpl.jena.graph.Reifier; import com.hp.hpl.jena.graph.TransactionHandler; import com.hp.hpl.jena.graph.Triple; import com.hp.hpl.jena.graph.TripleMatch; import com.hp.hpl.jena.graph.query.QueryHandler; import com.hp.hpl.jena.shared.AddDeniedException; import com.hp.hpl.jena.shared.DeleteDeniedException; import com.hp.hpl.jena.shared.PrefixMapping; import com.hp.hpl.jena.util.iterator.ExtendedIterator; public class RemoteGraphWrapper implements Graph { private RemoteGraph remote; public void add(Triple triple) throws AddDeniedException{ try { remote.add(triple); } catch (RemoteException e) { throw new AddDeniedException(e.toString()); } } public void close() { try { remote.close(); } catch (RemoteException e) { throw new RuntimeException(e); } } public boolean contains(Node subject, Node predicate, Node object) { try { return remote.contains(subject, predicate, object); } catch (RemoteException e) { throw new RuntimeException(e); } } public boolean contains(Triple triple) { try { return remote.contains(triple); } catch (RemoteException e) { throw new RuntimeException(e); } } public void delete(Triple triple) throws DeleteDeniedException { try { remote.delete(triple); } catch (RemoteException e) { throw new DeleteDeniedException(e.toString()); } } public boolean dependsOn(Graph graph) { try { return remote.dependsOn(graph); } catch (RemoteException e) { throw new RuntimeException(e); } } public ExtendedIterator find(Node subject, Node predicate, Node object) { try { return remote.find(subject, predicate, object); } catch (RemoteException e) { throw new RuntimeException(e); } } public ExtendedIterator find(TripleMatch tripleMatch) { try { return remote.find(tripleMatch); } catch (RemoteException e) { throw new RuntimeException(e); } } public BulkUpdateHandler getBulkUpdateHandler() { try { return remote.getBulkUpdateHandler(); } catch (RemoteException e) { throw new RuntimeException(e); } } public Capabilities getCapabilities() { try { return remote.getCapabilities(); } catch (RemoteException e) { throw new RuntimeException(e); } } public GraphEventManager getEventManager() { try { return remote.getEventManager(); } catch (RemoteException e) { throw new RuntimeException(e); } } public PrefixMapping getPrefixMapping() { try { return remote.getPrefixMapping(); } catch (RemoteException e) { throw new RuntimeException(e); } } public Reifier getReifier() { try { return remote.getReifier(); } catch (RemoteException e) { throw new RuntimeException(e); } } public TransactionHandler getTransactionHandler() { try { return remote.getTransactionHandler(); } catch (RemoteException e) { throw new RuntimeException(e); } } public boolean isEmpty() { try { return remote.isEmpty(); } catch (RemoteException e) { throw new RuntimeException(e); } } public boolean isIsomorphicWith(Graph graph) { try { return remote.isIsomorphicWith(graph); } catch (RemoteException e) { throw new RuntimeException(e); } } public QueryHandler queryHandler() { try { return remote.queryHandler(); } catch (RemoteException e) { throw new RuntimeException(e); } } public int size() { try { return remote.size(); } catch (RemoteException e) { throw new RuntimeException(e); } } } Index: RemoteGraph.java =================================================================== RCS file: /cvsroot/javaowl/JavaOWL/src/org/javaowl/models/remote/RemoteGraph.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RemoteGraph.java 27 Jul 2004 17:45:31 -0000 1.1 --- RemoteGraph.java 28 Jul 2004 16:44:23 -0000 1.2 *************** *** 21,28 **** import java.rmi.Remote; import com.hp.hpl.jena.graph.Graph; ! public interface RemoteGraph extends Remote, Graph { ! } --- 21,57 ---- import java.rmi.Remote; + import java.rmi.RemoteException; + import com.hp.hpl.jena.graph.BulkUpdateHandler; + import com.hp.hpl.jena.graph.Capabilities; import com.hp.hpl.jena.graph.Graph; + import com.hp.hpl.jena.graph.GraphEventManager; + import com.hp.hpl.jena.graph.Node; + import com.hp.hpl.jena.graph.Reifier; + import com.hp.hpl.jena.graph.TransactionHandler; + import com.hp.hpl.jena.graph.Triple; + import com.hp.hpl.jena.graph.TripleMatch; + import com.hp.hpl.jena.graph.query.QueryHandler; + import com.hp.hpl.jena.shared.PrefixMapping; + import com.hp.hpl.jena.util.iterator.ExtendedIterator; ! public interface RemoteGraph extends Remote { ! public boolean dependsOn(Graph graph) throws RemoteException; ! public QueryHandler queryHandler() throws RemoteException; ! public TransactionHandler getTransactionHandler() throws RemoteException; ! public BulkUpdateHandler getBulkUpdateHandler() throws RemoteException; ! public Capabilities getCapabilities() throws RemoteException; ! public GraphEventManager getEventManager() throws RemoteException; ! public Reifier getReifier() throws RemoteException; ! public PrefixMapping getPrefixMapping() throws RemoteException; ! public void delete(Triple triple) throws RemoteException; ! public ExtendedIterator find(TripleMatch tripleMatch) throws RemoteException; ! public ExtendedIterator find(Node subject, Node predicate, Node object) throws RemoteException; ! public boolean isIsomorphicWith(Graph graph) throws RemoteException; ! public boolean contains(Node subject, Node predicate, Node object) throws RemoteException; ! public boolean contains(Triple triple) throws RemoteException; ! public void close() throws RemoteException; ! public boolean isEmpty() throws RemoteException; ! public int size() throws RemoteException; ! public void add(Triple triple) throws RemoteException; } |
|
From: Elmer G. <ega...@us...> - 2004-07-28 16:44:33
|
Update of /cvsroot/javaowl/JavaOWL/src/org/javaowl/models/prevalence In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12197/src/org/javaowl/models/prevalence Modified Files: PrevalentGraph.java Log Message: Added remote interfaces. Index: PrevalentGraph.java =================================================================== RCS file: /cvsroot/javaowl/JavaOWL/src/org/javaowl/models/prevalence/PrevalentGraph.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PrevalentGraph.java 28 Jul 2004 06:54:07 -0000 1.3 --- PrevalentGraph.java 28 Jul 2004 16:44:17 -0000 1.4 *************** *** 65,69 **** } } catch (IOException e) { ! e.printStackTrace(); } } --- 65,69 ---- } } catch (IOException e) { ! throw new RuntimeException(e); } } |
|
From: Elmer G. <ega...@us...> - 2004-07-28 07:17:13
|
Update of /cvsroot/javaowl/JavaOWL/src/org/javaowl/editor/swing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21723/src/org/javaowl/editor/swing Modified Files: OntTreePagelet.java Editor.java EditPage.java Log Message: Fixed some TODO's in ModelEditorBean and ResourceEditorBean Index: OntTreePagelet.java =================================================================== RCS file: /cvsroot/javaowl/JavaOWL/src/org/javaowl/editor/swing/OntTreePagelet.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** OntTreePagelet.java 27 Jul 2004 15:59:56 -0000 1.4 --- OntTreePagelet.java 28 Jul 2004 07:17:03 -0000 1.5 *************** *** 59,63 **** private JTree createPanel() { ! OntClass thing = editor.createClass(OWL.Thing); DefaultMutableTreeNode top = new DefaultMutableTreeNode(thing); paths.put(thing, top); --- 59,63 ---- private JTree createPanel() { ! OntClass thing = editor.getOntClass(OWL.Thing); DefaultMutableTreeNode top = new DefaultMutableTreeNode(thing); paths.put(thing, top); *************** *** 129,154 **** } - /* - public void showTypes() { - component.setExpandsSelectedPaths(true); - if (resource != null) { - OntClass[] types = resource.getTypes(); - for (int i = 0; i < types.length; i++) { - DefaultMutableTreeNode node = (DefaultMutableTreeNode) paths.get(types[i]); - component.setSelectionPath(new TreePath(node.getPath())); - } - } - } - */ - public Component getComponent() { - refresh(); return component; ! } ! ! public void refresh() { ! // TODO: Is this method ever called? ! } ! } --- 129,135 ---- } public Component getComponent() { return component; ! } } Index: EditPage.java =================================================================== RCS file: /cvsroot/javaowl/JavaOWL/src/org/javaowl/editor/swing/EditPage.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** EditPage.java 22 Jul 2004 02:47:41 -0000 1.4 --- EditPage.java 28 Jul 2004 07:17:04 -0000 1.5 *************** *** 201,205 **** propertyEditor = (PropertyEditorPagelet) propertyEditors.get(""); } ! propertyEditor.setRangeType(editor.createProperty(currentProperty).getRange()); OntResource ontClass = resourceEditor.getValidLeafClass(currentProperty); if (ontClass != null) { --- 201,205 ---- propertyEditor = (PropertyEditorPagelet) propertyEditors.get(""); } ! propertyEditor.setRangeType(editor.getOntProperty(currentProperty).getRange()); OntResource ontClass = resourceEditor.getValidLeafClass(currentProperty); if (ontClass != null) { *************** *** 220,224 **** propertyEditor = (PropertyEditorPagelet) propertyEditors.get(""); } ! propertyEditor.setRangeType(editor.createProperty(currentProperty).getRange()); if (value instanceof Resource) { OntResource ontClass = resourceEditor.getValidLeafClass(currentProperty); --- 220,224 ---- propertyEditor = (PropertyEditorPagelet) propertyEditors.get(""); } ! propertyEditor.setRangeType(editor.getOntProperty(currentProperty).getRange()); if (value instanceof Resource) { OntResource ontClass = resourceEditor.getValidLeafClass(currentProperty); *************** *** 256,260 **** Util.setList(properties, resourceEditor.getApplicableProperties()); values.clear(); ! Statement[] stmts = resourceEditor.getProperties(); for (int i = 0; i < stmts.length; i++) values.add(stmts[i]); --- 256,260 ---- Util.setList(properties, resourceEditor.getApplicableProperties()); values.clear(); ! Statement[] stmts = resourceEditor.getDeclaredProperties(); for (int i = 0; i < stmts.length; i++) values.add(stmts[i]); *************** *** 281,285 **** } values.add(resourceEditor.addDataValue(currentProperty, ! editor.createTypedLiteral(value, type))); propertyEditor = null; currentStatement = null; --- 281,285 ---- } values.add(resourceEditor.addDataValue(currentProperty, ! editor.getTypedLiteral(value, type))); propertyEditor = null; currentStatement = null; Index: Editor.java =================================================================== RCS file: /cvsroot/javaowl/JavaOWL/src/org/javaowl/editor/swing/Editor.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Editor.java 26 Jul 2004 22:55:02 -0000 1.24 --- Editor.java 28 Jul 2004 07:17:03 -0000 1.25 *************** *** 79,87 **** Model ontology = ModelFactory.createDefaultModel(); ontology.read(new FileInputStream(args[0]), null, "N3"); ! Model props = ModelFactory.createDefaultModel(); ! props.read(new FileInputStream(args[1]), null, "N3"); ! Model data = ModelFactory.createModelForGraph(new PrevalentGraph(args[2])); ! ModelEditorBean editor = new ModelEditorBean(ontology, props, data, args[3]); new Editor(editor).show(); } --- 79,85 ---- Model ontology = ModelFactory.createDefaultModel(); ontology.read(new FileInputStream(args[0]), null, "N3"); ! Model data = ModelFactory.createModelForGraph(new PrevalentGraph(args[1])); ! ModelEditorBean editor = new ModelEditorBean(ontology, data, args[2]); new Editor(editor).show(); } *************** *** 121,125 **** try { addPropertyEditor("", Class.forName("org.javaowl.editor.swing.DefaultPropertyEditorPagelet")); ! OntProperty[] props = editor.getAllProperties(); for(int i = 0; i < props.length; i++) { addPropertyEditor(props[i].getURI(), --- 119,123 ---- try { addPropertyEditor("", Class.forName("org.javaowl.editor.swing.DefaultPropertyEditorPagelet")); ! OntProperty[] props = editor.getAllDatatypeProperties(); for(int i = 0; i < props.length; i++) { addPropertyEditor(props[i].getURI(), *************** *** 177,181 **** public void editResource(Resource resource) { ! ResourceEditorBean current = editor.getResourceEditor(resource); EditPage editPage = new EditPage(editor, current, panels, this); addPane(editPage); --- 175,179 ---- public void editResource(Resource resource) { ! ResourceEditorBean current = editor.getResource(resource); EditPage editPage = new EditPage(editor, current, panels, this); addPane(editPage); *************** *** 189,195 **** ResourceEditorBean current; if (uri == null) ! current = editor.getNewResourceEditor(resource); else ! current = editor.getNewResourceEditor(uri, resource); current.setLabel(label); EditPage editPage = new EditPage(editor, current, panels, this); --- 187,193 ---- ResourceEditorBean current; if (uri == null) ! current = editor.createResource(resource); else ! current = editor.createResource(uri, resource); current.setLabel(label); EditPage editPage = new EditPage(editor, current, panels, this); |
|
From: Elmer G. <ega...@us...> - 2004-07-28 07:17:13
|
Update of /cvsroot/javaowl/JavaOWL In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21723 Modified Files: build.xml Log Message: Fixed some TODO's in ModelEditorBean and ResourceEditorBean Index: build.xml =================================================================== RCS file: /cvsroot/javaowl/JavaOWL/build.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** build.xml 26 Jul 2004 22:55:02 -0000 1.12 --- build.xml 28 Jul 2004 07:17:04 -0000 1.13 *************** *** 67,71 **** <jvmarg value="-verbose:gc"/> <arg value="testdata/pru6o.n3"/> - <arg value="testdata/pru6p.n3"/> <arg value="testdata/pru6d.prevayler"/> <arg value="uri:pru6:o#"/> --- 67,70 ---- |
|
From: Elmer G. <ega...@us...> - 2004-07-28 07:17:12
|
Update of /cvsroot/javaowl/JavaOWL/src/org/javaowl/editor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21723/src/org/javaowl/editor Modified Files: ModelEditorBean.java ResourceEditorBean.java Log Message: Fixed some TODO's in ModelEditorBean and ResourceEditorBean Index: ModelEditorBean.java =================================================================== RCS file: /cvsroot/javaowl/JavaOWL/src/org/javaowl/editor/ModelEditorBean.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ModelEditorBean.java 28 Jul 2004 06:54:06 -0000 1.8 --- ModelEditorBean.java 28 Jul 2004 07:17:03 -0000 1.9 *************** *** 57,80 **** private OntResource[] classes; - - private OntResource[] leafClasses; private EditorReasoner ontologyReasoner; ! public ModelEditorBean(String ontology, String properties, String data, String prefix) throws IOException { ! this(new FileInputStream(ontology), new FileInputStream(properties), ! new FileInputStream(data), prefix); } ! public ModelEditorBean(InputStream ontologyIn, InputStream propertiesIn, InputStream dataIn, ! String prefix) throws IOException { this.prefix = prefix; ontology = ModelFactory.createDefaultModel(); ontology.read(ontologyIn, null, "N3"); ontologyIn.close(); - // Not supported by reasoner - // ontology.read(propertiesIn, null, "N3"); - propertiesIn.close(); ontModel = ModelFactory .createOntologyModel(OntModelSpec.OWL_DL_MEM_RULE_INF, ontology); --- 57,73 ---- private OntResource[] classes; private EditorReasoner ontologyReasoner; ! public ModelEditorBean(String ontology, String data, String prefix) throws IOException { ! this(new FileInputStream(ontology), new FileInputStream(data), prefix); } ! public ModelEditorBean(InputStream ontologyIn, InputStream dataIn, String prefix) throws IOException { this.prefix = prefix; ontology = ModelFactory.createDefaultModel(); ontology.read(ontologyIn, null, "N3"); ontologyIn.close(); ontModel = ModelFactory .createOntologyModel(OntModelSpec.OWL_DL_MEM_RULE_INF, ontology); *************** *** 86,93 **** } ! public ModelEditorBean(Model ontology, Model properties, Model data, String prefix) { this.prefix = prefix; - // Not supported by reasoner - // ontology.add(properties); this.ontology = ontology; ontModel = ModelFactory --- 79,84 ---- } ! public ModelEditorBean(Model ontology, Model data, String prefix) { this.prefix = prefix; this.ontology = ontology; ontModel = ModelFactory *************** *** 102,109 **** } - public OntResource[] getLeafClasses() { - return leafClasses; - } - public Set getPropertiesURIs(Resource clazz, boolean all) { List l = new ArrayList(); --- 93,96 ---- *************** *** 136,141 **** return result; } ! //TODO: rename getAllDatatypeProperties ! public OntProperty[] getAllProperties() { Set props = new HashSet(); for (Iterator it = ontModel.listDatatypeProperties(); it.hasNext();) { --- 123,128 ---- return result; } ! ! public OntProperty[] getAllDatatypeProperties() { Set props = new HashSet(); for (Iterator it = ontModel.listDatatypeProperties(); it.hasNext();) { *************** *** 170,188 **** } ! //TODO: rename getOntClass etc ... ! public OntClass createClass(Resource resource) { return ontModel.createClass(resource.getURI()); } ! public OntProperty createProperty(Property property) { return ontModel.createOntProperty(property.getURI()); } ! public Literal createTypedLiteral(Object value, OntResource type) { return data.createTypedLiteral(value, type.getURI()); } public void removeStatement(Statement statement) { - ontModel.remove(statement); // TODO: Do we really need this? data.remove(statement); } --- 157,174 ---- } ! ! public OntClass getOntClass(Resource resource) { return ontModel.createClass(resource.getURI()); } ! public OntProperty getOntProperty(Property property) { return ontModel.createOntProperty(property.getURI()); } ! public Literal getTypedLiteral(Object value, OntResource type) { return data.createTypedLiteral(value, type.getURI()); } public void removeStatement(Statement statement) { data.remove(statement); } *************** *** 193,197 **** for(Iterator it = resource.listProperties(); it.hasNext(); ) stmts.add(it.next()); - ontModel.remove(stmts); data.remove(stmts); } --- 179,182 ---- *************** *** 207,212 **** return (OntClass[]) classes.toArray(new OntClass[0]); } ! //TODO: look for better names ! public ResourceEditorBean getNewResourceEditor(OntResource classResource) { Resource r = data.createResource(); r.addProperty(RDF.type, classResource); --- 192,197 ---- return (OntClass[]) classes.toArray(new OntClass[0]); } ! ! public ResourceEditorBean createResource(OntResource classResource) { Resource r = data.createResource(); r.addProperty(RDF.type, classResource); *************** *** 214,218 **** } ! public ResourceEditorBean getNewResourceEditor(String uri, OntResource classResource) { Resource r = data.createResource(uri); r.addProperty(RDF.type, classResource); --- 199,203 ---- } ! public ResourceEditorBean createResource(String uri, OntResource classResource) { Resource r = data.createResource(uri); r.addProperty(RDF.type, classResource); *************** *** 220,224 **** } ! public ResourceEditorBean getResourceEditor(Resource resource) { return new ResourceEditorBean(resource, prefix, ontModel, this); } --- 205,209 ---- } ! public ResourceEditorBean getResource(Resource resource) { return new ResourceEditorBean(resource, prefix, ontModel, this); } *************** *** 241,247 **** throw new RuntimeException("ontology reasoner exception: ", e); } - //TODO: Remove leafClasses methods List classes = new ArrayList(); - List leafClasses = new ArrayList(); for (Iterator it = ontModel.listNamedClasses(); it.hasNext();) { OntResource or = (OntResource) it.next(); --- 226,230 ---- *************** *** 249,262 **** if (prefix == null || oc.getNameSpace().equals(prefix)) { classes.add(or); - boolean isLeaf = true; - Iterator it2 = oc.listSubClasses(); - if (it2.hasNext()) - isLeaf = false; - if (isLeaf) - leafClasses.add(or); } } this.classes = (OntResource[]) classes.toArray(new OntResource[0]); - this.leafClasses = (OntResource[]) leafClasses.toArray(new OntResource[0]); } } --- 232,238 ---- Index: ResourceEditorBean.java =================================================================== RCS file: /cvsroot/javaowl/JavaOWL/src/org/javaowl/editor/ResourceEditorBean.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ResourceEditorBean.java 28 Jul 2004 06:54:06 -0000 1.5 --- ResourceEditorBean.java 28 Jul 2004 07:17:03 -0000 1.6 *************** *** 92,97 **** return result; } ! //TODO: rename getDeclaredPRoperties ! public Statement[] getProperties() { List resources = new ArrayList(); for (Iterator it = resource.listProperties(); it.hasNext();) { --- 92,97 ---- return result; } ! ! public Statement[] getDeclaredProperties() { List resources = new ArrayList(); for (Iterator it = resource.listProperties(); it.hasNext();) { *************** *** 106,109 **** --- 106,110 ---- return false; } + //TODO: get all valid Instances for the range intersection and the // resource restrictions |