protege icon indicating copy to clipboard operation
protege copied to clipboard

DCTerms Load Loop Error

Open ohkio opened this issue 6 months ago • 2 comments

Hello Protege team!

I wanted to tinker a little bit with protege and try it using the DC Terms ontology/rdf. When I did I noticed an odd loop that would happen between loading a file and saving a file. First, I am using the Linux distribution if that has any bearing. Version 5.6.4.

Here are the steps I'm doing to recreate the error fresh. First, I load up protege by running ./run.sh in the terminal like the install documentation suggests. A window shows up. It opens a new ontology and for these recreation I am renaming the ontology 'test'

2024-07-25_14-33

Then I click on the plus next to 'direct imports' and I follow the wizzard:

  • I select 'Import an ontology contained in a document located on the web'
  • I click 'continue'
  • I paste the url 'http://purl.org/dc/terms/' into the field labeled 'URL'
  • I click 'continue'
  • The software finds the appropriate url and asks me whether I should continue
  • I click 'finish'

The first thing that I notice that is a little odd, is that this ontology is given a strange name. The name can sometimes change, but the format is: "OntologyID(Anonymous-#)"

2024-07-25_14-40

The correct classes, properties, individuals, and datatypes are all there, but they all say that they are in this "OntologyID(Anonymous-#)" whereas in a different test, when I imported an ontology like skos it was able to use the shorthand 'skos'

2024-07-25_14-43

I recognize this naming might be a problem on the dcterms side, but I bring it up just in case because of the loop I'm in the middle of describing.

Next step is to simply save this file as is. It will be a very small and short ontology, but it will still show my point.

To save I am doing the following:

  • Click 'File'
  • Click 'Save'
  • A wizard pops up to ask me to choose a serialization for my ontology
  • I choose the default option 'RDF/XML'
  • I name the file 'test'

Now I close protege.

When I look at the XML file I made, the file is unsurprisingly very short:

<?xml version="1.0"?>
<rdf:RDF xmlns="http://www.semanticweb.org/*****/ontologies/2024/6/test/"
     xml:base="http://www.semanticweb.org/*****/ontologies/2024/6/test/"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:owl="http://www.w3.org/2002/07/owl#"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:xml="http://www.w3.org/XML/1998/namespace"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
     xmlns:dcam="http://purl.org/dc/dcam/"
     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
     xmlns:terms="http://purl.org/dc/terms/">
    <owl:Ontology rdf:about="http://www.semanticweb.org/*****/ontologies/2024/6/test">
        <owl:imports rdf:resource="http://purl.org/dc/terms/"/>
    </owl:Ontology>


<!-- Generated by the OWL API (version 4.5.29.2024-05-13T12:11:03Z) https://github.com/owlcs/owlapi -->

For privacy I am censoring the name associated with the account, but that shouldn't be relevant. The line that I notice the most that I am focusing on is the line:

<owl:imports rdf:resource="http://purl.org/dc/terms/"/>

Now I start protege back up using the same method I mentioned before and I open this file back up:

  • I click 'File'
  • I hover over 'Open Recent'
  • I click on my 'test.rdf' file I just saved

I immediately notice some differences. First, the 'Direct Imports' no longer lists dcterms:

2024-07-25_14-53

And now some of the elements that were originally from dcterms are in bold text in the class list:

2024-07-25_14-54

Now I create a single individual:

  • I click 'Entities'
  • I click 'Individuals'
  • I select the button that has the hover text 'Add Individual'
  • A wizard pops up to add the individual
  • I name the individual 'test-ind'
  • I click 'OK'
  • For this new 'test-ind' Individual I go into the 'Description' section and click on the plus next to 'Types'
  • A new wizard pops up
  • In the new wizard I click on the menu item 'Class hierarchy'
  • I select the 'Agent (dcterms:agent)' Class (opening owl:Thing if necessary)
  • I click 'OK'

Now when I save the file the normal way:

  • I click 'File'
  • I click 'Save'

And I go to close protege.

Now when I look at the rdf file, all of dcterms is recorded in my file and the owl:import is gone. Here is the first bit of the file to give an idea, but the file is huge now:

<?xml version="1.0"?>
<rdf:RDF xmlns="http://www.semanticweb.org/*****/ontologies/2024/6/test/"
     xml:base="http://www.semanticweb.org/*****/ontologies/2024/6/test/"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:owl="http://www.w3.org/2002/07/owl#"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:xml="http://www.w3.org/XML/1998/namespace"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
     xmlns:dcam="http://purl.org/dc/dcam/"
     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
     xmlns:terms="http://purl.org/dc/terms/">
    <owl:Ontology rdf:about="http://www.semanticweb.org/*****/ontologies/2024/6/test"/>
    


    <!-- 
    ///////////////////////////////////////////////////////////////////////////////////////
    //
    // Annotation properties
    //
    ///////////////////////////////////////////////////////////////////////////////////////
     -->

    


    <!-- http://purl.org/dc/dcam/domainIncludes -->

    <owl:AnnotationProperty rdf:about="http://purl.org/dc/dcam/domainIncludes"/>
    


    <!-- http://purl.org/dc/dcam/rangeIncludes -->

    <owl:AnnotationProperty rdf:about="http://purl.org/dc/dcam/rangeIncludes"/>
    


    <!-- http://purl.org/dc/elements/1.1/contributor -->

    <owl:AnnotationProperty rdf:about="http://purl.org/dc/elements/1.1/contributor"/>
    


    <!-- http://purl.org/dc/elements/1.1/coverage -->

    <owl:AnnotationProperty rdf:about="http://purl.org/dc/elements/1.1/coverage"/>
    


    <!-- http://purl.org/dc/elements/1.1/creator -->

    <owl:AnnotationProperty rdf:about="http://purl.org/dc/elements/1.1/creator"/>

...

In order to get back to the way it was, I would have to delete all of the dcterms listed in the rdf file and then, open the file in protege and reimport dcterms. This seems like something is going wrong somewhere. Maybe this is two different issues. The first being that dcterms isn't recognized as an ontology when it's imported and thus is given a generic name (the 'anonymous-#' name). Then separately, when loading an RDF file that has an owl:import of dcterms, that import gets lost and forgotten in protege. Either way something seems to be not working properly. I would love to be able to use dcterms regularly and just load it up from a file and not worry about this reimporting every other time I open protege.

Thank you!

ohkio avatar Jul 25 '24 20:07 ohkio