org.dllearner.core
Class EvaluatedDescription

java.lang.Object
  extended by org.dllearner.core.EvaluatedDescription
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
EvaluatedDescriptionClass, EvaluatedDescriptionPosNeg, EvaluatedDescriptionPosOnly

public class EvaluatedDescription
extends Object
implements Serializable

An evaluated description is a description and its score (with some convenience method and serialisation formats).

Author:
Jens Lehmann
See Also:
Serialized Form

Constructor Summary
EvaluatedDescription(Description description, Score score)
          Constructs an evaluated description using its score.
 
Method Summary
 String asJSON()
          This convenience method can be used to store and exchange evaluated descriptions by transforming them to a JSON string.
 double getAccuracy()
           
 Description getDescription()
          Gets the description, which was evaluated.
 int getDescriptionDepth()
           
 int getDescriptionLength()
           
 String getSparqlQuery(int limit)
          Returns a SPARQL query to get instances of this description from a SPARQL endpoint.
 void setDescription(Description description)
          Used for rewriting (simplification, beautification) of evaluated descriptions returned by the learning algorithm.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EvaluatedDescription

public EvaluatedDescription(Description description,
                            Score score)
Constructs an evaluated description using its score.

Parameters:
description - The description, which was evaluated.
score - The score of the description.
Method Detail

getDescription

public Description getDescription()
Gets the description, which was evaluated.

Returns:
The underlying description.

setDescription

public void setDescription(Description description)
Used for rewriting (simplification, beautification) of evaluated descriptions returned by the learning algorithm.

Parameters:
description - The description to set.

getDescriptionLength

public int getDescriptionLength()
Returns:
Length of the description.
See Also:
KBElement.getLength()

getDescriptionDepth

public int getDescriptionDepth()
Returns:
Depth of the description.
See Also:
Description.getDepth()

getAccuracy

public double getAccuracy()
Returns:
Value in this score system.
See Also:
org.dllearner.core.Score#getScoreValue()

getSparqlQuery

public String getSparqlQuery(int limit)
Returns a SPARQL query to get instances of this description from a SPARQL endpoint. Of course, results may be incomplete, because no inference is done. The SPARQL query is a straightforward translation without any attempts to perform e.g. subclass inferencing.

Parameters:
limit - The maximum number of results. Corresponds to LIMIT in SPARQL.
Returns:
A SPARQL query of the underlying description.

asJSON

public String asJSON()
This convenience method can be used to store and exchange evaluated descriptions by transforming them to a JSON string.

Returns:
A JSON representation of an evaluated description.

toString

public String toString()
Overrides:
toString in class Object


SourceForge.net Logo DL-Learner is licenced under the terms of the GNU General Public License.
Copyright © 2007-2011 Jens Lehmann