[ 
https://issues.apache.org/jira/browse/MARMOTTA-625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15125228#comment-15125228
 ] 

Alan Robson commented on MARMOTTA-625:
--------------------------------------

Please consider the attached patch based on version 3.3.0 of the marmotta 
source.

It does three things…

1)      Allows the use of language tags such as @fr, @en with string literals. 
It does not check that these are valid tags, just that they are two lower-case 
letters
2)      Removes the default use of @<Locale> as the language tag. This used to 
be silently added it now no longer adds a tag of any kind unless it is 
specifically included in the rule input. (Which might break other things that 
rely on that behaviour) 
3)      Adds a couple of rather pathetic unit tests – this is a serious weak 
point and I have had nothing but trouble with unit tests all around when 
building marmotta so I have little confidence in them

As a result of adding the patch I can now use language tags and match untagged 
literals. For example

    ($s <http://unfortunate.name#greeting> "Bonjour"@fr) -> ($s 
<http://unfortunate.name#greeting> "Guten Tag"@de)

I also see from the parse that typed literals were already supported, so rule 
like this:

    ($s <http://purl.org/dc/terms/created> 
"2016-01-29T16:33:51.000-08:00"^^http://www.w3.org/2001/XMLSchema#dateTime) -> 
($s <http://unfortunate.name/nothing> "Hello")

Work too, which was never in doubt but at least answers my own question.

Anyway, please give me some pointers since this is all new to me.

One concern is that once the rule is uploaded to the reasoner and listed in the 
web interface all the language tags are stripped off in the GUI display

Many thanks for a great project

Alan

> Reasoner adds language tag to literals
> --------------------------------------
>
>                 Key: MARMOTTA-625
>                 URL: https://issues.apache.org/jira/browse/MARMOTTA-625
>             Project: Marmotta
>          Issue Type: Bug
>          Components: KiWi Triple Store
>    Affects Versions: 3.3.0
>            Reporter: Alan Robson
>            Assignee: Sebastian Schaffert
>            Priority: Minor
>         Attachments: MARMOTTA-625_3.3.0.diff
>
>
> Hi - I've been trying to get the Kiwi reasoner to work with rules where the 
> body section contains a string literal. It was suggested that I raise a jira 
> ticket to report this as a possible bug.
> For example:
> {code}($s $p "Hello") -> ($s $p "There"){code}
> The literal {{"Hello"}} will match any triple that has an object that is set 
> to {{"Hello"@en}} but not if the triple has an un-tagged literal value of 
> just {{"Hello"}}. 
> When it infers/produces triples with a string literal as the object it will 
> add the language decoration too, so the above would infer {{"There"@en}}.
> How can I turn off the language attribute please?
> How can I match other types of literal objects; e.g., numbers or other 
> {{^^XML}} types?
> Many thanks
> Alan
> Reasoner
> Module ID     marmotta-reasoner-kiwi
> Version       3.3.0
> Build Date    Fri, 16 Oct 2015 19:48:44 UTC
> Build Revision        0
> Revision ID   git:3a7684
> Build OS      Linux 3.10.0-123.6.3.el7.x86_64/amd64



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to