Triply-Dev / YASGUI.YASQE-deprecated

Deprecated, see https://github.com/TriplyDB/Yasgui for the Yasgui monorepo
MIT License
73 stars 36 forks source link

Changed the definition of propertyListNotEmpty. #151

Open eetz0 opened 5 years ago

eetz0 commented 5 years ago

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

eetz0 commented 5 years ago

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 commented 5 years ago

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

wouterbeek commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

The changes proposed involve propertyListNotEmpty, not propertyListPathNotEmpty.

If you can copy the example query to the latest YASQE, you should see an exclamation mark, indicating an invalid query. The query, however is valid and yields results using an RDF store that incorporates and complies with SPARQL 1.1 syntax (graphdb, this is). After investigating, the issue turned out to be with the property path sequence sign in the query "/". More specifically, I followed the grammar logic and when the query consists of more than one bnode "[]", there is no valid grammar rule to pick up as soon as path sequence is present "/". Changing propertyListNotEmpty to use verbPath allowed the editor to properly yield this query as valid.

Hope that helped. Itso

On 23 Jun 2019 22:54, "Wouter Beek" notifications@github.com wrote:

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 are formulated in the SPARQL 1.1 standard document?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/TriplyDB/YASGUI.YASQE/pull/151?email_source=notifications&email_token=AEDZOHS4VX6Q3PYLIQKSX53P37IIXA5CNFSM4HSHEDTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYLFYPY#issuecomment-504781887, or mute the thread https://github.com/notifications/unsubscribe-auth/AEDZOHTTOXYNEDJXUY6QEDDP37IIXANCNFSM4HSHEDTA .

wouterbeek commented 5 years ago

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%20%3Flang%20%7B%0A%20%20%20%20%5Bskos%3AinScheme%20aat%3A%3B%20xl%3AprefLabel%7Cxl%3AaltLabel%20%5Bdct%3Alanguage%20%5Bgvp%3AprefLabelGVP%2Fxl%3AliteralForm%20%3Flang%5D%5D%5D%0A%7D%20group%20by%20%3Flang%20order%20by%20desc(%3Fc)&endpoint=https%3A%2F%2Fdbpedia.org%2Fsparql&requestMethod=POST&tabTitle=Query&headers=%7B%7D&contentTypeConstruct=text%2Fturtle%2C%2F%3Bq%3D0.9&contentTypeSelect=application%2Fsparql-results%2Bjson%2C%2F%3Bq%3D0.9&outputFormat=table)).

Its0 commented 5 years ago

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