Tabnine Logo
OWLDataFactory.getOWLTypedLiteral
Code IndexAdd Tabnine to your IDE (free)

How to use
getOWLTypedLiteral
method
in
org.semanticweb.owlapi.model.OWLDataFactory

Best Java code snippets using org.semanticweb.owlapi.model.OWLDataFactory.getOWLTypedLiteral (Showing top 20 results out of 315)

origin: net.sourceforge.owlapi/owlapi

public static OWLTypedLiteral TypedLiteral(String literal) {
  return dataFactory.getOWLTypedLiteral(literal);
}
origin: net.sourceforge.owlapi/owlapi

public static OWLTypedLiteral TypedLiteral(int literal) {
  return dataFactory.getOWLTypedLiteral(literal);
}
origin: net.sourceforge.owlapi/owlapi

public static OWLTypedLiteral TypedLiteral(boolean literal) {
  return dataFactory.getOWLTypedLiteral(literal);
}
origin: net.sourceforge.owlapi/owlapi

public static OWLTypedLiteral TypedLiteral(float literal) {
  return dataFactory.getOWLTypedLiteral(literal);
}
origin: net.sourceforge.owlapi/owlapi

public static OWLTypedLiteral TypedLiteral(double literal) {
  return dataFactory.getOWLTypedLiteral(literal);
}
origin: org.apache.stanbol/org.apache.stanbol.rules.manager

private SWRLLiteralArgument getSWRLTypedLiteral(OWLDataFactory factory, Object argument) {
  OWLLiteral owlLiteral;
  if (argument instanceof String) {
    owlLiteral = factory.getOWLTypedLiteral((String) argument);
  } else if (argument instanceof Integer) {
    owlLiteral = factory.getOWLTypedLiteral(((Integer) argument).intValue());
  } else if (argument instanceof Double) {
    owlLiteral = factory.getOWLTypedLiteral(((Double) argument).doubleValue());
  } else if (argument instanceof Float) {
    owlLiteral = factory.getOWLTypedLiteral(((Float) argument).floatValue());
  } else if (argument instanceof Boolean) {
    owlLiteral = factory.getOWLTypedLiteral(((Boolean) argument).booleanValue());
  } else {
    owlLiteral = factory.getOWLStringLiteral(argument.toString());
  }
  return factory.getSWRLLiteralArgument(owlLiteral);
}
origin: net.sourceforge.owlapi/owlapi

/**
 * Given a number, returns a typed constant that represent the number.
 *
 * @param val The number to be translated to a typed constant.
 * @return The typed constant, consisting of a string literal and datatype that
 *         corresponds to the translation of the specified number.
 */
public static <N extends Number> OWLTypedLiteral getTypedConstant(OWLDataFactory dataFactory, N val) {
  return dataFactory.getOWLTypedLiteral(val.toString(), getDatatype(dataFactory, val));
}
origin: net.sourceforge.owlapi/owlapi

private OWLLiteral process(OWLDataPropertyExpression prop, OWLLiteral con) {
  OWLDatatype dt = map.get(prop);
  if (dt != null) {
    return getDataFactory().getOWLTypedLiteral(con.getLiteral(), dt);
  } else {
    return con;
  }
}
origin: net.sourceforge.owlapi/owlapi

final public OWLLiteral parseLiteral() throws ParseException {
 Token t;
 if (jj_2_49(5)) {
  t = jj_consume_token(INT);
     {if (true) return factory.getOWLTypedLiteral(Integer.parseInt(t.image));}
 } else if (jj_2_50(5)) {
  t = jj_consume_token(DOUBLE);
       {if (true) return factory.getOWLTypedLiteral(Double.parseDouble(t.image));}
 } else {
  jj_consume_token(-1);
  throw new ParseException();
 }
 throw new Error("Missing return statement in function");
}
origin: net.sourceforge.owlapi/owlapi

public void visit(OWLTypedLiteral node) {
  node.getDatatype().accept(this);
  OWLDatatype dt = (OWLDatatype) obj;
  obj = dataFactory.getOWLTypedLiteral(node.getLiteral(), dt);
}
origin: net.sourceforge.owlapi/owlapi

final public OWLTypedLiteral TypedLiteral() throws ParseException {
 String literal;
 OWLDatatype datatype=null;
 literal = QuotedString();
 jj_consume_token(129);
 datatype = DatatypeIRI();
     {if (true) return dataFactory.getOWLTypedLiteral(literal, datatype);}
 throw new Error("Missing return statement in function");
}
origin: net.sourceforge.owlapi/owlapi

private OWLTypedLiteral toTypedConstant(int i) {
  return manager.getOWLDataFactory().getOWLTypedLiteral(Integer.toString(i), manager.getOWLDataFactory().getOWLDatatype(XSDVocabulary.NON_NEGATIVE_INTEGER.getIRI()));
}
origin: net.sourceforge.owlapi/owlapi

public void handleChild(OWLLiteralElementHandler handler) {
  if (handler.getOWLObject().isOWLTypedLiteral()) {
    constants.add((OWLTypedLiteral) handler.getOWLObject());
  } else {
    // Type as string?
    OWLLiteral currentLiteral = handler.getOWLObject();
    constants.add(getOWLDataFactory().getOWLTypedLiteral(currentLiteral.getLiteral()));
  }
}
origin: net.sourceforge.owlapi/owlapi

/**
 * A convenience method to obtain an <code>OWLConstant</code>
 *
 * @param literal The literal - must NOT be <code>null</code>
 * @param datatype The data type - may be <code>null</code>
 * @param lang The lang - may be <code>null</code>
 * @return The <code>OWLConstant</code> (either typed or untyped depending on the params)
 */
private OWLLiteral getOWLConstant(String literal, String datatype, String lang) {
  if (datatype != null) {
    return dataFactory.getOWLTypedLiteral(literal, dataFactory.getOWLDatatype(getIRI(datatype)));
  }
  else {
    return dataFactory.getOWLStringLiteral(literal, lang);
  }
}
origin: net.sourceforge.owlapi/owlapi

protected OWLLiteral getBooleanConstant(Boolean b) {
  if (b) {
    return getDataFactory().getOWLTypedLiteral("true",
        getDataFactory().getOWLDatatype(XSDVocabulary.BOOLEAN.getIRI()));
  } else {
    return getDataFactory().getOWLTypedLiteral("false",
        getDataFactory().getOWLDatatype(XSDVocabulary.BOOLEAN.getIRI()));
  }
}
origin: net.sourceforge.owlapi/owlapi

  public void handleTriple(IRI subject, IRI predicate, IRI object) throws UnloadableImportException {
    consumeTriple(subject, predicate, object);
    getConsumer().addRestriction(subject);
    // Patch to new OWL syntax
    getConsumer().addTriple(subject, OWLRDFVocabulary.OWL_HAS_SELF.getIRI(), getDataFactory().getOWLTypedLiteral(true));
  }
}
origin: net.sourceforge.owlapi/owlapi

public void endElement() throws OWLParserException, UnloadableImportException {
  if (iri != null) {
    literal = getOWLDataFactory().getOWLTypedLiteral(getText(), getOWLDataFactory().getOWLDatatype(iri));
  } else {
    literal = getOWLDataFactory().getOWLStringLiteral(getText(), lang);
  }
  lang = null;
  iri = null;
  getParentHandler().handleChild(this);
}
origin: net.sourceforge.owlapi/owlapi

public void visit(OWLObjectHasSelf desc) {
  translateAnonymousNode(desc);
  addTriple(desc, RDF_TYPE.getIRI(), OWL_RESTRICTION.getIRI());
  addTriple(desc, OWL_ON_PROPERTY.getIRI(), desc.getProperty());
  addTriple(desc, OWL_HAS_SELF.getIRI(), manager.getOWLDataFactory().getOWLTypedLiteral(true));
}
origin: com.github.monnetproject/ontology.owlapi

protected OWLLiteral convert(LiteralValue prop) {
  if (prop instanceof OWLAPILiteralValue) {
    return ((OWLAPILiteralValue) prop).lit;
  } else {
    if (prop.getLanguage() != null) {
      return factory.getOWLStringLiteral(prop.getValue(), prop.getLanguage().toString());
    } else if (prop.getDatatype() != null) {
      return factory.getOWLTypedLiteral(prop.getValue(), convert(prop.getDatatype()));
    } else {
      return factory.getOWLStringLiteral(prop.getValue());
    }
  }
}
origin: net.sourceforge.owlapi/owlapi

  public void handle(String id, String value) {
    // This is an annotation - but add as a label
    OWLEntity ent;
    if (getConsumer().isTerm()) {
      ent = getDataFactory().getOWLClass(getIRIFromValue(id));
    } else if (getConsumer().isTypedef()) {
      ent = getDataFactory().getOWLObjectProperty(getIRIFromValue(id));
    } else {
      ent = getDataFactory().getOWLNamedIndividual(getIRIFromValue(id));
    }
    OWLLiteral con = getDataFactory().getOWLTypedLiteral(value);
    OWLAxiom ax = getDataFactory().getOWLAnnotationAssertionAxiom(getDataFactory().getOWLAnnotationProperty(OWLRDFVocabulary.RDFS_LABEL.getIRI()), ent.getIRI(), con);
    applyChange(new AddAxiom(getOntology(), ax));
  }
}
org.semanticweb.owlapi.modelOWLDataFactorygetOWLTypedLiteral

Popular methods of OWLDataFactory

  • getOWLClass
    Gets an OWL class that has the specified IRI
  • getOWLNamedIndividual
    Gets an OWL individual that has the specified IRI
  • getOWLObjectProperty
    Gets an OWL object property that has the specified IRI
  • getOWLSubClassOfAxiom
  • getOWLClassAssertionAxiom
  • getOWLDataProperty
    Gets an OWL data property that has the specified IRI
  • getOWLThing
    Gets the built in owl:Thing class, which has a URI of
  • getOWLAnnotationProperty
    Gets an OWLAnnotationProperty that has the specified IRI
  • getOWLLiteral
    Convenience method that obtains a literal typed as a boolean.
  • getOWLDeclarationAxiom
    Gets a declaration with zero or more annotations for an entity
  • getOWLObjectIntersectionOf
  • getOWLEquivalentClassesAxiom
  • getOWLObjectIntersectionOf,
  • getOWLEquivalentClassesAxiom,
  • getOWLObjectSomeValuesFrom,
  • getOWLNothing,
  • getOWLObjectComplementOf,
  • getOWLObjectPropertyAssertionAxiom,
  • getOWLAnnotationAssertionAxiom,
  • getOWLDataPropertyAssertionAxiom,
  • getOWLDatatype,
  • getOWLAnnotation

Popular in Java

  • Updating database using SQL prepared statement
  • onCreateOptionsMenu (Activity)
  • putExtra (Intent)
  • getSupportFragmentManager (FragmentActivity)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • JOptionPane (javax.swing)
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now