Custom built-in SWRLAPI 2.0.5 in Protege 5.2

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

Custom built-in SWRLAPI 2.0.5 in Protege 5.2

EJ Glez
Dear Sir/madam

I am trying to use the example from
https://github.com/protegeproject/swrlapi-example with SWRLAPI 2.0.5, in
order to get a custom built-in, but it does not even compile in Java 8.1.
I think that the problem is that  AbstractSWRLBuiltInLibrary for last
version in SWRLAPI needs 3 arguments for constructor while in old versions
of Protege API like [1] it only needs 1, the library name. This is the
reason I suppose that I cannot reuse the examples about custom builtins I
have found.
I would thank if anybody could help me with a full (even silly) example of
using SWRLAPI 2.0.5 and including custom built-in.
Thanks in advance.



--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Custom built-in SWRLAPI 2.0.5 in Protege 5.2

EJ Glez
I have the same problems:
http://protege-project.136.n4.nabble.com/SWRL-custom-built-problem-td4667143.html

When I try to install swrlapi-builtin-library-example with maven, I get:

[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for
edu.stanford.swrl:swrlapi-builtins-library
-example:2.0.1-SNAPSHOT: Could not find artifact
edu.stanford.swrl:swrlapi-paren
t:pom:2.0.1-SNAPSHOT and 'parent.relativePath' points at wrong local POM @
line
4, column 11
 @
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project
edu.stanford.swrl:swrlapi-builtins-library-example:2.0.1-S
NAPSHOT (C:\Users\swrlapi-builtin-library-example\pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for
edu.stanford.swrl:swrlapi-builtins-lib
rary-example:2.0.1-SNAPSHOT: Could not find artifact
edu.stanford.swrl:swrlapi-p
arent:pom:2.0.1-SNAPSHOT and 'parent.relativePath' points at wrong local POM
@ l
ine 4, column 11 -> [Help 2]



--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Custom built-in SWRLAPI 2.0.5 in Protege 5.2

Martin O'Connor-2

Are you following the build instructions here:


Everything on the master branch in each repo should have a version of 2.0.6.

Martin

On Jun 1, 2018, at 2:02 PM, EJ Glez <[hidden email]> wrote:

I have the same problems:
http://protege-project.136.n4.nabble.com/SWRL-custom-built-problem-td4667143.html

When I try to install swrlapi-builtin-library-example with maven, I get:

[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for
edu.stanford.swrl:swrlapi-builtins-library
-example:2.0.1-SNAPSHOT: Could not find artifact
edu.stanford.swrl:swrlapi-paren
t:pom:2.0.1-SNAPSHOT and 'parent.relativePath' points at wrong local POM @
line
4, column 11
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project
edu.stanford.swrl:swrlapi-builtins-library-example:2.0.1-S
NAPSHOT (C:\Users\swrlapi-builtin-library-example\pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for
edu.stanford.swrl:swrlapi-builtins-lib
rary-example:2.0.1-SNAPSHOT: Could not find artifact
edu.stanford.swrl:swrlapi-p
arent:pom:2.0.1-SNAPSHOT and 'parent.relativePath' points at wrong local POM
@ l
ine 4, column 11 -> [Help 2]



--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
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: Custom built-in SWRLAPI 2.0.5 in Protege 5.2

EJ Glez
I am better now but I am still lost. Sorry :(

I have just made the jar. I have fixed a bug with the constructor ( I try to
run the built-in example:
https://github.com/protegeproject/swrlapi-builtin-library-example)

[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR]
/C:/trabajo/limpia/swrlapi-builtin-library-example/src/main/java/org/swrlapi/builtins/strings/SWRLBuiltInLibraryImpl.java:[19,30]
method registerSWRLBuiltIns in class
org.swrlapi.builtins.SWRLBuiltInLibraryManager cannot be applied to given
types;
  required:
java.lang.String,java.lang.String,java.util.Set<java.lang.String>
  found: java.lang.String,java.lang.String[]
  reason: actual and formal argument lists differ in length
[ERROR]
/C:/trabajo/limpia/swrlapi-builtin-library-example/src/main/java/org/swrlapi/builtins/strings/SWRLBuiltInLibraryImpl.java:[22,37]
constructor AbstractSWRLBuiltInLibrary in class
org.swrlapi.builtins.AbstractSWRLBuiltInLibrary cannot be applied to given
types;
  required:
java.lang.String,java.lang.String,java.util.Set<java.lang.String>
  found: java.lang.String,java.util.HashSet<java.lang.String>
  reason: actual and formal argument lists differ in length
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO]
------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 19.202 s
[INFO] Finished at: 2018-06-03T22:52:11+01:00
[INFO]
------------------------------------------------------------------------
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile
(default-compile) on project swrlapi-builtins-library-example: Compilation
failure: Compilation failure:
[ERROR]
/C:/trabajo/limpia/swrlapi-builtin-library-example/src/main/java/org/swrlapi/builtins/strings/SWRLBuiltInLibraryImpl.java:[19,30]
method registerSWRLBuiltIns in class
org.swrlapi.builtins.SWRLBuiltInLibraryManager cannot be applied to given
types;
[ERROR]   required:
java.lang.String,java.lang.String,java.util.Set<java.lang.String>
[ERROR]   found: java.lang.String,java.lang.String[]
[ERROR]   reason: actual and formal argument lists differ in length
[ERROR]
/C:/trabajo/limpia/swrlapi-builtin-library-example/src/main/java/org/swrlapi/builtins/strings/SWRLBuiltInLibraryImpl.java:[22,37]
constructor AbstractSWRLBuiltInLibrary in class
org.swrlapi.builtins.AbstractSWRLBuiltInLibrary cannot be applied to given
types;
[ERROR]   required:
java.lang.String,java.lang.String,java.util.Set<java.lang.String>
[ERROR]   found: java.lang.String,java.util.HashSet<java.lang.String>
[ERROR]   reason: actual and formal argument lists differ in length
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please
read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

------------------------------------------------
When I run the tests on building swrlAPI I get (I do not care about it)
The tests
[ERROR] Failures:
[ERROR]   SQWRLCoreIT.TestSQWRLOrderByTime:1542 expected:<p[2]> but
was:<p[3]>
[INFO]
[ERROR] Tests run: 589, Failures: 1, Errors: 0, Skipped: 0
-------------------------------------------------------------------------

I add the jar to the classpath
swrlapi-builtins-library-example-2.0.5.jar

(My classpath are all the jars in target directory when I build SWRLAPI with
Maven)



But I get the following message when I try it:
Error parsing SQWRL query: Invalid SWRL atom predicate
'strings:stringsEqual'

StringsBuiltInLibrary.owl
<http://protege-project.136.n4.nabble.com/file/t376817/StringsBuiltInLibrary.owl>  
StringsBuiltInLibraryUser.owl
<http://protege-project.136.n4.nabble.com/file/t376817/StringsBuiltInLibraryUser.owl>  



--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user