We're updating the issue view to help you get more done. 

Required Matcher query in CustomGraphQueryInferencer can be made optional

Description

I'll illustrate with a rule used in the test code.

rule.sparql

1 2 3 4 5 6 7 8 9 10 PREFIX : <http://foo.org/bar#> CONSTRUCT { ?uncle :uncleOf ?nephew } WHERE { ?uncle :brotherOf/:parentOf ?nephew }

Want to automatically generate inferred statements matcher:

matcher.sparql

1 2 3 4 5 6 PREFIX : <http://foo.org/bar#> CONSTRUCT WHERE { ?uncle :uncleOf ?nephew }

Regex that I think captures needed info with CASE_INSENSITIVE and DOT_ALL options set:

sparql_transform.regex

1 (?<queryStart>$.*\s*construct\s+)where(?<pattern>\s+\{.*\})\s+where.*^

Then build $queryStart + "WHERE" + $pattern

Now for the SeRQL qquivalent:

rule.serql

1 2 3 4 5 6 CONSTRUCT {Uncle} bar:uncleOf {Nephew} FROM {Uncle} bar:brotherOf {} bar:parentOf {Nephew} USING NAMESPACE bar = <http://foo.org/bar#>

Want to generate matcher:

matcher.serql

1 2 3 4 5 6 CONSTRUCT * FROM {Uncle} bar:uncleOf {Nephew} USING NAMESPACE bar = <http://foo.org/bar#>

Regex that I think captures needed info with CASE_INSENSITIVE and DOT_ALL set:

serql_transform.regex

1 \s*construct(?<pattern>\s+.*)\s+.*(?<using>\s+using\s+namespace.*$)

Then build "CONSTRUCT * FROM" + $pattern + $using

Environment

None

Status

Assignee

Dale W. Visser

Reporter

Dale W. Visser

Labels

None

Components

Fix versions

Affects versions

2.7.2

Priority

Major