SWRLTab: problem with IRIs

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

SWRLTab: problem with IRIs

EJ Glez
Dear Sir/Madam:

I am trying to use custom built-ins with Protege 5.2.0 with SWRLAPI
swrltab-plugin-2.0.5. I am using the examples in
https://github.com/protegeproject/swrlapi-builtin-library-example <http://
https://github.com/protegeproject/swrlapi-builtin-library-example>  . (by
the way I have noted that namespaces in the owl files in
http://swrl.stanford.edu/ontologies/built-ins/5.0.0/strings.owl do not match
with the
private static final String Namespace =
"http://swrl.stanford.edu/ontologies/built-ins/5.2.0/strings.owl#";
and that the method
 public SWRLBuiltInLibraryImpl() { super(Namespace, new
HashSet<>(Arrays.asList(BuiltInNames))); } in line 22

can not be compiled with this version of SWRLAPI.

The trace is:
SWRLBuiltInLibraryImpl2.java:19: error: method registerSWRLBuiltIns in class
SWR
LBuiltInLibraryManager cannot be applied to given types;
    SWRLBuiltInLibraryManager.registerSWRLBuiltIns(Namespace, BuiltInNames);
                             ^
  required: String,String,Set<String>
  found: String,String[]
  reason: actual and formal argument lists differ in length
SWRLBuiltInLibraryImpl.java:22: error: constructor
AbstractSWRLBuiltInLibrary i
n class AbstractSWRLBuiltInLibrary cannot be applied to given types;
  public SWRLBuiltInLibraryImpl() { super(Namespace, new
HashSet<>(Arrays.asLis
t(BuiltInNames))); }
                                     ^
  required: String,String,Set<String>
  found: String,HashSet<String>
  reason: actual and formal argument lists differ in length

I do not know if I need newer versions of the libraries.

But the error I would like to answer is the following. In Protege 5.2.0 (and
older versions in Protege 5.x, Windows) I open the SWRLTab editor. As
pointed in other posts, I need to use IRI for invoking the built-in. But the
problem is that when I try to write the IRI, since I type any dot ".",
appears the "Expecting IRI after <" message and I cannot save the rule.

I apologize for that post in advance, since I am a new user of Protege.  

<http://protege-project.136.n4.nabble.com/file/t376817/iri.jpg>



--
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: SWRLTab: problem with IRIs

Martin O'Connor-2

I'm not following. Can you post the code fragment that does not compile. You appear to be calling the method either with the incorrect number of arguments or with an incorrect argument type.

Martin

> On May 29, 2018, at 6:24 AM, EJ Glez <[hidden email]> wrote:
>
> Dear Sir/Madam:
>
> I am trying to use custom built-ins with Protege 5.2.0 with SWRLAPI
> swrltab-plugin-2.0.5. I am using the examples in
> https://github.com/protegeproject/swrlapi-builtin-library-example <http://
> https://github.com/protegeproject/swrlapi-builtin-library-example>  . (by
> the way I have noted that namespaces in the owl files in
> http://swrl.stanford.edu/ontologies/built-ins/5.0.0/strings.owl do not match
> with the
> private static final String Namespace =
> "http://swrl.stanford.edu/ontologies/built-ins/5.2.0/strings.owl#";
> and that the method
> public SWRLBuiltInLibraryImpl() { super(Namespace, new
> HashSet<>(Arrays.asList(BuiltInNames))); } in line 22
>
> can not be compiled with this version of SWRLAPI.
>
> The trace is:
> SWRLBuiltInLibraryImpl2.java:19: error: method registerSWRLBuiltIns in class
> SWR
> LBuiltInLibraryManager cannot be applied to given types;
>    SWRLBuiltInLibraryManager.registerSWRLBuiltIns(Namespace, BuiltInNames);
>                             ^
>  required: String,String,Set<String>
>  found: String,String[]
>  reason: actual and formal argument lists differ in length
> SWRLBuiltInLibraryImpl.java:22: error: constructor
> AbstractSWRLBuiltInLibrary i
> n class AbstractSWRLBuiltInLibrary cannot be applied to given types;
>  public SWRLBuiltInLibraryImpl() { super(Namespace, new
> HashSet<>(Arrays.asLis
> t(BuiltInNames))); }
>                                     ^
>  required: String,String,Set<String>
>  found: String,HashSet<String>
>  reason: actual and formal argument lists differ in length
>
> I do not know if I need newer versions of the libraries.
>
> But the error I would like to answer is the following. In Protege 5.2.0 (and
> older versions in Protege 5.x, Windows) I open the SWRLTab editor. As
> pointed in other posts, I need to use IRI for invoking the built-in. But the
> problem is that when I try to write the IRI, since I type any dot ".",
> appears the "Expecting IRI after <" message and I cannot save the rule.
>
> I apologize for that post in advance, since I am a new user of Protege.  
>
> <http://protege-project.136.n4.nabble.com/file/t376817/iri.jpg>
>
>
>
> --
> 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: SWRLTab: problem with IRIs

EJ Glez
Dear Mr. O'Connor

I try to reproduce the code as it is:
https://github.com/protegeproject/swrlapi-builtin-library-example/blob/master/src/main/java/org/swrlapi/builtins/strings/SWRLBuiltInLibraryImpl.java

I usually program in Java and I know what you say. This is the reason I
wrote my problem since I do not understand why I cannot compile that example
code.

Thanks in advance for your answer



--
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: SWRLTab: problem with IRIs

EJ Glez
Dear Mr O'Connor

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.
Other question: is there any protocol for the name of the jar file I should
include in the plugin directory?
I would recommend a step-by-step tutorial about how to use each version (or
at least an updated set of examples), since it is difficult for me to manage
so many versions. Please, apologize me about that need.

Thanks in advance.

[1]
http://www.smi.stanford.edu/projects/protege/protege/3.4/docs/api/owl/edu/stanford/smi/protegex/owl/swrl/bridge/builtins/AbstractSWRLBuiltInLibrary.html



--
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