Tabnine Logo
ModelUtils.asSet
Code IndexAdd Tabnine to your IDE (free)

How to use
asSet
method
in
org.apache.stanbol.entityhub.servicesapi.util.ModelUtils

Best Java code snippets using org.apache.stanbol.entityhub.servicesapi.util.ModelUtils.asSet (Showing top 3 results out of 315)

origin: apache/stanbol

/**
 * Checks if the parsed Entity can be wrapped by this EntityMapping wrapper.
 * Currently it checks only if the rdf:type entityhub:EntityMapping is
 * present
 * @param entity the entity to check
 * @return
 */
public static boolean isValid(Entity entity){
  if(entity != null){
    Set<Reference> types = ModelUtils.asSet(entity.getRepresentation().getReferences(RDF_TYPE));
    return types.contains(ENTITY_MAPPING_TYPE);
  } else {
    return false;
  }
}
/**
origin: org.apache.stanbol/org.apache.stanbol.entityhub.core

/**
 * Checks if the parsed Entity can be wrapped by this EntityMapping wrapper.
 * Currently it checks only if the rdf:type entityhub:EntityMapping is
 * present
 * @param entity the entity to check
 * @return
 */
public static boolean isValid(Entity entity){
  if(entity != null){
    Set<Reference> types = ModelUtils.asSet(entity.getRepresentation().getReferences(RDF_TYPE));
    return types.contains(ENTITY_MAPPING_TYPE);
  } else {
    return false;
  }
}
/**
origin: apache/stanbol

if(expectedFields != null){ //validate fields
  for(String field : expectedFields){
    Set<Object> expectedFieldValues = ModelUtils.asSet(
        data.representations.get(result.getId()).get(field));
    Iterator<Object> fieldValues = result.get(field);
org.apache.stanbol.entityhub.servicesapi.utilModelUtilsasSet

Javadoc

Copies all elements of the parsed Iterator to a HashSet. To use other Set implementations that HashSet you can use #addToSet(Iterator,Set)

Popular methods of ModelUtils

  • asCollection
    Copies all elements of the parsed Iterator to a ArrayList. To use other Set implementations that Arr
  • checkValues
    Processes a value parsed as object to the representation. This processing includes: * Removal of nu
  • getRepresentationInfo
    String representation of the parsed Representation inteded for DEBUG level loggings.
  • addToCollection
    Adds the elements of the Iterator to the parsed Collection
  • getNamespaceLocalName
    Splits up a URI in local name and namespace based on the following rules * If URI starts with "u
  • addToSet
    Adds the elements of the Iterator to the parsed Set
  • getAboutRepresentation
    Getter for the id of the Entity the parsed Representationare RdfResourceEnum#aboutRepresentation.
  • randomUUID
    TODO: Maybe we need a better way to generate unique IDs

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSystemService (Context)
  • runOnUiThread (Activity)
  • getResourceAsStream (ClassLoader)
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Collectors (java.util.stream)
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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