public void internalise(AbsObject absObj, Ontology onto)
     throws UngroundedException, OntologyException {
   try {
     AbsConcept abs = (AbsConcept) absObj;
     apliesTo = (List) onto.toObject(abs.getAbsObject(CBRTerminologyOntology.ATTRIBUTE_APLIESTO));
     describedBy =
         (List) onto.toObject(abs.getAbsObject(CBRTerminologyOntology.ATTRIBUTE_DESCRIBEDBY));
     definition =
         (String) onto.toObject(abs.getAbsObject(CBRTerminologyOntology.ATTRIBUTE_DEFINITION));
     term = (String) onto.toObject(abs.getAbsObject(CBRTerminologyOntology.ATTRIBUTE_TERM));
   } catch (ClassCastException cce) {
     throw new OntologyException("Error internalising Attribute");
   }
 }
 public void externalise(AbsObject absObj, Ontology onto) throws OntologyException {
   try {
     AbsConcept abs = (AbsConcept) absObj;
     abs.set(CBRTerminologyOntology.ATTRIBUTE_APLIESTO, (AbsTerm) onto.fromObject(getApliesTo()));
     abs.set(
         CBRTerminologyOntology.ATTRIBUTE_DESCRIBEDBY,
         (AbsTerm) onto.fromObject(getDescribedBy()));
     abs.set(
         CBRTerminologyOntology.ATTRIBUTE_DEFINITION, (AbsTerm) onto.fromObject(getDefinition()));
     abs.set(CBRTerminologyOntology.ATTRIBUTE_TERM, (AbsTerm) onto.fromObject(getTerm()));
   } catch (ClassCastException cce) {
     throw new OntologyException("Error externalising Attribute");
   }
 }
 public void externalise(AbsObject absObj, Ontology onto) throws OntologyException {
   try {
     AbsConcept abs = (AbsConcept) absObj;
     abs.set(
         CommonTerminologyOntology.QUANTITATIVECHARACTERDESCRIPTOR_SCORE,
         (AbsTerm) onto.fromObject(getScore()));
     abs.set(
         CommonTerminologyOntology.QUANTITATIVECHARACTERDESCRIPTOR_ATTRIBUTE,
         (AbsTerm) onto.fromObject(getAttribute()));
     abs.set(
         CommonTerminologyOntology.QUANTITATIVECHARACTERDESCRIPTOR_STRUCTURE,
         (AbsTerm) onto.fromObject(getStructure()));
   } catch (ClassCastException cce) {
     throw new OntologyException("Error externalising QuantitativeCharacterDescriptor");
   }
 }
Example #4
0
 /**
  * Extracts sentence objects out of a text container and/or a parser state.
  *
  * @param tc The text container.
  * @param parser The parser object with the parsed text.
  * @param article The article of the sentences.
  * @return A list of sentences.
  */
 public List<Sentence> extractSentences(
     TextContainer tc, PredictiveParser parser, Article article) {
   List<Sentence> l = ontology.getLanguageHandler().extractSentences(tc, parser);
   for (Sentence s : l) {
     s.init(ontology, article);
   }
   return l;
 }
 public void internalise(AbsObject absObj, Ontology onto)
     throws UngroundedException, OntologyException {
   try {
     AbsConcept abs = (AbsConcept) absObj;
     score =
         (List)
             onto.toObject(
                 abs.getAbsObject(
                     CommonTerminologyOntology.QUANTITATIVECHARACTERDESCRIPTOR_SCORE));
     attribute =
         (Attribute)
             onto.toObject(
                 abs.getAbsObject(
                     CommonTerminologyOntology.QUANTITATIVECHARACTERDESCRIPTOR_ATTRIBUTE));
     structure =
         (Object)
             onto.toObject(
                 abs.getAbsObject(
                     CommonTerminologyOntology.QUANTITATIVECHARACTERDESCRIPTOR_STRUCTURE));
   } catch (ClassCastException cce) {
     throw new OntologyException("Error internalising QuantitativeCharacterDescriptor");
   }
 }
Example #6
0
 /**
  * Creates a hierarchy sentence.
  *
  * @param subConc The sub-concept.
  * @param superConc The super-concept.
  * @return A new hierarchy sentence.
  */
 public Sentence createHierarchySentence(Concept subConc, Concept superConc) {
   Sentence s = ontology.getEngine().createHierarchySentence(subConc, superConc);
   s.init(ontology, null);
   return s;
 }
Example #7
0
 /**
  * Creates an assignement sentence.
  *
  * @param ind The individual.
  * @param conc The concept.
  * @return A new assignement sentence.
  */
 public Sentence createAssignmentSentence(Individual ind, Concept conc) {
   Sentence s = ontology.getEngine().createAssignmentSentence(ind, conc);
   s.init(ontology, null);
   return s;
 }
Example #8
0
 /**
  * Creates a new sentence object with the given article.
  *
  * @param serialized The serialized representation of the sentence.
  * @param article The article.
  * @return A new sentence object.
  */
 public Sentence createSentence(String serialized, Article article) {
   Sentence s = ontology.getEngine().createSentence(serialized);
   s.init(ontology, article);
   return s;
 }