Examples of PrefixManager


Examples of org.deri.grefine.rdf.vocab.PrefixManager

  protected void init(File workingDir) throws IOException, JSONException{
    this.workingDir = workingDir;
    this.vocabularySearcher = new VocabularySearcher(this.workingDir);
    this.predefinedVocabularyManager = new PredefinedVocabularyManager(this,this.workingDir);
    InputStream in = this.getClass().getResourceAsStream("/files/prefixes");
    this.prefixManager = new PrefixManager(in);
  }
View Full Code Here

Examples of org.deri.grefine.reconcile.util.PrefixManager

  //TODO ... ugly, isn't it?
  static public synchronized void initialize(File workingDir) throws JSONException, IOException{
    if(singleton==null){
      InputStream prefixesIn = GRefineServiceManager.class.getResourceAsStream("/files/prefixes");
      PrefixManager prefixManager = new PrefixManager(prefixesIn);
      singleton = new GRefineServiceManager(new ServiceRegistry(new GRefineJsonUtilitiesImpl(),prefixManager), workingDir);
      File servicesFile= new File(workingDir,"services");
      if(servicesFile.exists()){
        FileInputStream in = new FileInputStream(servicesFile);
        singleton.registry.loadFromFile(in);       
View Full Code Here

Examples of org.semanticweb.owlapi.model.PrefixManager

            TurtleDocumentFormat format = new TurtleDocumentFormat();
            consumer.setOntologyFormat(format);
            consumer.startModel(documentSource.getDocumentIRI());
            parser.setTripleHandler(consumer);
            parser.parseDocument();
            PrefixManager prefixManager = parser.getPrefixManager();
            for (String prefixName : prefixManager.getPrefixNames()) {
                format.setPrefix(prefixName,
                        prefixManager.getPrefix(prefixName));
            }
            return format;
        } catch (ParseException e) {
            throw new TurtleParserException(e);
        } catch (IOException e) {
View Full Code Here

Examples of org.semanticweb.owlapi.model.PrefixManager

    public void testIndividual() throws OWLException {
        // :Mary is an instance of the class :Person.
        OWLOntologyManager m = create();
        // The IRIs used here are taken from the OWL 2 Primer
        String base = "http://example.com/owl/families/";
        PrefixManager pm = new DefaultPrefixManager(null, null, base);
        OWLClass person = df.getOWLClass(":Person", pm);
        OWLNamedIndividual mary = df.getOWLNamedIndividual(":Mary", pm);
        // create a ClassAssertion to specify that :Mary is an instance of
        // :Person
        OWLClassAssertionAxiom classAssertion = df.getOWLClassAssertionAxiom(
View Full Code Here

Examples of org.semanticweb.owlapi.model.PrefixManager

    public void testPropertyAssertions() throws OWLException {
        // how to specify various property assertions for individuals
        OWLOntologyManager m = create();
        IRI ontologyIRI = IRI.create("http://example.com/owl/families/");
        OWLOntology o = m.createOntology(ontologyIRI);
        PrefixManager pm = new DefaultPrefixManager(null, null,
                ontologyIRI.toString());
        // Let's specify the :John has a wife :Mary
        // Get hold of the necessary individuals and object property
        OWLNamedIndividual john = df.getOWLNamedIndividual(":John", pm);
        OWLNamedIndividual mary = df.getOWLNamedIndividual(":Mary", pm);
View Full Code Here

Examples of org.semanticweb.owlapi.model.PrefixManager

    private SWRLRule rule;

    @Before
    public void setUp() {
        OWLDataFactory dataFactory = new OWLDataFactoryImpl();
        PrefixManager pm = new DefaultPrefixManager(null, null,
                "http://stuff.com/A/");
        OWLClass clsA = Class("A", pm);
        OWLClass clsB = Class("B", pm);
        OWLClass clsC = Class("C", pm);
        OWLClass clsD = Class("D", pm);
View Full Code Here

Examples of org.semanticweb.owlapi.model.PrefixManager

        // The second is to use a prefix manager and specify abbreviated IRIs.
        // This is useful for creating lots of entities with the same prefix
        // IRIs. First create our prefix manager and specify that the default
        // prefix IRI (bound to the empty prefix name) is
        // http://www.semanticweb.org/owlapi/ontologies/ontology#
        PrefixManager pm = new DefaultPrefixManager(null, null,
                "http://www.semanticweb.org/owlapi/ontologies/ontology#");
        // Now we use the prefix manager and just specify an abbreviated IRI
        OWLClass clsAMethodB = factory.getOWLClass(":A", pm);
        // Note that clsAMethodA will be equal to clsAMethodB because they are
        // both OWLClass objects and have the same IRI. Creating entities in the
View Full Code Here

Examples of org.semanticweb.owlapi.model.PrefixManager

                integer, MIN_INCLUSIVE, eighteen);
        // We could use this datatype in restriction, as the range of data
        // properties etc. For example, if we want to restrict the range of the
        // :hasAge data property to 18 or more we specify its range as this data
        // range
        PrefixManager pm = new DefaultPrefixManager(null, null,
                "http://www.semanticweb.org/ontologies/dataranges#");
        OWLDataProperty hasAge = factory.getOWLDataProperty(":hasAge", pm);
        OWLDataPropertyRangeAxiom rangeAxiom = factory
                .getOWLDataPropertyRangeAxiom(hasAge, integerGE18);
        OWLOntology ontology = manager.createOntology(IRI
View Full Code Here

Examples of org.semanticweb.owlapi.model.PrefixManager

        IRI ontologyIRI = IRI.create("http://example.com/owl/families/");
        OWLOntology ontology = manager.createOntology(ontologyIRI);
        // Get hold of a data factory from the manager and set up a prefix
        // manager to make things easier
        OWLDataFactory factory = manager.getOWLDataFactory();
        PrefixManager pm = new DefaultPrefixManager(null, null,
                ontologyIRI.toString());
        // Let's specify the :John has a wife :Mary Get hold of the necessary
        // individuals and object property
        OWLNamedIndividual john = factory.getOWLNamedIndividual(":John", pm);
        OWLNamedIndividual mary = factory.getOWLNamedIndividual(":Mary", pm);
View Full Code Here

Examples of org.semanticweb.owlapi.model.PrefixManager

        // :Person Create an ontology manager to work with
        OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
        OWLDataFactory dataFactory = manager.getOWLDataFactory();
        // The IRIs used here are taken from the OWL 2 Primer
        String base = "http://example.com/owl/families/";
        PrefixManager pm = new DefaultPrefixManager(null, null, base);
        // Get the reference to the :Person class (the full IRI will be
        // <http://example.com/owl/families/Person>)
        OWLClass person = dataFactory.getOWLClass(":Person", pm);
        // Get the reference to the :Mary class (the full IRI will be
        // <http://example.com/owl/families/Mary>)
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.