Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 831809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:15:57+00:00 2026-05-15T04:15:57+00:00

I am new to Protege API and I have just created on Eclipse a

  • 0

I am new to Protege API and I have just created on Eclipse a small application which uses an external OWL file. Also I did import all the necessary libraries.

import java.util.Collection;
import java.util.Iterator;

import edu.stanford.smi.protege.exception.OntologyLoadException;
import edu.stanford.smi.protegex.owl.ProtegeOWL;
import edu.stanford.smi.protegex.owl.model.*;

public class Trial {
    public static void main(String[] args) throws OntologyLoadException {
        String uri = "C:/Documents and Settings/Anto/Desktop/travel.owl";
        OWLModel owlModel = ProtegeOWL.createJenaOWLModelFromURI(uri);
        Collection classes = owlModel.getUserDefinedOWLNamedClasses();

        for (Iterator it = classes.iterator(); it.hasNext();) {
            OWLNamedClass cls = (OWLNamedClass) it.next();
            Collection instances = cls.getInstances(false);
            System.out.println("Class " + cls.getBrowserText() + " ("
                    + instances.size() + ")");

            for (Iterator jt = instances.iterator(); jt.hasNext();) {
                OWLIndividual individual = (OWLIndividual) jt.next();
                System.out.println(" - " + individual.getBrowserText());

            }
        }
    }
}

When I do compile however I get the following errors:

WARNING: [Local Folder Repository] The specified file must be a directory.      
(C:\Documents and Settings\Anto\My Documents\Eclipse 
Workspace\ProtegeTrial\plugins\edu.stanford.smi.protegex.owl) 
LocalFolderRepository.update()
SEVERE: Exception caught -- java.net.URISyntaxException: Illegal character in path at 
index 12: C:/Documents and Settings/CiuffreA/Desktop/travel.owl
at java.net.URI$Parser.fail(URI.java:2809)
at java.net.URI$Parser.checkChars(URI.java:2982)
at java.net.URI$Parser.parseHierarchical(URI.java:3066)
at java.net.URI$Parser.parse(URI.java:3014)
at java.net.URI.<init>(URI.java:578)
at edu.stanford.smi.protegex.owl.jena.JenaKnowledgeBaseFactory.getFileURI(Unknown Source)
at edu.stanford.smi.protegex.owl.jena.JenaKnowledgeBaseFactory.loadKnowledgeBase(Unknown Source)
at edu.stanford.smi.protege.model.Project.loadDomainKB(Unknown Source)
at edu.stanford.smi.protege.model.Project.createDomainKnowledgeBase(Unknown Source)
at edu.stanford.smi.protegex.owl.jena.creator.OwlProjectFromUriCreator.create(Unknown Source)
at edu.stanford.smi.protegex.owl.ProtegeOWL.createJenaOWLModelFromURI(Unknown Source)
at Trial.main(Trial.java:14)


Exception in thread "main" java.lang.NullPointerException
at edu.stanford.smi.protegex.owl.jena.JenaKnowledgeBaseFactory.loadKnowledgeBase(Unknown Source)
at edu.stanford.smi.protege.model.Project.loadDomainKB(Unknown Source)
at edu.stanford.smi.protege.model.Project.createDomainKnowledgeBase(Unknown Source)
at edu.stanford.smi.protegex.owl.jena.creator.OwlProjectFromUriCreator.create(Unknown Source)
at edu.stanford.smi.protegex.owl.ProtegeOWL.createJenaOWLModelFromURI(Unknown Source)
at Trial.main(Trial.java:14)

Does anyone have an idea on where the problem should be?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T04:15:57+00:00Added an answer on May 15, 2026 at 4:15 am

    Replace

    String uri = "C:/Documents and Settings/Anto/Desktop/travel.owl";
    

    with

    String uri = "file:///C:/Documents and Settings/Anto/Desktop/travel.owl"; 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to access ontologies via Eclipse. I use the owl-api. I create my
New to Git and just started to use Github. Just created my first public
New Android programmer here. I have a Service which performs socket management and async
I can't save any writing update to my RDF/XML OWL file using Protege. Each
New to DDD here and have a architecture question which should be a typical
Hello I'm new to ontologies, my assignment is to create an ontology using Protege
New to PHP and MySQL, have heard amazing things about this website from Leo
I have a problem reading OWL/XML files from Java using Jena. I have no
NEW EDIT: I have narrowed my problem to this - i have a view
New to Android so I'm writing small programs to get familiar with how things

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.