Examples of rdf


Examples of org.apache.marmotta.commons.sesame.facading.annotations.RDF

        final String[] rdf_property;
        final boolean inverse;
        // look for RDF annotation and extract the property from it; if not on the getter, look
        // for the corresponding setter and check whether it has a @RDF annotation; if neither has,
        // throw an IllegalArgumentException
        RDF rdf = FacadingInvocationHelper.getAnnotation(method, RDF.class);
        if (rdf != null) {
            rdf_property = rdf.value();
            inverse = false;
            return new FacadingPredicate(inverse, rdf_property);
        } else {
            RDFInverse rdfi = FacadingInvocationHelper.getAnnotation(method, RDFInverse.class);
            if (rdfi != null) {
View Full Code Here

Examples of org.apache.marmotta.commons.sesame.facading.annotations.RDF

        final String[] rdf_property;
        final boolean inverse;
        // look for RDF annotation and extract the property from it; if not on the getter, look
        // for the corresponding setter and check whether it has a @RDF annotation; if neither has,
        // throw an IllegalArgumentException
        RDF rdf = FacadingInvocationHelper.getAnnotation(method, RDF.class);
        if (rdf != null) {
            rdf_property = rdf.value();
            inverse = false;
            return new FacadingPredicate(inverse, rdf_property);
        } else {
            RDFInverse rdfi = FacadingInvocationHelper.getAnnotation(method, RDFInverse.class);
            if (rdfi != null) {
View Full Code Here

Examples of org.apache.stanbol.enhancer.rdfentities.Rdf

            interfaceSet.add(clazz);
            getSuperInterfaces(clazz, interfaceSet);
        }
        this.interfaces = Collections.unmodifiableSet(interfaceSet); //nobody should be able to change this!
        for (Class<?> clazz : this.interfaces){
            Rdf classAnnotation = clazz.getAnnotation(Rdf.class);
            if(classAnnotation == null){
            } else { //check of the type statement is present
                UriRef typeRef = new UriRef(classAnnotation.id());
                if(!nodeTypes.contains(typeRef)){
                    //TODO: Question: How to get the dependencies for logging working with maven :(
                    //log.debug("add type "+typeRef+" for interface "+clazz+" to node "+rdfNode);
                    addValue(Properties.RDF_TYPE, typeRef); //add the missing type!
                } else {
View Full Code Here

Examples of org.apache.stanbol.enhancer.rdfentities.Rdf

        }
        //implement toString
        if(method.equals(toString)){
            return "Proxy for Node "+rdfNode+" and interfaces "+interfaces;
        }
        Rdf rdf = method.getAnnotation(Rdf.class);
        if(rdf == null){
            throw new IllegalStateException("Invoked Method does not have an Rdf annotation!");
        }
        UriRef property;
        if(rdf.id().startsWith("http://") || rdf.id().startsWith("urn:")){
            property = new UriRef(rdf.id());
        } else {
            throw new IllegalStateException("The id=\""+rdf.id()+"\"provided by the rdf annotation is not an valid URI");
        }
        //check for Write (Setter) Method
        if(method.getReturnType().equals(void.class)){
            Type[] parameterTypes = method.getGenericParameterTypes();
            //check the parameter types to improve error messages!
View Full Code Here

Examples of org.apache.stanbol.enhancer.servicesapi.helper.Rdf

            interfaceSet.add(clazz);
            getSuperInterfaces(clazz, interfaceSet);
        }
        this.interfaces = Collections.unmodifiableSet(interfaceSet); //nobody should be able to change this!
        for (Class<?> clazz : this.interfaces){
            Rdf classAnnotation = clazz.getAnnotation(Rdf.class);
            if(classAnnotation == null){
            } else { //check of the type statement is present
                UriRef typeRef = new UriRef(classAnnotation.id());
                if(!nodeTypes.contains(typeRef)){
                    //TODO: Question: How to get the dependencies for logging working with maven :(
                    //log.debug("add type "+typeRef+" for interface "+clazz+" to node "+rdfNode);
                    addValue(Properties.RDF_TYPE, typeRef); //add the missing type!
                } else {
View Full Code Here

Examples of org.apache.stanbol.enhancer.servicesapi.helper.Rdf

        }
        //implement toString
        if(method.equals(toString)){
            return "Proxy for Node "+rdfNode+" and interfaces "+interfaces;
        }
        Rdf rdf = method.getAnnotation(Rdf.class);
        if(rdf == null){
            throw new IllegalStateException("Invoked Method does not have an Rdf annotation!");
        }
        UriRef property;
        if(rdf.id().startsWith("http://") || rdf.id().startsWith("urn:")){
            property = new UriRef(rdf.id());
        } else {
            throw new IllegalStateException("The id=\""+rdf.id()+"\"provided by the rdf annotation is not an valid URI");
        }
        //check for Write (Setter) Method
        if(method.getReturnType().equals(void.class)){
            Type[] parameterTypes = method.getGenericParameterTypes();
            //check the parameter types to improve error messages!
View Full Code Here

Examples of org.evolizer.ontology.annotations.rdf

   * partial statement accordingly.
   *
   * @see IReflectionProvider.IVisitor#visit(Class, Object)
   */
  public void visit(Class<?> type, Object instance) {
    rdf annotation = type.getAnnotation(rdf.class);

    if(annotation == null) {
      mode = Mode.IGNORE;
      return;
    }
   
    if(RDFReflectionUtil.isPredicate(type)) {
      mode = Mode.PREDICATE;
     
      try {
        tmpStatement = new Statement<Object, Object>(null, annotation.value(), null);
      } catch (URISyntaxException e) {
        logger.error("Encountered an invalid uri for a property.", e);
      }
      // Do nothing else, but while visiting methods, we will look for @subject and @object tags.
    } else {
View Full Code Here

Examples of org.evolizer.ontology.annotations.rdf

   * @see IReflectionProvider.IVisitor#visit(Method, Class, Object)
   */
  public void visit(Method method, Class<?> definedIn, Object instance) {
    switch(mode) {
    case NORMAL:
      rdf annotation = method.getAnnotation(rdf.class);
      if(annotation != null) {
        Class<?> returnType = method.getReturnType();
        Object value = DefaultReflectionProvider.invoke(method, instance);
       
        IRDFPropertyConverter converter = ConverterRegistry.getConverterFor(returnType);
View Full Code Here

Examples of org.evolizer.ontology.annotations.rdf

  public static Resource rdfClassOf(Model model, Method method) {
    return model.createResource(uriReferenceOf(method));
  }
 
  public static String uriReferenceOf(Class<?> clazz) {
    rdf annotation = clazz.getAnnotation(rdf.class);
   
    return annotation.value();
  }
View Full Code Here

Examples of org.evolizer.ontology.annotations.rdf

   
    return annotation.value();
  }
 
  public static String uriReferenceOf(Method method) {
    rdf annotation = method.getAnnotation(rdf.class);
   
    return annotation.value();
  }
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.