Package org.wikier.trioo.jtrioo.annotations

Examples of org.wikier.trioo.jtrioo.annotations.RdfResource


  }
     
  @SuppressWarnings("rawtypes")
  public static RDFMetaResource getRDFMetaResource(Class resourceClass) throws NotRegistrableRDFClassException {
    AnnotatedElement annotatedClass = (AnnotatedElement) resourceClass;
    RdfResource classResource = annotatedClass.getAnnotation(RdfResource.class);
    if (classResource == null) {
      throw new NotRegistrableRDFClassException(resourceClass.getCanonicalName());
    }
   
    RDFMetaResource resource = new RDFMetaResource(resourceClass);
   
    //URI
    try {
      MetaURI metauri = new MetaURI(resourceClass);
      resource.setMetaURI(metauri);
    } catch (IllegalArgumentException e) {
      logger.error("Invalid URI definition for " + resourceClass.getCanonicalName() + ", so resources of this class will be blank nodes: " + e);
    }
   
    //rdf:type
    resource.setRdfType(classResource.rdftype());
   
    //properties on fields
    for (Field field : resourceClass.getDeclaredFields()) {
      AnnotatedElement annotatedElement = (AnnotatedElement) field;
      RdfProperty propertyResource = annotatedElement.getAnnotation(RdfProperty.class);
View Full Code Here

TOP

Related Classes of org.wikier.trioo.jtrioo.annotations.RdfResource

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.