From: <jen...@us...> - 2008-02-11 19:01:58
|
Revision: 543 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=543&view=rev Author: jenslehmann Date: 2008-02-11 11:01:36 -0800 (Mon, 11 Feb 2008) Log Message: ----------- - wrote visitor interfaces for OWL structures - more structures added Added Paths: ----------- trunk/src/dl-learner/org/dllearner/core/owl/AssertionalAxiomVisitor.java trunk/src/dl-learner/org/dllearner/core/owl/AxiomVisitor.java trunk/src/dl-learner/org/dllearner/core/owl/CardinalityRestriction.java trunk/src/dl-learner/org/dllearner/core/owl/DatatypeCardinalityRestriction.java trunk/src/dl-learner/org/dllearner/core/owl/DatatypeExactCardinalityRestriction.java trunk/src/dl-learner/org/dllearner/core/owl/DatatypeMaxCardinalityRestriction.java trunk/src/dl-learner/org/dllearner/core/owl/DatatypeMinCardinalityRestriction.java trunk/src/dl-learner/org/dllearner/core/owl/DatatypeValueRestriction.java trunk/src/dl-learner/org/dllearner/core/owl/DescriptionVisitor.java trunk/src/dl-learner/org/dllearner/core/owl/KBElementVisitor.java trunk/src/dl-learner/org/dllearner/core/owl/ObjectExactCardinalityRestriction.java trunk/src/dl-learner/org/dllearner/core/owl/ObjectValueRestriction.java trunk/src/dl-learner/org/dllearner/core/owl/PropertyAxiomVisitor.java trunk/src/dl-learner/org/dllearner/core/owl/PropertyExpressionVisitor.java trunk/src/dl-learner/org/dllearner/core/owl/TerminologicalAxiomVisitor.java trunk/src/dl-learner/org/dllearner/core/owl/ValueRestriction.java trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIConverterVisitor.java Added: trunk/src/dl-learner/org/dllearner/core/owl/AssertionalAxiomVisitor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/AssertionalAxiomVisitor.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/owl/AssertionalAxiomVisitor.java 2008-02-11 19:01:36 UTC (rev 543) @@ -0,0 +1,36 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.core.owl; + +/** + * Visitor for assertional (ABox) axioms. + * + * @author Jens Lehmann + * + */ +public interface AssertionalAxiomVisitor { + + public void visit(ClassAssertionAxiom axiom); + + public void visit(ObjectPropertyAssertion axiom); + + public void visit(DoubleDatatypePropertyAssertion axiom); + +} Added: trunk/src/dl-learner/org/dllearner/core/owl/AxiomVisitor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/AxiomVisitor.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/owl/AxiomVisitor.java 2008-02-11 19:01:36 UTC (rev 543) @@ -0,0 +1,33 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.core.owl; + +/** + * Visitor interface for all implemented kinds of axioms in a knowledge + * base. + * + * @author Jens Lehmann + * + */ +public interface AxiomVisitor extends AssertionalAxiomVisitor, PropertyAxiomVisitor, TerminologicalAxiomVisitor { + + + +} Added: trunk/src/dl-learner/org/dllearner/core/owl/CardinalityRestriction.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/CardinalityRestriction.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/owl/CardinalityRestriction.java 2008-02-11 19:01:36 UTC (rev 543) @@ -0,0 +1,28 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.core.owl; + +/** + * @author Jens Lehmann + * + */ +public abstract class CardinalityRestriction extends Description { + +} Added: trunk/src/dl-learner/org/dllearner/core/owl/DatatypeCardinalityRestriction.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/DatatypeCardinalityRestriction.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/owl/DatatypeCardinalityRestriction.java 2008-02-11 19:01:36 UTC (rev 543) @@ -0,0 +1,28 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.core.owl; + +/** + * @author Jens Lehmann + * + */ +public abstract class DatatypeCardinalityRestriction extends CardinalityRestriction { + +} Added: trunk/src/dl-learner/org/dllearner/core/owl/DatatypeExactCardinalityRestriction.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/DatatypeExactCardinalityRestriction.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/owl/DatatypeExactCardinalityRestriction.java 2008-02-11 19:01:36 UTC (rev 543) @@ -0,0 +1,55 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.core.owl; + +import java.util.Map; + +/** + * @author Jens Lehmann + * + */ +public class DatatypeExactCardinalityRestriction extends DatatypeCardinalityRestriction { + + /* (non-Javadoc) + * @see org.dllearner.core.owl.Concept#getArity() + */ + @Override + public int getArity() { + // TODO Auto-generated method stub + return 0; + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.KBElement#getLength() + */ + public int getLength() { + // TODO Auto-generated method stub + return 0; + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.KBElement#toString(java.lang.String, java.util.Map) + */ + public String toString(String baseURI, Map<String, String> prefixes) { + // TODO Auto-generated method stub + return null; + } + +} Added: trunk/src/dl-learner/org/dllearner/core/owl/DatatypeMaxCardinalityRestriction.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/DatatypeMaxCardinalityRestriction.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/owl/DatatypeMaxCardinalityRestriction.java 2008-02-11 19:01:36 UTC (rev 543) @@ -0,0 +1,55 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.core.owl; + +import java.util.Map; + +/** + * @author Jens Lehmann + * + */ +public class DatatypeMaxCardinalityRestriction extends DatatypeCardinalityRestriction { + + /* (non-Javadoc) + * @see org.dllearner.core.owl.Concept#getArity() + */ + @Override + public int getArity() { + // TODO Auto-generated method stub + return 0; + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.KBElement#getLength() + */ + public int getLength() { + // TODO Auto-generated method stub + return 0; + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.KBElement#toString(java.lang.String, java.util.Map) + */ + public String toString(String baseURI, Map<String, String> prefixes) { + // TODO Auto-generated method stub + return null; + } + +} Added: trunk/src/dl-learner/org/dllearner/core/owl/DatatypeMinCardinalityRestriction.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/DatatypeMinCardinalityRestriction.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/owl/DatatypeMinCardinalityRestriction.java 2008-02-11 19:01:36 UTC (rev 543) @@ -0,0 +1,55 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.core.owl; + +import java.util.Map; + +/** + * @author Jens Lehmann + * + */ +public class DatatypeMinCardinalityRestriction extends DatatypeCardinalityRestriction { + + /* (non-Javadoc) + * @see org.dllearner.core.owl.Concept#getArity() + */ + @Override + public int getArity() { + // TODO Auto-generated method stub + return 0; + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.KBElement#getLength() + */ + public int getLength() { + // TODO Auto-generated method stub + return 0; + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.KBElement#toString(java.lang.String, java.util.Map) + */ + public String toString(String baseURI, Map<String, String> prefixes) { + // TODO Auto-generated method stub + return null; + } + +} Added: trunk/src/dl-learner/org/dllearner/core/owl/DatatypeValueRestriction.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/DatatypeValueRestriction.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/owl/DatatypeValueRestriction.java 2008-02-11 19:01:36 UTC (rev 543) @@ -0,0 +1,28 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.core.owl; + +/** + * @author Jens Lehmann + * + */ +public class DatatypeValueRestriction extends ValueRestriction { + +} Added: trunk/src/dl-learner/org/dllearner/core/owl/DescriptionVisitor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/DescriptionVisitor.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/owl/DescriptionVisitor.java 2008-02-11 19:01:36 UTC (rev 543) @@ -0,0 +1,55 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.core.owl; + +/** + * Visitor for elements in complex class descriptions (it supports + * the currently relevant ones - needs to be extended when further + * constructs are needed). + * + * @author Jens Lehmann + * + */ +public interface DescriptionVisitor { + + public void visit(Negation description); + + public void visit(ObjectAllRestriction description); + + public void visit(ObjectSomeRestriction description); + + public void visit(Nothing description); + + public void visit(Thing description); + + public void visit(Intersection description); + + public void visit(Union description); + + public void visit(ObjectMinCardinalityRestriction description); + + public void visit(ObjectExactCardinalityRestriction description); + + public void visit(ObjectMaxCardinalityRestriction description); + + public void visit(ObjectValueRestriction description); + + public void visit(DatatypeValueRestriction description); +} Added: trunk/src/dl-learner/org/dllearner/core/owl/KBElementVisitor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/KBElementVisitor.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/owl/KBElementVisitor.java 2008-02-11 19:01:36 UTC (rev 543) @@ -0,0 +1,30 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.core.owl; + +/** + * Visitor for all elements of a knowledge base. + * + * @author Jens Lehmann + * + */ +public interface KBElementVisitor extends AxiomVisitor, DescriptionVisitor, PropertyExpressionVisitor { + +} Added: trunk/src/dl-learner/org/dllearner/core/owl/ObjectExactCardinalityRestriction.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/ObjectExactCardinalityRestriction.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/owl/ObjectExactCardinalityRestriction.java 2008-02-11 19:01:36 UTC (rev 543) @@ -0,0 +1,43 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.core.owl; + +import java.util.Map; + +/** + * @author Jens Lehmann + * + */ +public class ObjectExactCardinalityRestriction extends ObjectCardinalityRestriction { + + public ObjectExactCardinalityRestriction(int number, ObjectPropertyExpression role, Description c) { + super(number,role,c); + } + + @Override + public int getArity() { + return 1; + } + + public String toString(String baseURI, Map<String,String> prefixes) { + return "= " + number + " " + role.toString(baseURI, prefixes) + " " + getChild(0).toString(baseURI, prefixes); + } + +} Added: trunk/src/dl-learner/org/dllearner/core/owl/ObjectValueRestriction.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/ObjectValueRestriction.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/owl/ObjectValueRestriction.java 2008-02-11 19:01:36 UTC (rev 543) @@ -0,0 +1,28 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.core.owl; + +/** + * @author Jens Lehmann + * + */ +public class ObjectValueRestriction extends ValueRestriction { + +} Added: trunk/src/dl-learner/org/dllearner/core/owl/PropertyAxiomVisitor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/PropertyAxiomVisitor.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/owl/PropertyAxiomVisitor.java 2008-02-11 19:01:36 UTC (rev 543) @@ -0,0 +1,37 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.core.owl; + +/** + * Visitor for property (RBox) axioms. + * + * @author Jens Lehmann + * + */ +public interface PropertyAxiomVisitor { + + public void visit(FunctionalObjectPropertyAxiom axiom); + + public void visit(InverseObjectPropertyAxiom axiom); + + public void visit(SymmetricObjectPropertyAxiom axiom); + + public void visit(TransitiveObjectPropertyAxiom axiom); +} Added: trunk/src/dl-learner/org/dllearner/core/owl/PropertyExpressionVisitor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/PropertyExpressionVisitor.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/owl/PropertyExpressionVisitor.java 2008-02-11 19:01:36 UTC (rev 543) @@ -0,0 +1,36 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.core.owl; + +/** + * A visitor for property expression, which can occur in class + * descriptions. + * + * @author Jens Lehmann + * + */ +public interface PropertyExpressionVisitor { + + public void visit(ObjectProperty property); + + public void visit(ObjectPropertyInverse property); + + public void visit(DatatypeProperty property); +} Added: trunk/src/dl-learner/org/dllearner/core/owl/TerminologicalAxiomVisitor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/TerminologicalAxiomVisitor.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/owl/TerminologicalAxiomVisitor.java 2008-02-11 19:01:36 UTC (rev 543) @@ -0,0 +1,32 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.core.owl; + +/** + * @author Jens Lehmann + * + */ +public interface TerminologicalAxiomVisitor { + + public void visit(EquivalentClassesAxiom axiom); + + public void visit(SubClassAxiom axiom); + +} Added: trunk/src/dl-learner/org/dllearner/core/owl/ValueRestriction.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/ValueRestriction.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/owl/ValueRestriction.java 2008-02-11 19:01:36 UTC (rev 543) @@ -0,0 +1,55 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.core.owl; + +import java.util.Map; + +/** + * @author Jens Lehmann + * + */ +public class ValueRestriction extends Description { + + /* (non-Javadoc) + * @see org.dllearner.core.owl.Concept#getArity() + */ + @Override + public int getArity() { + // TODO Auto-generated method stub + return 0; + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.KBElement#getLength() + */ + public int getLength() { + // TODO Auto-generated method stub + return 0; + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.KBElement#toString(java.lang.String, java.util.Map) + */ + public String toString(String baseURI, Map<String, String> prefixes) { + // TODO Auto-generated method stub + return null; + } + +} Added: trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIConverterVisitor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIConverterVisitor.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIConverterVisitor.java 2008-02-11 19:01:36 UTC (rev 543) @@ -0,0 +1,284 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.reasoning; + +import java.net.URI; + +import org.dllearner.core.owl.ClassAssertionAxiom; +import org.dllearner.core.owl.DatatypeProperty; +import org.dllearner.core.owl.DatatypeValueRestriction; +import org.dllearner.core.owl.DoubleDatatypePropertyAssertion; +import org.dllearner.core.owl.EquivalentClassesAxiom; +import org.dllearner.core.owl.FunctionalObjectPropertyAxiom; +import org.dllearner.core.owl.Intersection; +import org.dllearner.core.owl.InverseObjectPropertyAxiom; +import org.dllearner.core.owl.KB; +import org.dllearner.core.owl.KBElementVisitor; +import org.dllearner.core.owl.Negation; +import org.dllearner.core.owl.Nothing; +import org.dllearner.core.owl.ObjectAllRestriction; +import org.dllearner.core.owl.ObjectExactCardinalityRestriction; +import org.dllearner.core.owl.ObjectMaxCardinalityRestriction; +import org.dllearner.core.owl.ObjectMinCardinalityRestriction; +import org.dllearner.core.owl.ObjectProperty; +import org.dllearner.core.owl.ObjectPropertyAssertion; +import org.dllearner.core.owl.ObjectPropertyInverse; +import org.dllearner.core.owl.ObjectSomeRestriction; +import org.dllearner.core.owl.ObjectValueRestriction; +import org.dllearner.core.owl.SubClassAxiom; +import org.dllearner.core.owl.SymmetricObjectPropertyAxiom; +import org.dllearner.core.owl.Thing; +import org.dllearner.core.owl.TransitiveObjectPropertyAxiom; +import org.dllearner.core.owl.Union; +import org.semanticweb.owl.model.AddAxiom; +import org.semanticweb.owl.model.OWLAxiom; +import org.semanticweb.owl.model.OWLDataFactory; +import org.semanticweb.owl.model.OWLIndividual; +import org.semanticweb.owl.model.OWLObjectProperty; +import org.semanticweb.owl.model.OWLOntology; +import org.semanticweb.owl.model.OWLOntologyChangeException; +import org.semanticweb.owl.model.OWLOntologyManager; + +/** + * A converter from DL-Learner format to OWL API format. + * + * @author Jens Lehmann + * + */ +public class OWLAPIConverterVisitor implements KBElementVisitor { + + OWLDataFactory factory; + private OWLOntology ontology; + private OWLOntologyManager manager; + + public OWLAPIConverterVisitor(OWLOntologyManager manager, OWLOntology ontology, KB kb) { + this.manager = manager; + this.ontology = ontology; + factory = manager.getOWLDataFactory(); + } + + private void addAxiom(OWLAxiom axiom) { + AddAxiom addAxiom = new AddAxiom(ontology, axiom); + try { + manager.applyChange(addAxiom); + } catch (OWLOntologyChangeException e) { + e.printStackTrace(); + } + } + + /* (non-Javadoc) + * @see org.dllearner.core.dl.AxiomVisitor#visit(org.dllearner.core.dl.ObjectPropertyAssertion) + */ + public void visit(ObjectPropertyAssertion axiom) { + OWLObjectProperty role = factory.getOWLObjectProperty( + URI.create(((ObjectPropertyAssertion) axiom).getRole().getName())); + OWLIndividual i1 = factory.getOWLIndividual( + URI.create(((ObjectPropertyAssertion) axiom).getIndividual1().getName())); + OWLIndividual i2 = factory.getOWLIndividual( + URI.create(((ObjectPropertyAssertion) axiom).getIndividual2().getName())); + OWLAxiom axiomOWLAPI = factory.getOWLObjectPropertyAssertionAxiom(i1, role, i2); + addAxiom(axiomOWLAPI); + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.AssertionalAxiomVisitor#visit(org.dllearner.core.owl.ClassAssertionAxiom) + */ + public void visit(ClassAssertionAxiom axiom) { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.AssertionalAxiomVisitor#visit(org.dllearner.core.owl.DoubleDatatypePropertyAssertion) + */ + public void visit(DoubleDatatypePropertyAssertion axiom) { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.PropertyAxiomVisitor#visit(org.dllearner.core.owl.FunctionalObjectPropertyAxiom) + */ + public void visit(FunctionalObjectPropertyAxiom axiom) { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.PropertyAxiomVisitor#visit(org.dllearner.core.owl.InverseObjectPropertyAxiom) + */ + public void visit(InverseObjectPropertyAxiom axiom) { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.PropertyAxiomVisitor#visit(org.dllearner.core.owl.SymmetricObjectPropertyAxiom) + */ + public void visit(SymmetricObjectPropertyAxiom axiom) { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.PropertyAxiomVisitor#visit(org.dllearner.core.owl.TransitiveObjectPropertyAxiom) + */ + public void visit(TransitiveObjectPropertyAxiom axiom) { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.TerminologicalAxiomVisitor#visit(org.dllearner.core.owl.EquivalentClassesAxiom) + */ + public void visit(EquivalentClassesAxiom axiom) { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.TerminologicalAxiomVisitor#visit(org.dllearner.core.owl.SubClassAxiom) + */ + public void visit(SubClassAxiom axiom) { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.DescriptionVisitor#visit(org.dllearner.core.owl.Negation) + */ + public void visit(Negation description) { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.DescriptionVisitor#visit(org.dllearner.core.owl.ObjectAllRestriction) + */ + public void visit(ObjectAllRestriction description) { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.DescriptionVisitor#visit(org.dllearner.core.owl.ObjectSomeRestriction) + */ + public void visit(ObjectSomeRestriction description) { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.DescriptionVisitor#visit(org.dllearner.core.owl.Nothing) + */ + public void visit(Nothing description) { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.DescriptionVisitor#visit(org.dllearner.core.owl.Thing) + */ + public void visit(Thing description) { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.DescriptionVisitor#visit(org.dllearner.core.owl.Intersection) + */ + public void visit(Intersection description) { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.DescriptionVisitor#visit(org.dllearner.core.owl.Union) + */ + public void visit(Union description) { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.DescriptionVisitor#visit(org.dllearner.core.owl.ObjectMinCardinalityRestriction) + */ + public void visit(ObjectMinCardinalityRestriction description) { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.DescriptionVisitor#visit(org.dllearner.core.owl.ObjectExactCardinalityRestriction) + */ + public void visit(ObjectExactCardinalityRestriction description) { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.DescriptionVisitor#visit(org.dllearner.core.owl.ObjectMaxCardinalityRestriction) + */ + public void visit(ObjectMaxCardinalityRestriction description) { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.DescriptionVisitor#visit(org.dllearner.core.owl.ObjectValueRestriction) + */ + public void visit(ObjectValueRestriction description) { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.DescriptionVisitor#visit(org.dllearner.core.owl.DatatypeValueRestriction) + */ + public void visit(DatatypeValueRestriction description) { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.PropertyExpressionVisitor#visit(org.dllearner.core.owl.ObjectProperty) + */ + public void visit(ObjectProperty property) { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.PropertyExpressionVisitor#visit(org.dllearner.core.owl.ObjectPropertyInverse) + */ + public void visit(ObjectPropertyInverse property) { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.PropertyExpressionVisitor#visit(org.dllearner.core.owl.DatatypeProperty) + */ + public void visit(DatatypeProperty property) { + // TODO Auto-generated method stub + + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |