Querying Properties and Classes with the same Name (different IRI) after Merging

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Querying Properties and Classes with the same Name (different IRI) after Merging

schullermacke
Hello, I have a question. Maybe somebody could help me.
I had two different ontologies and I merged them with the plugin "merge ontologies..." in Protege 5.1 (Btw, does this plugin have a specific name? I would like to name it in my thesis).

Now, there is a "problem" after merging. There are a few classes which does have the same Name. Because of the different IRIs they both co-exist in the new ontology (Btw. how would the merger execute, if the IRIs of some classes or properties are identical? Would he "eliminate" one of them? And in which case the merger would unite classes? Must there be an identical match of the "Start" of the IRI string? Or does the merger always just put all constructs together and never makes hierachic merings?)

But now my question I hope to get an answer:

Is there a) a possibilty to create an SWRL Rule which tells me if there are classes/properties/instances which have the same name?
And is there b) a Query I can execute which shows me these constructs with identical names (different IRIs)

I want to eliminate the "useless" double classes. I am aware that I have to consider the usage of the constructs I want to eliminate. But because of redundancy I want to find a automatic way that shows me that double constructs. I dont want to search them manually.

I would apreaciate it very much if somebody could give me an answer!


Thank you in advance,

Marco
Reply | Threaded
Open this post in threaded view
|

Re: Querying Properties and Classes with the same Name (different IRI) after Merging

schullermacke
And one further question:

Is there any difference between the two options "merge in new ontolgy" and "merge in existing ontology" aside from generating a new IRI when using the second option?
And is it also possible that the Protege Software is more stable when i use the second option and if yes, why is that? But that is just a subjective feeling.

Best regards,

Marco
Reply | Threaded
Open this post in threaded view
|

Re: Querying Properties and Classes with the same Name (different IRI) after Merging

Lorenz Buehmann
In reply to this post by schullermacke


Hello, I have a question. Maybe somebody could help me.
I had two different ontologies and I merged them with the plugin "merge
ontologies..." in Protege 5.1 (Btw, does this plugin have a specific name? I
would like to name it in my thesis).

Now, there is a "problem" after merging. There are a few classes which does
have the same Name. Because of the different IRIs they both co-exist in the
new ontology (Btw. how would the merger execute, if the IRIs of some classes
or properties are identical? Would he "eliminate" one of them? And in which
case the merger would unite classes? Must there be an identical match of the
"Start" of the IRI string? Or does the merger always just put all constructs
together and never makes hierachic merings?)
That is task is often called data fusion and far away from trivial - especially when conflict resolution has to be done. You can simply try it out with 2 dummy ontologies - I guess all data will

But now my question I hope to get an answer:

Is there a) a possibilty to create an SWRL Rule which tells me if there are
classes/properties/instances which have the same name? 
And is there b) a Query I can execute which shows me these constructs with
identical names (different IRIs)
The question is, HOW do you define the "name" of a class/property etc. ? Note, there is no definition of a name of an OWL entity. IRIs are unique identifiers, best practice is to assign a human readable form via a data property resp. an annotation property like rdfs:label.

I want to eliminate the "useless" double classes. I am aware that I have to
consider the usage of the constructs I want to eliminate. But because of
redundancy I want to find a automatic way that shows me that double
constructs. I dont want to search them manually.

I would apreaciate it very much if somebody could give me an answer!


Thank you in advance,

Marco



--
View this message in context: http://protege-project.136.n4.nabble.com/Querying-Properties-and-Classes-with-the-same-Name-different-IRI-after-Merging-tp4668344.html
Sent from the Protege User mailing list archive at Nabble.com.
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

-- 
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Querying Properties and Classes with the same Name (different IRI) after Merging

schullermacke
ok, but my merged ontology has about 1000 classes and 200 properties. So i can´t make a label for every single argument. or is it possible to attach the rdfs:label automatically? So that it attaches the defined "name" in OWL for every single Class and Property. So not for the instances of the class, but for the classes itself.

I thought maybe there is some kind of query to see that. Are there any "orders" that can be used in DL Query tab beside the "regular" expressions which can used for defining Axioms and Subclasses?

Best regards,

Marco
Reply | Threaded
Open this post in threaded view
|

Re: Querying Properties and Classes with the same Name (different IRI) after Merging

schullermacke
In reply to this post by Lorenz Buehmann
and one further question. If i would have attached every class a rdfs:label with its name. How would I query in DL Query Tab to get all classes with the same label?
Reply | Threaded
Open this post in threaded view
|

Re: Querying Properties and Classes with the same Name (different IRI) after Merging

Matthew Horridge-2
Administrator
Hi,

You can’t use the DL query tab to execute queries based on annotations (like rdfs:label).  You would need to use SPARQL to do this.

Cheers,

Matthew


> On 3 May 2017, at 08:19, schullermacke <[hidden email]> wrote:
>
> and one further question. If i would have attached every class a rdfs:label
> with its name. How would I query in DL Query Tab to get all classes with the
> same label?
>
>
>
> --
> View this message in context: http://protege-project.136.n4.nabble.com/Querying-Properties-and-Classes-with-the-same-Name-different-IRI-after-Merging-tp4668344p4668373.html
> Sent from the Protege User mailing list archive at Nabble.com.
> _______________________________________________
> protege-user mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Querying Properties and Classes with the same Name (different IRI) after Merging

Lorenz Buehmann
Matthew is right.

You can use SPARQL. If we assume that there is a local name in the URI i.e. the part after #

select ?s1 ?s2 where {
?s1 ?p1 ?o1 .
?s2 ?p2 ?o2 .
FILTER(?s1 != ?s2)
BIND(strafter(str(?s1), "#") AS ?localName1)
BIND(strafter(str(?s2), "#") AS ?localName2)
FILTER(?localName1 = ?localName2)
}

If you know the namespaces of both ontology, e.g.  http://ontology1.org/ and http://ontology2.org/ , then something like


prefix ns1: <http://ontology1.org/>

prefix ns2: <http://ontology2.org/>

select ?s1 ?s2 where {
?s1 ?p1 ?o1 .
?s2 ?p2 ?o2 .
FILTER(?s1 != ?s2)
BIND(strafter(str(?s1), str(ns1:)) AS ?localName1)
BIND(strafter(str(?s2), str(ns2:)) AS ?localName2)
FILTER(?localName1 = ?localName2)
}


could work.

Both queries are untested since I don't know your data. If you provide some sample data, I could test it locally.



Cheers,
Lorenz

Hi,

You can’t use the DL query tab to execute queries based on annotations (like rdfs:label).  You would need to use SPARQL to do this.

Cheers,

Matthew


On 3 May 2017, at 08:19, schullermacke [hidden email] wrote:

and one further question. If i would have attached every class a rdfs:label
with its name. How would I query in DL Query Tab to get all classes with the
same label?



--
View this message in context: http://protege-project.136.n4.nabble.com/Querying-Properties-and-Classes-with-the-same-Name-different-IRI-after-Merging-tp4668344p4668373.html
Sent from the Protege User mailing list archive at Nabble.com.
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user


-- 
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user