Examples of RDFSClass


Examples of com.clarkparsia.empire.annotation.RdfsClass

   
    if (!BeanReflectUtil.hasAnnotation(clazz2, RdfsClass.class)) {
      return false;
    }
   
    RdfsClass rdfsClass1 = BeanReflectUtil.getAnnotation(clazz1, RdfsClass.class);
    RdfsClass rdfsClass2 = BeanReflectUtil.getAnnotation(clazz2, RdfsClass.class);
   
    String type1 = PrefixMapping.GLOBAL.uri(rdfsClass1.value());
    String type2 = PrefixMapping.GLOBAL.uri(rdfsClass2.value());
   
    return type1.equals(type2);
  }
View Full Code Here

Examples of com.clarkparsia.empire.annotation.RdfsClass

      LOGGER.debug("Class valid check {} ms ", (System.currentTimeMillis() - start));
    }

    start = System.currentTimeMillis();
   
    RdfsClass aClass = theClass.getAnnotation(RdfsClass.class);

    if (LOGGER.isDebugEnabled()) {
      LOGGER.debug("Got annotation in {} ms ", (System.currentTimeMillis() - start));
    }

    start = System.currentTimeMillis();
   
    // this init should be handled by the static block in RdfGenerator, but if there is no annotation index,
    // or RdfGenerator has not been referenced, the namespace stuff will not have been initialized.  so we'll
    // call this here as a backup.
    RdfGenerator.addNamespaces(theClass);

    QueryBuilder<ParsedTupleQuery> aQuery = QueryBuilderFactory.select("result").distinct()
        .group().atom("result", RDF.TYPE, ValueFactoryImpl.getInstance().createURI(PrefixMapping.GLOBAL.uri(aClass.value()))).closeGroup();

    if (LOGGER.isDebugEnabled()) {
      LOGGER.debug("Created query in {} ms ", (System.currentTimeMillis() - start));
    }
View Full Code Here

Examples of edu.stanford.smi.protegex.owl.model.RDFSClass

   * @return The <code>Nodes</code> label.
   */
  public String getLabel(Node node) {
    Object obj = node.getUserObject();
    if(obj instanceof RDFSClass) {
      RDFSClass cls = (RDFSClass) obj;
      return cls.getBrowserText();
    }
    else if(obj instanceof OWLIndividual) {
      OWLIndividual owlInstance = (OWLIndividual) obj;
      return owlInstance.getBrowserText();
    }
View Full Code Here

Examples of edu.stanford.smi.protegex.owl.model.RDFSClass

  /**
   * remove restriction
   */
  public void removeNecessaryRestriction(IRestriction res) {
    if(cls instanceof OWLNamedClass){
      RDFSClass r = getResource(res);
      // if this restriction is attached to more then one class
      // then try just to remove its parent status
      // else simply remove it
      if(r.getSubclassCount() > 1){
        RDFSClass clone = r.createClone();
        // re-add clone to subclasses
        for(Object c : r.getSubclasses(false)){
          if(c instanceof OWLNamedClass && !c.equals(cls)){
            ((OWLNamedClass)c).addSuperclass(clone);
          }
View Full Code Here

Examples of edu.stanford.smi.protegex.owl.model.RDFSClass

   */
  private OWLAnonymousClass [] getEquivalentRestrictionClasses(){
    if(cls instanceof OWLNamedClass){
      List<OWLAnonymousClass> list = new ArrayList<OWLAnonymousClass>();
      for(Object obj: ((OWLNamedClass)cls).getEquivalentClasses()){
        RDFSClass cls = (RDFSClass) obj;
        if(cls instanceof OWLAnonymousClass)
          list.add((OWLAnonymousClass)cls);
      }
      return list.toArray(new OWLAnonymousClass [0]);
    }
View Full Code Here

Examples of edu.stanford.smi.protegex.owl.model.RDFSClass

  public ILogicExpression getNecessaryRestrictions(){
    ILogicExpression exp = new LogicExpression(ILogicExpression.AND);
    if(cls instanceof OWLNamedClass){
      Collection list = cls.getEquivalentClasses();
      for(Object o: ((OWLNamedClass) cls).getSuperclasses(true)){
        RDFSClass c = (RDFSClass) o;
        if(c.isAnonymous() && !list.contains(c)){
          exp.add(convertParameter(c));
        }
      }
    }
    return exp;
View Full Code Here

Examples of edu.stanford.smi.protegex.owl.model.RDFSClass

  public ILogicExpression getDirectNecessaryRestrictions(){
    ILogicExpression exp = new LogicExpression(ILogicExpression.AND);
    if(cls instanceof OWLNamedClass){
      Collection list = cls.getEquivalentClasses();
      for(Object o: ((OWLNamedClass) cls).getSuperclasses(false)){
        RDFSClass c = (RDFSClass) o;
        if(c.isAnonymous() && !list.contains(c)){
          exp.add(convertParameter(c));
        }
      }
    }
    return exp;
View Full Code Here

Examples of edu.stanford.smi.protegex.owl.model.RDFSClass

        }
      }
      return exp;
    // we might have a complement
    }else if(resource instanceof OWLComplementClass){
      RDFSClass c = ((OWLComplementClass)resource).getComplement();
      return new LogicExpression(ILogicExpression.NOT,convertParameter(c));
    }
    // default just container that contains this
    return super.getLogicExpression();
  }
View Full Code Here

Examples of edu.stanford.smi.protegex.owl.model.RDFSClass

   */
  protected IClass [] getClasses(Collection list){
    Set<IClass> c = new LinkedHashSet<IClass>();
    for(Object o: list){
      if(o instanceof RDFSClass){
        RDFSClass cls = (RDFSClass)o;
        //System.out.println("get class "+cls.getBrowserText()+" "+cls.getClass().getName());
        if(!cls.isSystem() || cls.equals(cls.getOWLModel().getOWLThingClass())){
          c.add(new PClass(cls,getOntology()));
        }
      }
    }
    return (IClass []) c.toArray(new IClass [0]);
View Full Code Here

Examples of edu.stanford.smi.protegex.owl.model.RDFSClass

  /**
   * remove restriction
   */
  public void removeNecessaryRestriction(IRestriction res) {
    if(cls instanceof OWLNamedClass){
      RDFSClass r = getResource(res);
      // if this restriction is attached to more then one class
      // then try just to remove its parent status
      // else simply remove it
      if(r.getSubclassCount() > 1){
        RDFSClass clone = r.createClone();
        // re-add clone to subclasses
        for(Object c : r.getSubclasses(false)){
          if(c instanceof OWLNamedClass && !c.equals(cls)){
            ((OWLNamedClass)c).addSuperclass(clone);
          }
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.