Package com.hp.hpl.jena.ontology

Examples of com.hp.hpl.jena.ontology.OntClass.addSuperClass()


  }
 
  public static Resource toList(OntModel ont, String type, String itemType) {
    OntClass c = ont.createClass(type);
    Resource i = ont.getResource(itemType);
    c.addSuperClass(RDF.List);     
    c.addSuperClass(ont.createAllValuesFromRestriction(null,RDF.first,i));
    c.addSuperClass(ont.createAllValuesFromRestriction(null,RDF.rest,c));
    return c;   
  }
 
View Full Code Here


 
  public static Resource toList(OntModel ont, String type, String itemType) {
    OntClass c = ont.createClass(type);
    Resource i = ont.getResource(itemType);
    c.addSuperClass(RDF.List);     
    c.addSuperClass(ont.createAllValuesFromRestriction(null,RDF.first,i));
    c.addSuperClass(ont.createAllValuesFromRestriction(null,RDF.rest,c));
    return c;   
  }
 
  public static void removeSubClass(OntModel ont, Resource c, Resource d) {
View Full Code Here

  public static Resource toList(OntModel ont, String type, String itemType) {
    OntClass c = ont.createClass(type);
    Resource i = ont.getResource(itemType);
    c.addSuperClass(RDF.List);     
    c.addSuperClass(ont.createAllValuesFromRestriction(null,RDF.first,i));
    c.addSuperClass(ont.createAllValuesFromRestriction(null,RDF.rest,c));
    return c;   
  }
 
  public static void removeSubClass(OntModel ont, Resource c, Resource d) {
    ont.remove(ont.createStatement(c,RDFS.subClassOf,d));
View Full Code Here

    // we don't like anonymous lists
    if (uri==null || (type!=null && type.startsWith(schema.XSD_URI) && !schema.isValidDatatype(type))) {
      // pass over anonymous simple types
      if (uri!=null) {
        cls = ont.createClass(uri);
        cls.addSuperClass(RDF.List);   
        return cls;
      } else return RDF.List;
    }
   
    // the type may be null for embedded simpleType
View Full Code Here

    else first = schema.toOWL(ont,type);
   
    if (uri!=null || createAnon) {
      cls = ont.createClass(uri);
      if (uri!=null) ctx.putOntClass(uri, cls);
      cls.addSuperClass(RDF.List);   
      if (first!=null) {
        // add the item type as range of rdf:first
        cls.addSuperClass(ont.createAllValuesFromRestriction(null,RDF.first,first));
        // add the class itself as the range of rdf:rest
        cls.addSuperClass(ont.createAllValuesFromRestriction(null,RDF.rest,cls));
View Full Code Here

      cls = ont.createClass(uri);
      if (uri!=null) ctx.putOntClass(uri, cls);
      cls.addSuperClass(RDF.List);   
      if (first!=null) {
        // add the item type as range of rdf:first
        cls.addSuperClass(ont.createAllValuesFromRestriction(null,RDF.first,first));
        // add the class itself as the range of rdf:rest
        cls.addSuperClass(ont.createAllValuesFromRestriction(null,RDF.rest,cls));
      }
    }
    return cls;
View Full Code Here

      cls.addSuperClass(RDF.List);   
      if (first!=null) {
        // add the item type as range of rdf:first
        cls.addSuperClass(ont.createAllValuesFromRestriction(null,RDF.first,first));
        // add the class itself as the range of rdf:rest
        cls.addSuperClass(ont.createAllValuesFromRestriction(null,RDF.rest,cls));
      }
    }
    return cls;
  }
 
View Full Code Here

    if (base!=null) {
      if (schema.isValidDatatype(base)) {
        // pass over anonymous simple types
        if (uri==null) return xs.ont.getResource(base);
        OntClass cls = xs.ont.createClass(uri);
        cls.addSuperClass(xs.ont.getResource(base));
        return cls;
       
      }
      else return null;
    }
View Full Code Here

      else return null;
    }

    OntClass cls = null;   
    ctx.putOntClass(uri, cls = xs.ont.createClass(uri));
    if (base!=null) cls.addSuperClass(xs.ont.getResource(base));   
    subClassSimpleType(cls,ctx);
    return cls;
  }

  /*! \page restrictionComplexContent Restriction of complex content
View Full Code Here

   
    private void addSuperClass(OWLClass subclass, Resource superClass) {
    OntClass subClass = (OntClass) ((Resource)subclass.getImplementation()).as(OntClass.class);
    if (superClass.getURI()!=null) {
//      subClass.setSuperClass(superClass);
      subClass.addSuperClass(superClass);
      debugDisplay("Superclass of " + subclass.toPrettyString() + " is " + superClass.getURI());
    }
    }
   
    private OWLClass addClass(OWLClass clazz) {
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.