Skip to content
This repository has been archived by the owner on Jan 13, 2020. It is now read-only.

Changed the definition of propertyListNotEmpty. #151

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from

Conversation

eetz0
Copy link

@eetz0 eetz0 commented Jun 3, 2019

The new definition uses 'verbPath or verbSimple' instead of 'verb'. Note that 'verb' is also defined in 'verbPath or verbSimple'. The need for change came from a query that included nested bnode syntax and a property path sequence '/'; As soon as the prop.path sequence sign is inserted when more than one bnode syntax is present, the specific query line where the property sequence path resides is marked as invalid. However, the query runs and evaluates just fine.
verbPath handles property paths, including sequences, hence why the change fixes this issue.

NOTE: 'verb' is only used to define propertyListNotEmpty. Should you decide that the change is appropriate, you might consider omitting 'verb' overall, as it will be obsolete.

Itso Ivanov

The new definition uses 'verbPath or verbSimple' instead of 'verb'. Note that 'verb' is also defined in 'verbPath or verbSimple'. The need for change came from a query that included nested bnode syntax and a property path sequence '/'; As soon as the prop.path sequence sign is inserted, the specific query line is marked as invalid. However, the query runs and evaluates just fine.
verbPath handles property paths, hence the change.

NOTE: 'verb' is only used to define propertyListNotEmpty. Should you decide that the change is appropriate, you might consider omitting 'verb' overall, as it will be obsolete.

Eetz
@eetz0
Copy link
Author

eetz0 commented Jun 3, 2019

example query:

PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX aat: <http://vocab.getty.edu/aat/>
PREFIX xl: <http://www.w3.org/2008/05/skos-xl#>
PREFIX gvp: <http://vocab.getty.edu/ontology#>

select (count(*) as ?c) ?lang {
    [skos:inScheme aat:; xl:prefLabel|xl:altLabel [dct:language [gvp:prefLabelGVP/xl:literalForm ?lang]]]
} group by ?lang order by desc(?c)

@LaurensRietveld
Copy link
Contributor

Hi @eetz0 , do you have a reference to the grammar of this new definition?

@wouterbeek
Copy link
Contributor

The relevant grammar rules are below:

 [77]    PropertyListNotEmpty    ::=    Verb ObjectList ( ';' ( Verb ObjectList )? )*  
 [78]    Verb    ::=    VarOrIri | 'a'  

I'm not aware of a newer grammar. @eetz0 Are you talking about SPARQL 1.2 maybe?

@Its0
Copy link

Its0 commented Jun 22, 2019

Hello guys, it is @eetz0 here, I got fired recently aand I lost the email where this other git account was registered to.

As @wouterbeek mentioned, the relevant grammar rule is:

propertyListNotEmpty ==> [verb,objectList,*([';',?([verb,objectList])])].

After my changes, this rule looks like this:

propertyListNotEmpty ==> [verbPath or verbSimple,objectList,*([';',?([verbPath or verbSimple,objectList])])].
I have substituted 'verb' for 'verbPath or verbSimple'. The definitions of 'verbPath' and 'verbSimple' overlap with 'verb', so in reality nothing major changed, except that with my change, queries like the above one is no longer considered invalid. This is because verbPath grammar rule would handle stuff, such as property path sequences, while 'verb' is just plain var or iri.

@Its0
Copy link

Its0 commented Jun 22, 2019

Frankly, I did not see 'verb' to be used anywhere else, except in propertyListNotEmpty definition, so should you decide that my change is appropriate then you might consider ommiting 'verb' overall.

This is not new grammar, but rather an improvement of the current one. Queries such as the one above are perfectly valid and the grammar rules should not indicate any errors...

@wouterbeek
Copy link
Contributor

wouterbeek commented Jun 23, 2019

The use of verbPath or verbSimple is already allowed:

[83] PropertyListPathNotEmpty ::= ( VerbPath | VerbSimple ) ObjectListPath ( ';' ( ( VerbPath | VerbSimple ) ObjectList )? )*

It is unclear to me what your proposal would add?

This is not new grammar, but rather an improvement of the current one. Queries such as the one above are perfectly valid and the grammar rules should not indicate any errors...

But is validity not defined as conformance to the grammar rules as formulated in the SPARQL 1.1 standard document?

@Its0
Copy link

Its0 commented Jun 24, 2019 via email

@wouterbeek
Copy link
Contributor

If you can copy the example query to the latest YASQE, you should see an exclamation mark, indicating an invalid query.

Now I finally understand your issue :-) This is simply a bug in the old YASQE which is already fixed in development (link).

@Its0
Copy link

Its0 commented Jun 25, 2019

Ah, oki! I suppose then my pull request is not really needed.

May I ask what approach you took?

Feel free to close this pull ^^

All the best,
Itso

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants