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

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

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

origin: apache/stanbol

  /**
   * Appends an URI if possible by using prefix:localName
   * @param builder the StringBuilder to add the URI MUST NOT be NULL
   * @param uri the URI to add MUST NOT be NULL
   */
  private static void appendUri(StringBuilder builder, String uri) {
    String[] namespaceLocal = ModelUtils.getNamespaceLocalName(uri);
    if(namespaceLocal[0]!=null){
      NamespaceEnum namespace = NamespaceEnum.forNamespace(namespaceLocal[0]);
      if(namespace != null){
        builder.append(namespace.getPrefix()).append(':');
      } else {
        builder.append(namespaceLocal[0]);
      }
    } //else no name space to add (e.g. if the pattern is "*")
    builder.append(namespaceLocal[1]);
  }
}
origin: org.apache.stanbol/org.apache.stanbol.entityhub.core

  /**
   * Appends an URI if possible by using prefix:localName
   * @param builder the StringBuilder to add the URI MUST NOT be NULL
   * @param uri the URI to add MUST NOT be NULL
   */
  private static void appendUri(StringBuilder builder, String uri) {
    String[] namespaceLocal = ModelUtils.getNamespaceLocalName(uri);
    if(namespaceLocal[0]!=null){
      NamespaceEnum namespace = NamespaceEnum.forNamespace(namespaceLocal[0]);
      if(namespace != null){
        builder.append(namespace.getPrefix()).append(':');
      } else {
        builder.append(namespaceLocal[0]);
      }
    } //else no name space to add (e.g. if the pattern is "*")
    builder.append(namespaceLocal[1]);
  }
}
origin: apache/stanbol

/**
 * This Method uses {@link #getNamespaceLocalName(String)} to split up
 * namespace and local name. It uses also the Data in the
 * {@link NamespaceEnum} to retrieve prefixes for Namespaces.
 * @param uri the URI
 * @return the QName
 */
public static QName getQName(String uri){
  String[] nsln = getNamespaceLocalName(uri);
  if(nsln[0] != null){
    NamespaceEnum entry = NamespaceEnum.forNamespace(nsln[0]);
    if(entry != null){
      return new QName(nsln[0], nsln[1],entry.getPrefix());
    } else {
      return new QName(nsln[0], nsln[1]);
    }
  } else {
    return new QName(nsln[1]);
  }
}
/**
origin: org.apache.stanbol/org.apache.stanbol.entityhub.servicesapi

/**
 * This Method uses {@link #getNamespaceLocalName(String)} to split up
 * namespace and local name. It uses also the Data in the
 * {@link NamespaceEnum} to retrieve prefixes for Namespaces.
 * @param uri the URI
 * @return the QName
 */
public static QName getQName(String uri){
  String[] nsln = getNamespaceLocalName(uri);
  if(nsln[0] != null){
    NamespaceEnum entry = NamespaceEnum.forNamespace(nsln[0]);
    if(entry != null){
      return new QName(nsln[0], nsln[1],entry.getPrefix());
    } else {
      return new QName(nsln[0], nsln[1]);
    }
  } else {
    return new QName(nsln[1]);
  }
}
/**
origin: org.apache.stanbol/org.apache.stanbol.entityhub.yard.solr

while (fields.hasNext()) {
  String field = fields.next();
  String[] namespaceLocalName = ModelUtils.getNamespaceLocalName(field);
origin: apache/stanbol

while (fields.hasNext()) {
  String field = fields.next();
  String[] namespaceLocalName = ModelUtils.getNamespaceLocalName(field);
org.apache.stanbol.entityhub.servicesapi.utilModelUtilsgetNamespaceLocalName

Javadoc

Splits up a URI in local name and namespace based on the following rules
  • If URI starts with "urn:" and last index of ':' == 3 than the there is no namespace and the whole URI is a local name
  • if the uri starts with "urn:" and the last index of ':' ia > 3, than the last index ':' is used.
  • split by the last index of '#' if index >= 0
  • split by the last index of '/' if index >= 0
  • return after the first split
  • return the whole URI as local name if no split was performed.

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
  • asSet
    Copies all elements of the parsed Iterator to a HashSet. To use other Set implementations that HashS
  • 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

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (ScheduledExecutorService)
  • requestLocationUpdates (LocationManager)
  • scheduleAtFixedRate (Timer)
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • JTable (javax.swing)
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Best plugins for Eclipse
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