-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate SADL List grammar with Jena builtins #630
Comments
PR for issue Gh 630: implementation of list built-ins for Jena reasoner
added missing list built-ins to insert, delete; also added sadlListTo…
Fixed conflicts: sadl3/com.ge.research.sadl.parent/com.ge.research.sadl.jena/src/com/ge/research/sadl/jena/JenaBasedSadlModelValidator.java
@agabaldon , @AbhaMoitra , I would like to make some changes to lists in SADL. I'm not sure how much you have used this recently implemented functionality or set of built-in functions, so I'm bringing it up for discussion before committing changes.
Thoughts? I will not make changes before hearing from you on this topic. |
@crapo : I am ok with these changes and they make sense. @agabaldon : can you also take a look at this and share your views. |
@crapo : I am trying to use 'length of a list" and I am not able to get it working. Maybe my syntax is in correct? I am using and len = builtinfunctions:^length(n2) I also tried and len = ^length(n2) |
@AbhaMoitra , in my test case I use: which translates to the Jena rule: but this is on a branch of the code where I have changed the name of the built-in to listLength. I'm not sure I have a test case where built-in "length" was used as an explicit function rather than with the SADL grammar. |
@crapo: the change to listLength makes sense. I think the flexibility you describe in (3) would also be good to have in the future. What branch should I install to test listLength? |
@agabaldon , I just created a PR on DefaultValues branch that has both default values and new "listLength". |
@crapo : Here is my rule - rewritten to use your syntax style above (I am using https://github.com/ml4ai/grasen-data/blob/master/SemanticModels/GraSEN Rule MeasuredSignalCandidate // error signal = reference signal - measured signal In the Rules file, the syntax for "length" clause is (?n2 http://sadl.org/builtinfunctions#length ?len) Is that what you expect? |
@AbhaMoitra , that syntax indicates that the translation is treating "length" as a property. I'll restate my rule as I would expect it if the function name were "length" rather than "listLength". [ListLength: (http://sadl.org/UsingListExpression.sadl#l1 rdf:type http://sadl.org/UsingListExpression.sadl#YooHooList), length(http://sadl.org/UsingListExpression.sadl#l1, ?len) -> print('Length of l1: '^^http://www.w3.org/2001/XMLSchema#string, ?len)] For your rule, I'd expect: ... length(http://sadl.org/UsingListExpression.sadl#l1, ?len)... I'm not sure what version of the code you are using. However, I see that Alfredo just merged the latest PR, which uses "listLength" as the Jena built-in function. Perhaps you should get the latest version of the SADL plugins that will be created from this merge into the development branch. Note that you should delete the SadlBuiltinFunctions.sadl file from the ImplicitModel folder and let it be replaced with a new one so that function names are updated. |
@crapo: after pulling the most recent changes, using listLength is not working but length is. Are we missing some update? |
@agabaldon , I'm going to guess that this is because the old SadlBuiltinFunctions.sadl has not been deleted and still contains "length" rather than "listLength". It is also possible that the configuration.rdf file, which contains the fully qualified names of built-in function classes for Jena-based rules might be causing an error message. Currently the SadlBuiltinFunctions.sadl file is replaced when reasoner and/or translator selection is changed. I don't see any downside to deleting it as part of a clean as build will replace it with a new instance freshly created by the selected translator/reasoner pair. The "Derivations written... " is a regression bug. I will fix it. |
@agabaldon , @AbhaMoitra , just created a PR that addresses this and several other issues. |
See RuleWithList.sadl in TestSadl3Ide example project.
The text was updated successfully, but these errors were encountered: