protegeproject/cellfie-plugin

Missing required prefix when generate axioms

houzw opened this issue · 4 comments

houzw commented

Encounter a error Missing required prefix when I try to generate axioms use following rule

Individual: @B*(mm:snakeCaseEncode)
Types: OGCVocab
Annotations: skos:prefLabel @B*(xml:lang="en"),
	skos:definition @D*(xml:lang="en"),
	dcterms:source @C*

if I defined a prefix terms for http://purl.org/dc/terms/ and use terms:source , the error is "the expected entity name does not exits in this ontology"

image

so , how to correct the rule?

Can you post your ontology if possible (add .txt to file name because GitHub will not allow .owl as a file extension).

houzw commented

my ontology (removed unrelated contents)

<?xml version="1.0"?>
<rdf:RDF xmlns="http://www.egc.org/ont/vocab/gis#"
     xml:base="http://www.egc.org/ont/vocab/gis"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:terms="http://purl.org/dc/terms/"
     xmlns:owl="http://www.w3.org/2002/07/owl#"
     xmlns:skos="http://www.w3.org/2004/02/skos/core#"
     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
     xmlns:dc="http://purl.org/dc/elements/1.1/">
    <owl:Ontology rdf:about="http://www.egc.org/ont/vocab/gis">
        <owl:imports rdf:resource="http://purl.org/NET/dc_owl2dl/terms"/>
        <owl:imports rdf:resource="http://www.w3.org/2004/02/skos/core"/>
    </owl:Ontology>

    <!-- http://www.egc.org/ont/vocab/gis#OGCVocab -->

    <owl:Class rdf:about="http://www.egc.org/ont/vocab/gis#OGCVocab"/>

</rdf:RDF>

imported ontology: http://purl.org/NET/dc_owl2dl/terms

<?xml version="1.0"?>
<rdf:RDF xmlns="http://purl.org/NET/dc_owl2dl/terms#"
     xml:base="http://purl.org/NET/dc_owl2dl/terms"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:owl="http://www.w3.org/2002/07/owl#"
     xmlns:dcam="http://purl.org/dc/dcam/"
     xmlns:dcterms="http://purl.org/dc/terms/"
     xmlns:dcmitype="http://purl.org/dc/dcmitype/"
     xmlns:skos="http://www.w3.org/2004/02/skos/core#"
     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
     xmlns:dc="http://purl.org/dc/elements/1.1/">
    <owl:Ontology rdf:about="http://purl.org/NET/dc_owl2dl/terms">  
        <rdfs:label xml:lang="en">DCMI metadata terms</rdfs:label>
    </owl:Ontology>

    <!-- http://purl.org/dc/terms/source -->

    <owl:AnnotationProperty rdf:about="http://purl.org/dc/terms/source">
        <rdfs:label xml:lang="en-us">Source</rdfs:label>
        <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/elements/1.1/source"/>
        <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/relation"/>
    </owl:AnnotationProperty>
    
</rdf:RDF>

@houzw How did you rectify the issue? I am getting a similar error.

Do you have a default prefix defined for your ontology?

Again, the Protege mailing list may be the best place to post this sort of question.