Exemplo n.º 1
0
 protected Map<Individual, SortedSet<Boolean>> getBooleanDatatypeMembersImpl(
     DatatypeProperty datatypeProperty) throws ReasoningMethodUnsupportedException {
   Map<Individual, SortedSet<Constant>> mapping = getDatatypeMembersImpl(datatypeProperty);
   Map<Individual, SortedSet<Boolean>> ret = new TreeMap<Individual, SortedSet<Boolean>>();
   for (Entry<Individual, SortedSet<Constant>> e : mapping.entrySet()) {
     SortedSet<Constant> values = e.getValue();
     SortedSet<Boolean> valuesBoolean = new TreeSet<Boolean>();
     for (Constant c : values) {
       String s = c.getLiteral();
       if (s.equalsIgnoreCase("true")) {
         valuesBoolean.add(true);
       } else if (s.equalsIgnoreCase("false")) {
         valuesBoolean.add(false);
       } else {
         logger.warn(
             "Requested to parse boolean value of property "
                 + datatypeProperty
                 + ", but "
                 + c
                 + " could not be parsed successfully.");
       }
     }
     ret.put(e.getKey(), valuesBoolean);
   }
   return ret;
 }
Exemplo n.º 2
0
 protected Map<Individual, SortedSet<String>> getStringDatatypeMembersImpl(
     DatatypeProperty datatypeProperty) throws ReasoningMethodUnsupportedException {
   Map<Individual, SortedSet<Constant>> mapping = getDatatypeMembersImpl(datatypeProperty);
   Map<Individual, SortedSet<String>> ret = new TreeMap<Individual, SortedSet<String>>();
   for (Entry<Individual, SortedSet<Constant>> e : mapping.entrySet()) {
     SortedSet<Constant> values = e.getValue();
     SortedSet<String> valuesString = new TreeSet<String>();
     for (Constant c : values) {
       valuesString.add(c.getLiteral());
     }
     ret.put(e.getKey(), valuesString);
   }
   return ret;
 }