Skip to content

Update SPARQL in functions.py - #47

Open
dr-shorthair wants to merge 4 commits into
masterfrom
simplify-queries-to-core-ontology
Open

Update SPARQL in functions.py#47
dr-shorthair wants to merge 4 commits into
masterfrom
simplify-queries-to-core-ontology

Conversation

@dr-shorthair

Copy link
Copy Markdown

Suppress references to unused namespaces and deprecated predicates

Suppress references to unused namespaces and deprecated predicates
@dr-shorthair dr-shorthair added bug Something isn't working enhancement New feature or request labels Mar 11, 2020

@benjaminleighton benjaminleighton left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a good start. We will need to build the new cache and test this code pretty thoroughly before we can merge it.

@dr-shorthair

Copy link
Copy Markdown
Author

Yes I wonder if qb4st:crs --> geox:inCRS may have fallen through the cracks.
I would expect everything else to be OK.

Comment thread functions.py
rdf:predicate rdf:type ;
rdf:object prov:Location .
} .
# UNION

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My best guess as to why this was here in the first place is because "overlaps" objects are treated as geo:Features but we want to exclude them from being returned as locations. I'm not sure though, @ashleysommer ?

@dr-shorthair dr-shorthair Mar 11, 2020

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these computed ahead and cached? If so, I would prefer to see an explicit feature-type for overlaps. Maybe loci:Overlap ? Then these can be explicitly excluded, rather than borrowing an unrelated feature-type.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I agree it shouldn't be a feature but I can't remember all the reasoning around it from our older discussions. I believe we can actually get rid of overlaps objects altogether because all that information should be elsewhere but @ashleysommer has more history and probably more insight on this. We need to break up scope here as well. It would be good to merge whatever is the minimum set of changes to support the new LDAPIs and deal with larger refactors, like overlaps, later.

Comment thread functions.py Outdated
SELECT <SELECTS>
WHERE {
{
{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note this bracket might not be closed and might need commenting

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which bracket? there is nothing in the change.

Comment thread functions.py Outdated
rdf:predicate geox:transitiveSfOverlap;
rdf:object ?o .
} UNION {
# ?s1 rdf:subject <URI> ;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we can take this out until we've rebuilt the linksets and that is beyond the scope of the LDAPI refactors currently underway. AFAIK we use geox:transitiveSfOverlap still and can't depend on geo:sfOverlaps yet

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets verify.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so in tests with excelerator use cases, we either have to:
a) change the linksets and/or triples in the cache so that this API endpoint works with your proposed query @dr-shorthair
or
b) defer removing the union statement (i.e. keep it) so it works with the current linkset triples

b) is more expedient; but a) is probably what we should do in the longer term

@dr-shorthair
dr-shorthair requested a review from jyucsiro March 11, 2020 05:10
Comment thread functions.py Outdated
rdf:predicate geox:transitiveSfOverlap;
rdf:object ?o .
} UNION {
# ?s1 rdf:subject <URI> ;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry it is the bracket above this comment I think it also needs commenting. Not sure though it just looks like an extra line needs commenting.

Comment thread functions.py
rdf:predicate rdf:type ;
rdf:object prov:Location .
} .
# UNION

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I agree it shouldn't be a feature but I can't remember all the reasoning around it from our older discussions. I believe we can actually get rid of overlaps objects altogether because all that information should be elsewhere but @ashleysommer has more history and probably more insight on this. We need to break up scope here as well. It would be good to merge whatever is the minimum set of changes to support the new LDAPIs and deal with larger refactors, like overlaps, later.

@dr-shorthair

Copy link
Copy Markdown
Author

So far I have only looked at one file: functions.py
Is there SPARQL anywhere else (I can't find any).

@jyucsiro

Copy link
Copy Markdown
Contributor

@dr-shorthair i think all the SPARQL in the loci-integration-api is in functions.py

@dr-shorthair

dr-shorthair commented Apr 22, 2020

Copy link
Copy Markdown
Author

I've simplified the geo:sfOverlaps query to match all sub-properties as well. See lines 645-655.
This should catch the geox:transitiveSfOverlap cases now, and ignore them later, without actually mentioning them.

Comment thread functions.py
PREFIX dt: <http://linked.data.gov.au/def/datatype/>
SELECT <SELECTS>
WHERE {
?p rdfs:subPropertyOf* geo:sfOverlaps .

@jyucsiro jyucsiro Apr 23, 2020

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dr-shorthair

Copy link
Copy Markdown
Author

Yes - it is a very small ontology. But we'll have to make sure that the deprecated elements are back in there. I'll let you know when that's done.

@dr-shorthair

Copy link
Copy Markdown
Author

Shoudl be good now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants