Examples of rdf


Examples of org.evolizer.ontology.annotations.rdf

  public static Resource rdfInstanceOf(Model model, Object object) {
    return OntologyProvider.rdfInstanceOf(model, fragmentIdentifier(object), rdfClassOf(model, object));
  }
 
  public static boolean isPredicate(Class<?> clazz) {
    rdf annotation = clazz.getAnnotation(rdf.class);
    return annotation.isPredicate();
  }
View Full Code Here

Examples of org.evolizer.ontology.annotations.rdf

    List<Method> result = new ArrayList<Method>();
   
    Iterator<Method> iter = ClassRegistry.methodsFor(type);
    while(iter.hasNext()) {
      Method method = iter.next();
      rdf annotation = method.getAnnotation(rdf.class);
      if(annotation != null) {
        String uriReference = annotation.value();
        boolean isContainment = OntologyProvider.hasSuperProperty(uriReference, "http://www.evolizer.org.com/ontology/relations.owl#contains");
        if(isContainment) {
          result.add(method);
        }
      }
View Full Code Here

Examples of org.evolizer.ontology.annotations.rdf

  @Test
  public void testIfAnnotationPresent() throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
    FoafPerson michael = new FoafPerson("Michael", "Wuersch");
   
    Class<? extends FoafPerson> pClass = michael.getClass();
    rdf annoPerson = pClass.getAnnotation(rdf.class);
    assertEquals("value of @rdf for Person is unexpected", FoafPerson.foaf + "Person", annoPerson.value());
   
    Method methodGetFirstName = pClass.getMethod("getFirstName");
    Method methodGetFamilyName = pClass.getMethod("getFamilyName");
   
    assertEquals("value of first name is unexpected", "Michael", methodGetFirstName.invoke(michael));
    assertEquals("value of family name is unexpected", "Wuersch", methodGetFamilyName.invoke(michael));
   
    rdf annoName = methodGetFirstName.getAnnotation(rdf.class);
    assertEquals("value of @rdf for getFirstName is unexpected", FoafPerson.foaf + "firstName", annoName.value());
   
    rdf annoFamilyName = methodGetFamilyName.getAnnotation(rdf.class);
    assertEquals("value of @rdf for getFamilyName is unexpected", FoafPerson.foaf + "family_name", annoFamilyName.value());
   
    FoafPerson gigs = new FoafPerson("Emanuel", "Giger");
   
    PersonToPersonRelationship coworking = new PersonToPersonRelationship(michael, gigs);
   
    Class<? extends PersonToPersonRelationship> ptpClass = coworking.getClass();
    rdf annoPtP = ptpClass.getAnnotation(rdf.class);
    assertEquals("isPredicate of @rdf for PersonToPersonRelationship is unexpected", true, annoPtP.isPredicate());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.