Giter VIP home page Giter VIP logo

owlapiverification's Introduction

owlapiverification

OWL API verification project - an accurate snapshot of all interfaces and public classes of OWL API versions, used to verify compatibility

Version 4 is still in flux, so this will change a bit until release

owlapiverification's People

Contributors

ignazio1977 avatar

Stargazers

Peter Ansell avatar

Watchers

James Cloos avatar  avatar

owlapiverification's Issues

i need retrieve all classes name from owl file using owlapi

this my code
package testowl;

import java.io.File;
import java.net.URI;
import java.net.URL;
import java.util.Set;

import org.semanticweb.HermiT.Reasoner;
import org.semanticweb.owlapi.apibinding.OWLManager;
import org.semanticweb.owlapi.model.IRI;
import org.semanticweb.owlapi.model.OWLAnnotationSubject;
import org.semanticweb.owlapi.model.OWLClass;
import org.semanticweb.owlapi.model.OWLDataFactory;
import org.semanticweb.owlapi.model.OWLEntity;
import org.semanticweb.owlapi.model.OWLIndividual;
import org.semanticweb.owlapi.model.OWLNamedIndividual;
import org.semanticweb.owlapi.model.OWLOntology;
import org.semanticweb.owlapi.model.OWLOntologyCreationException;
import org.semanticweb.owlapi.model.OWLOntologyManager;
import org.semanticweb.owlapi.reasoner.NodeSet;
import org.semanticweb.owlapi.reasoner.OWLReasoner;
import org.semanticweb.owlapi.reasoner.OWLReasonerFactory;
import org.semanticweb.owlapi.reasoner.structural.StructuralReasonerFactory;
import org.semanticweb.owlapi.util.OWLEntityRemover;

public class myclass {
static OWLOntology myOntology ;
static OWLDataFactory df ;
static OWLOntologyManager manager ;
static IRI ontologyIRI ;
static File file = new File("C:/travel.owl");
private OWLOntologyManager manager2;
private static OWLOntology ontology;
private static OWLDataFactory factory;
private static Reasoner reasoner;
private OWLEntityRemover remover;
private static URL url;
private static URI uri;
public static IRI fileURI = IRI.create(file);
static OWLReasonerFactory reasonerFactory = new StructuralReasonerFactory();

    @SuppressWarnings("deprecation")
	public static void main(String args[]) throws OWLOntologyCreationException {
                                   
            manager = OWLManager.createOWLOntologyManager(); 
            myOntology = manager.loadOntology(fileURI);
            ontologyIRI = IRI.create("the IRI of the onology"); 
            df = manager.getOWLDataFactory();	
            System.out.println("Loading Ontology...\n"  + myOntology);
            System.out.println("-----------------------");  
            OWLAnnotationSubject enitity =fileURI;
            System.out.println("all classes for travel antology"+ myOntology.getClassesInSignature());
            Set<OWLClass> entity=myOntology.getClassesInSignature();
            for (OWLClass c : myOntology.getClassesInSignature()) {
                if (c.getIRI().getFragment().equals("Places")){
                	System.out.println("ASDAS");
                    NodeSet<OWLNamedIndividual> instances = reasoner.getInstances(c, false);
                    System.out.println("ASDYYY"+instances);
                    System.out.println("$%$#%$%"+c.getIRI().getFragment());
                    for (OWLNamedIndividual i : instances.getFlattened()) {
                        System.out.println(i.getIRI().getFragment()); 
                    }
                }
            }
     //     System.out.println("all classes "+OWLEntity.getIRI().getShortForm());
           
                              }
             
     
   
 }

i have problem with null pointer exception
i need explore Places from http://www.travel.com/ontologies/travel.owl#Places
that's my owl file

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.