Possible to create Protege "macro" (with access to plugins)?

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

Possible to create Protege "macro" (with access to plugins)?

elijahFTL
I've been tasked with creating an automated (scripted) process for taking information contained in a spreadsheet (CSV, XLSX, etc--whatever Cellfie can take) and using it to generate individuals given a template ontology. Without the automation element, this is extremely trivial--just use Cellfie within Protege.

However, the automation part really gets me. I've struggled for the last day and a half trying to get the Protege and Cellfie sources in the same IntelliJ project, and while it does compile, running pretty much anything will result in a NoClassDefFoundError for org/osgi/* (if I download a JAR off the internet to patch one, another will come up, eventually leading to a dead end in which I can't find a JAR with the needed class).

I'm sure this has at least something to do with the fact that I just learned what OSGi is 2 days ago. It seems that the only real problem is getting the dependencies in order. Any advice, especially on that front?

Note that another thought I had was to simply use OWL API (without any Protege source) and recreate/recycle Cellfie's code, but when I saw how big the source for MappingMaster was, I was instantly discouraged.
Reply | Threaded
Open this post in threaded view
|

Re: Possible to create Protege "macro" (with access to plugins)?

Lorenz Buehmann
I guess you're trying to use the Cellfie features in your own Java
project, right?

Protege uses Maven to resolve dependencies, all necessary Jars will be
downloaded. Do you use Maven as well?


On 21.06.2017 14:49, elijahFTL wrote:

> I've been tasked with creating an automated (scripted) process for taking
> information contained in a spreadsheet (CSV, XLSX, etc--whatever Cellfie can
> take) and using it to generate individuals given a template ontology.
> Without the automation element, this is extremely trivial--just use Cellfie
> within Protege.
>
> However, the automation part really gets me. I've struggled for the last day
> and a half trying to get the Protege and Cellfie sources in the same
> IntelliJ project, and while it does compile, running pretty much anything
> will result in a NoClassDefFoundError for org/osgi/* (if I download a JAR
> off the internet to patch one, another will come up, eventually leading to a
> dead end in which I can't find a JAR with the needed class).
>
> I'm sure this has at least something to do with the fact that I just learned
> what OSGi is 2 days ago. It seems that the only real problem is getting the
> dependencies in order. Any advice, especially on that front?
>
> Note that another thought I had was to simply use OWL API (without any
> Protege source) and recreate/recycle Cellfie's code, but when I saw how big
> the source for MappingMaster was, I was instantly discouraged.
>
>
>
> --
> View this message in context: http://protege-project.136.n4.nabble.com/Possible-to-create-Protege-macro-with-access-to-plugins-tp4668868.html
> Sent from the Protege Developer mailing list archive at Nabble.com.
> _______________________________________________
> protege-dev mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/protege-dev

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

Re: Possible to create Protege "macro" (with access to plugins)?

elijahFTL
Correct, I just need to implement some basic Cellfie usage without human input/a GUI, so I figure that just means a Java project with Cellfie and its dependencies.

I have been using Maven. I am using Cellfie 2.1.0 as my only explicitly defined Maven dependency, although I have also tried including some other dependencies (even though they should be automatically fetched). I am not getting the NoClassDefFoundError anymore, but rather a NullPointerException in the constructor for org.osgi.util.tracker.ServiceTracker.

Lorenz B. wrote
I guess you're trying to use the Cellfie features in your own Java
project, right?

Protege uses Maven to resolve dependencies, all necessary Jars will be
downloaded. Do you use Maven as well?
Reply | Threaded
Open this post in threaded view
|

Re: Possible to create Protege "macro" (with access to plugins)?

Martin O'Connor-2
Some snapshot dependencies leaked into the Cellfie POM recently but are now gone.

You should be able to import the Cellfie project via its POM into Eclipse.


You could then use the Cellfie project as  a starting point for your plugin development. First verify that you can locally build it and install it as a plugin and then make your extensions while ensuring that it continues to work as a plugin.

Martin


On Jun 22, 2017, at 6:15 AM, elijahFTL <[hidden email]> wrote:

Correct, I just need to implement some basic Cellfie usage without human
input/a GUI, so I figure that just means a Java project with Cellfie and its
dependencies.

I have been using Maven. I am using  Cellfie 2.1.0
<https://mvnrepository.com/artifact/edu.stanford.protege/cellfie/2.1.0>   as
my only explicitly defined Maven dependency, although I have also tried
including some other dependencies (even though they should be automatically
fetched). I am not getting the NoClassDefFoundError anymore, but rather a
NullPointerException in the constructor for
org.osgi.util.tracker.ServiceTracker.


Lorenz B. wrote
I guess you're trying to use the Cellfie features in your own Java
project, right?

Protege uses Maven to resolve dependencies, all necessary Jars will be
downloaded. Do you use Maven as well?





--
View this message in context: http://protege-project.136.n4.nabble.com/Possible-to-create-Protege-macro-with-access-to-plugins-tp4668868p4668878.html
Sent from the Protege Developer mailing list archive at Nabble.com.
_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev


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

Re: Possible to create Protege "macro" (with access to plugins)?

Csongor Nyulas
Administrator
Reading the original poster's emails, my impression is that he may not need the Cellfie project at all. If he wants only a programmatic import of spreadsheet content into an ontology, he can use the API provided by the MappingMaster project [1] directly.

Csongor

[1] https://github.com/protegeproject/mapping-master



On 06/22/2017 08:33 AM, Martin O'Connor wrote:
Some snapshot dependencies leaked into the Cellfie POM recently but are now gone.

You should be able to import the Cellfie project via its POM into Eclipse.


You could then use the Cellfie project as  a starting point for your plugin development. First verify that you can locally build it and install it as a plugin and then make your extensions while ensuring that it continues to work as a plugin.

Martin


On Jun 22, 2017, at 6:15 AM, elijahFTL <[hidden email]> wrote:

Correct, I just need to implement some basic Cellfie usage without human
input/a GUI, so I figure that just means a Java project with Cellfie and its
dependencies.

I have been using Maven. I am using  Cellfie 2.1.0
<https://mvnrepository.com/artifact/edu.stanford.protege/cellfie/2.1.0>   as
my only explicitly defined Maven dependency, although I have also tried
including some other dependencies (even though they should be automatically
fetched). I am not getting the NoClassDefFoundError anymore, but rather a
NullPointerException in the constructor for
org.osgi.util.tracker.ServiceTracker.


Lorenz B. wrote
I guess you're trying to use the Cellfie features in your own Java
project, right?

Protege uses Maven to resolve dependencies, all necessary Jars will be
downloaded. Do you use Maven as well?





--
View this message in context: http://protege-project.136.n4.nabble.com/Possible-to-create-Protege-macro-with-access-to-plugins-tp4668868p4668878.html
Sent from the Protege Developer mailing list archive at Nabble.com.
_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev



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


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

Re: Possible to create Protege "macro" (with access to plugins)?

elijahFTL
I was under the impression that Cellfie had some functionalities not present in MappingMaster. Specifically, I need it to take JSON rules for the mapping as well. If MappingMaster is still capable of that, I do not need Cellfie.

In the meantime, I have been trying to import Cellfie directly via its POM file (as suggested above), but where I run into trouble is that the POM references a file "plugin.xml" which causes: "Error: osgi: [cellfie] Input file does not exist: plugin.xml". I downloaded plugin.xml from the same Github folder and put it in the same local directory as POM, but it still does not recognize it as existing.

Also, I use IntelliJ instead of Eclipse, although it shouldn't make a real difference. Just some context because the error message in the above paragraph is probably IDE-specific.

Csongor Nyulas wrote
Reading the original poster's emails, my impression is that he may not
need the Cellfie project at all. If he wants only a programmatic import
of spreadsheet content into an ontology, he can use the API provided by
the MappingMaster project [1] directly.

Csongor

[1] https://github.com/protegeproject/mapping-master
Reply | Threaded
Open this post in threaded view
|

Re: Possible to create Protege "macro" (with access to plugins)?

Martin O'Connor-2

I was under the impression that Cellfie had some functionalities not present
in MappingMaster. Specifically, I need it to take JSON rules for the mapping
as well. If MappingMaster is still capable of that, I do not need Cellfie.

Cellfie provides a nice user interface to manage Mapping Master expressions. The JSON serialization and deserialization code is part of Mapping Master:


In the meantime, I have been trying to import Cellfie directly via its POM
file (as suggested above), but where I run into trouble is that the POM
references a file "plugin.xml" which causes: "Error: osgi: [cellfie] Input
file does not exist: plugin.xml". I downloaded plugin.xml from the same
Github folder and put it in the same local directory as POM, but it still
does not recognize it as existing.

It should work out of the box. 

Try the following:

cd cellfie-plugin
mvn clean install

Also, I use IntelliJ instead of Eclipse, although it shouldn't make a real
difference. Just some context because the error message in the above
paragraph is probably IDE-specific.

Using IntelliJ (Ultimate 2017.1, though that should not matter) I use the Import Project option, select the Cellfie POM, and everything loads and builds.

Martin



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

Re: Possible to create Protege "macro" (with access to plugins)?

elijahFTL
Good to know re: Mapping Master. I'll try that soon, probably tomorrow, as it sounds like Cellfie is indeed a superset of what I need.

I should clarify that getting everything to load, build, and compile has generally not been a problem in this situation. It's only when I try to call the constructor at runtime for OWLEditorKit that I get a NullPointerException for org.osgi.util.tracker.ServiceTracker.<init>. This happened even after following your instructions.

It sounds like my best bet is just to try Mapping Master instead.

Martin O'Connor-2 wrote
Cellfie provides a nice user interface to manage Mapping Master expressions. The JSON serialization and deserialization code is part of Mapping Master:

https://github.com/protegeproject/mapping-master/blob/master/src/main/java/org/mm/core/TransformationRuleSetFactory.java

It should work out of the box.

Try the following:

git clone https://github.com/protegeproject/cellfie-plugin.git
cd cellfie-plugin
mvn clean install

Using IntelliJ (Ultimate 2017.1, though that should not matter) I use the Import Project option, select the Cellfie POM, and everything loads and builds.

Martin