From: <ku...@us...> - 2008-10-09 22:26:34
|
Revision: 1358 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1358&view=rev Author: kurzum Date: 2008-10-09 22:26:23 +0000 (Thu, 09 Oct 2008) Log Message: ----------- some changes Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/kb/extraction/BlankNode.java trunk/src/dl-learner/org/dllearner/kb/extraction/ClassNode.java trunk/src/dl-learner/org/dllearner/kb/extraction/InstanceNode.java trunk/src/dl-learner/org/dllearner/kb/extraction/Node.java trunk/src/dl-learner/org/dllearner/kb/extraction/ObjectPropertyNode.java trunk/src/dl-learner/org/dllearner/utilities/owl/OWLVocabulary.java Property Changed: ---------------- trunk/src/dl-learner/org/dllearner/cli/ Property changes on: trunk/src/dl-learner/org/dllearner/cli ___________________________________________________________________ Added: svn:ignore + QuickNew.java Modified: trunk/src/dl-learner/org/dllearner/kb/extraction/BlankNode.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/extraction/BlankNode.java 2008-10-09 14:20:56 UTC (rev 1357) +++ trunk/src/dl-learner/org/dllearner/kb/extraction/BlankNode.java 2008-10-09 22:26:23 UTC (rev 1358) @@ -153,8 +153,9 @@ tmp.add(next.blankNodes.get(0)); //System.out.println("bnode added"); }else{ - System.out.println("double nesting not supported yet"); - System.exit(0); + + tail("double nesting not supported yet"); + } } }//end while @@ -165,14 +166,14 @@ return factory.getOWLObjectUnionOf(target); }else if(inboundEdge.equals(OWLVocabulary.OWL_complementOf)){ if(target.size()>1) { - logger.warn("more than one complement"+target); - System.exit(0); + tail("more than one complement"+target); + }else{ return factory.getOWLObjectComplementOf(new ArrayList<OWLDescription>(target).remove(0)); } }else{ printAll(); - tail("wrong type: " +inboundEdge+ this); + tail("bnode: wrong type: " +inboundEdge+ this); } } @@ -193,23 +194,23 @@ } public void printAll(){ - System.out.println(this); + logger.debug(this); - System.out.println("otherNodes"); + logger.debug("otherNodes"); for (StringTuple t : otherNodes) { - System.out.println(""+t); + logger.debug(""+t); } - System.out.println("***************"); - System.out.println("dtype "); + logger.debug("***************"); + logger.debug("dtype "); for (DatatypePropertyNode d : datatypeProperties) { - System.out.println(d.getURIString()+" "+d.getNTripleFormOfB()); + logger.debug(d.getURIString()+" "+d.getNTripleFormOfB()); } - System.out.println("***************"); - System.out.println("other bnodes"); + logger.debug("***************"); + logger.debug("other bnodes"); for (BlankNode b : blankNodes) { - System.out.println(b); + logger.debug(b); } - System.out.println("***************"); + logger.debug("***************"); } @@ -221,7 +222,7 @@ int total = otherNodes.size()+blankNodes.size()+datatypeProperties.size(); if(total >=4 ){ - System.out.println("qualified p restrictions not supported currently"); + logger.info("qualified p restrictions not supported currently"); } // get Objectproperty Modified: trunk/src/dl-learner/org/dllearner/kb/extraction/ClassNode.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/extraction/ClassNode.java 2008-10-09 14:20:56 UTC (rev 1357) +++ trunk/src/dl-learner/org/dllearner/kb/extraction/ClassNode.java 2008-10-09 22:26:23 UTC (rev 1358) @@ -148,6 +148,7 @@ public void toOWLOntology( OWLAPIOntologyCollector owlAPIOntologyCollector){ try{ OWLDataFactory factory = owlAPIOntologyCollector.getFactory(); + OWLClass me =factory.getOWLClass(getURI()); for (ObjectPropertyNode one : classProperties) { OWLClass c = factory.getOWLClass(one.getBPart().getURI()); @@ -157,8 +158,12 @@ owlAPIOntologyCollector.addAxiom(factory.getOWLDisjointClassesAxiom(me, c)); }else if(one.getURIString().equals(OWLVocabulary.OWL_EQUIVALENT_CLASS)){ owlAPIOntologyCollector.addAxiom(factory.getOWLEquivalentClassesAxiom(me, c)); + }else if(one.getURIString().equals(OWLVocabulary.RDFS_IS_DEFINED_BY)){ + logger.warn("IGNORING: "+OWLVocabulary.RDFS_IS_DEFINED_BY); + continue; }else { - tail( getURIString()+"||"+one.getURIString()); + tail(true, "in ontology conversion"+" object property is: "+one.getURIString()+" connected with: "+one.getBPart().getURIString()); + continue; } one.getBPart().toOWLOntology(owlAPIOntologyCollector); } @@ -173,7 +178,8 @@ OWLLabelAnnotation label = factory.getOWLLabelAnnotation(one.getBPart().getLiteral().getString()); owlAPIOntologyCollector.addAxiom(factory.getOWLEntityAnnotationAxiom(me, label)); }else { - tail(getURIString()+"||"+one.getURIString()); + tail(true, "in ontology conversion, no other datatypes, but annotation allowed for class"+" data property is: "+one.getURIString()+" connected with: "+one.getBPart().getNTripleForm()); + } } @@ -187,7 +193,8 @@ }else if(bn.getInBoundEdge().equals(OWLVocabulary.OWL_EQUIVALENT_CLASS)){ owlAPIOntologyCollector.addAxiom(factory.getOWLEquivalentClassesAxiom(me, target)); }else { - tail( getURIString()+"||"+bn.getInBoundEdge()); + tail( "in ontology conversion"+" bnode is: "+bn.getInBoundEdge()+"||"+ bn ); + } } Modified: trunk/src/dl-learner/org/dllearner/kb/extraction/InstanceNode.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/extraction/InstanceNode.java 2008-10-09 14:20:56 UTC (rev 1357) +++ trunk/src/dl-learner/org/dllearner/kb/extraction/InstanceNode.java 2008-10-09 22:26:23 UTC (rev 1358) @@ -105,7 +105,7 @@ return tmp; } } catch (Exception e) { - System.out.println("Problem with: " + tuple); + tail("process tuple: problem with: " + tuple); e.printStackTrace(); return null; } @@ -221,7 +221,7 @@ } else { - tail(getURIString()+"||"+one.getURIString()); + tail("strange dataytype in ontology conversion" + one.getURIString()+" datatype: "+one.getBPart().getNTripleForm()); } //handover @@ -229,7 +229,7 @@ }catch (Exception e) { e.printStackTrace(); - System.exit(0); + tail("strange dataytype in ontology conversion" + one.getURIString()+" datatype: "+one.getBPart().getNTripleForm()); } } //factory.getOWLDataPropertyAssertionAxiom() Modified: trunk/src/dl-learner/org/dllearner/kb/extraction/Node.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/extraction/Node.java 2008-10-09 14:20:56 UTC (rev 1357) +++ trunk/src/dl-learner/org/dllearner/kb/extraction/Node.java 2008-10-09 22:26:23 UTC (rev 1358) @@ -107,10 +107,27 @@ return expanded; } - public void tail(String uri){ - if(DEBUGTAIL){ - logger.warn("missing: "+uri); - System.exit(0); + public void tail( String tailmessage){ + boolean ignore = !DEBUGTAIL; + tail(ignore, tailmessage); + } + + public void tail(boolean ignore, String tailmessage){ + + String message = "difficult tuple. Subject is: "+ this.getURIString()+" of class"+this.getClass().getSimpleName()+" " + + "info: "+tailmessage; + if(ignore){ + if(DEBUGTAIL){ + logger.info("IGNORING: "+message); + }else { + logger.debug("IGNORING: "+message); + } + + + }else{ + logger.warn(message); + logger.error("exiting "); + System.exit(0); } } Modified: trunk/src/dl-learner/org/dllearner/kb/extraction/ObjectPropertyNode.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/extraction/ObjectPropertyNode.java 2008-10-09 14:20:56 UTC (rev 1357) +++ trunk/src/dl-learner/org/dllearner/kb/extraction/ObjectPropertyNode.java 2008-10-09 22:26:23 UTC (rev 1358) @@ -95,7 +95,7 @@ } } catch (Exception e) { - logger.warn("resource "+uri+" with "+ tuple); + tail("expand properties: with tuple: "+ tuple); e.printStackTrace(); } @@ -157,7 +157,7 @@ // XXX comments } else { - tail(getURIString()+"||"+one); + tail("conversion to ontology: property information: " + one); } } @@ -173,7 +173,7 @@ }else if(one.equals(OWLVocabulary.OWL_SymmetricProperty)){ owlAPIOntologyCollector.addAxiom(factory.getOWLSymmetricObjectPropertyAxiom(me)); }else{ - tail(getURIString()+"||"+one); + tail("conversion to ontology: special types: " + one); } } for (BlankNode bn : blankNodes) { Modified: trunk/src/dl-learner/org/dllearner/utilities/owl/OWLVocabulary.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/owl/OWLVocabulary.java 2008-10-09 14:20:56 UTC (rev 1357) +++ trunk/src/dl-learner/org/dllearner/utilities/owl/OWLVocabulary.java 2008-10-09 22:26:23 UTC (rev 1358) @@ -29,6 +29,7 @@ public static final String RDFS_SUBCLASS_OF = "http://www.w3.org/2000/01/rdf-schema#subClassOf"; public static final String RDFS_CLASS = "http://www.w3.org/2000/01/rdf-schema#Class"; + public static final String RDFS_IS_DEFINED_BY = "http://www.w3.org/2000/01/rdf-schema#isDefinedBy"; public static final String RDFS_COMMENT = "http://www.w3.org/2000/01/rdf-schema#comment"; public static final String RDFS_LABEL = "http://www.w3.org/2000/01/rdf-schema#label"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |