@Override
 public void visit(OWLLiteral node) {
   write("\"");
   write(node.getLiteral());
   write("\"\\^\\^");
   write(node.getDatatype().getIRI());
 }
 protected boolean isNonNegativeIntegerStrict(IRI mainNode, OWLRDFVocabulary predicate) {
   OWLLiteral literal = consumer.getLiteralObject(mainNode, predicate, false);
   if (literal == null) {
     return false;
   }
   OWLDatatype datatype = literal.getDatatype();
   OWL2Datatype nni = OWL2Datatype.XSD_NON_NEGATIVE_INTEGER;
   return datatype.getIRI().equals(nni.getIRI()) && nni.isInLexicalSpace(literal.getLiteral());
 }
 @Override
 protected int compareObjectOfSameType(OWLObject object) {
   OWLLiteral other = (OWLLiteral) object;
   int diff = getLiteral().compareTo(other.getLiteral());
   if (diff != 0) {
     return diff;
   }
   return datatype.compareTo(other.getDatatype());
 }
 @Override
 public void visit(OWLLiteral node) {
   node.getDatatype().accept(this);
   OWLDatatype dt = (OWLDatatype) obj;
   if (node.hasLang()) {
     obj = dataFactory.getOWLLiteral(node.getLiteral(), node.getLang());
   } else {
     obj = dataFactory.getOWLLiteral(node.getLiteral(), dt);
   }
 }
Example #5
0
 public boolean equals(Object obj) {
   if (super.equals(obj)) {
     if (!(obj instanceof OWLLiteral)) {
       return false;
     }
     OWLLiteral other = (OWLLiteral) obj;
     return literal.equals(other.getLiteral())
         && datatype.equals(other.getDatatype())
         && lang.equals(other.getLang());
   }
   return false;
 }
 private void appendTag(
     Paragraph tagParagraph, OWLLiteral literal, Color foreground, boolean isSelected) {
   Color tagColor = isSelected ? foreground : Color.GRAY;
   Color tagValueColor = isSelected ? foreground : Color.GRAY;
   if (literal.hasLang()) {
     tagParagraph.append("[language: ", tagColor);
     tagParagraph.append(literal.getLang(), tagValueColor);
     tagParagraph.append("]", tagColor);
   } else if (datatypeRendering == RENDER_DATATYPE_INLINE && !literal.isRDFPlainLiteral()) {
     tagParagraph.append("[type: ", tagColor);
     tagParagraph.append(
         editorKit.getOWLModelManager().getRendering(literal.getDatatype()), tagValueColor);
     tagParagraph.append("]", tagColor);
   }
   //        if (ontology != null) {
   //            tagParagraph.append("    ", foreground);
   //            tagParagraph.append("[in: ", tagColor);
   //            String ontologyRendering = editorKit.getOWLModelManager().getRendering(ontology);
   //            tagParagraph.append(ontologyRendering, tagColor);
   //            tagParagraph.append("]", tagColor);
   //        }
 }
 @Override
 public void visit(OWLLiteral node) {
   handleObject(node);
   node.getDatatype().accept(this);
 }
 public void visit(OWLLiteral node) {
   node.getDatatype().accept(this);
 }