001/** 002 * Copyright (C) 2007 - 2016, Jens Lehmann 003 * 004 * This file is part of DL-Learner. 005 * 006 * DL-Learner is free software; you can redistribute it and/or modify 007 * it under the terms of the GNU General Public License as published by 008 * the Free Software Foundation; either version 3 of the License, or 009 * (at your option) any later version. 010 * 011 * DL-Learner is distributed in the hope that it will be useful, 012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 014 * GNU General Public License for more details. 015 * 016 * You should have received a copy of the GNU General Public License 017 * along with this program. If not, see <http://www.gnu.org/licenses/>. 018 */ 019package org.dllearner.algorithms.el; 020 021import org.semanticweb.owlapi.model.OWLProperty; 022 023/** 024 * A (directed) edge in an EL concept tree. It consists of an edge 025 * label, which is an object property or data property, and the EL concept tree 026 * the edge points to. 027 * 028 * @author Jens Lehmann 029 * 030 */ 031public class ELDescriptionEdge<T extends OWLProperty> { 032 033 private T label; 034 035 private ELDescriptionNode node; 036 037 /** 038 * Constructs and edge given a label and an EL OWLClassExpression tree. 039 * @param label The label of this edge. 040 * @param tree The tree the edge points to (edges are directed). 041 */ 042 public ELDescriptionEdge(T label, ELDescriptionNode tree) { 043 this.label = label; 044 this.node = tree; 045 } 046 047 /** 048 * @param label the label to set 049 */ 050 public void setLabel(T label) { 051 this.label = label; 052 } 053 054 /** 055 * @return The label of this edge. 056 */ 057 public T getLabel() { 058 return label; 059 } 060 061 /** 062 * @return The EL OWLClassExpression tree 063 */ 064 public ELDescriptionNode getNode() { 065 return node; 066 } 067 068 public boolean isObjectProperty(){ 069 return label.isOWLObjectProperty(); 070 } 071 072 @Override 073 public String toString() { 074 return "--" + label + "--> " + node.toDescriptionString(); 075 } 076 077}