Package com.clarkparsia.empire.annotation

Examples of com.clarkparsia.empire.annotation.NamedGraph


   * on the specified named graph.
   * @param theObj the object to check
   * @return true if it has a named graph specified, false otherwise
   */
  public static boolean hasNamedGraphSpecified(Object theObj) {
    NamedGraph aAnnotation = theObj.getClass().getAnnotation(NamedGraph.class);

    return aAnnotation != null &&
         (aAnnotation.type() == NamedGraph.NamedGraphType.Instance || (aAnnotation.type() == NamedGraph.NamedGraphType.Static
                                       && !aAnnotation.value().equals("")));
  }
View Full Code Here


  public static java.net.URI getNamedGraph(Object theObj) {
    if (!hasNamedGraphSpecified(theObj)) {
      return null;
    }

    NamedGraph aAnnotation = theObj.getClass().getAnnotation(NamedGraph.class);

    if (aAnnotation.type() == NamedGraph.NamedGraphType.Instance) {
      SupportsRdfId aId = asSupportsRdfId(theObj);

      try {
        return asURI(aId);
      }
      catch (URISyntaxException e) {
        LOGGER.warn("There was an error trying to get the instance-level named graph URI from an object.  Its key is not a URI.", e);
        return null;
      }
    }
    else {
      return URI.create(aAnnotation.value());
    }
  }
View Full Code Here

TOP

Related Classes of com.clarkparsia.empire.annotation.NamedGraph

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.