Skip to content
This repository was archived by the owner on Nov 7, 2023. It is now read-only.

Do not traverse relations when attaching GeoJSON#1954

Open
literarymachine wants to merge 2 commits into
masterfrom
1953-locations
Open

Do not traverse relations when attaching GeoJSON#1954
literarymachine wants to merge 2 commits into
masterfrom
1953-locations

Conversation

@literarymachine

Copy link
Copy Markdown
Contributor

See #1953

@literarymachine

Copy link
Copy Markdown
Contributor Author

The query to migrate the data is as follows:

INSERT {
  ?entry <http://schema.org/location> ?inherit .
}
WHERE {
  ?entry a ?clazz .
  FILTER NOT EXISTS { ?entry <http://schema.org/location> ?location }
  ?entry ?traverse ?target .
  ?target <http://schema.org/location> ?inherit .
  FILTER (
    ?traverse = <http://schema.org/mentions> ||
    ?traverse = <http://schema.org/member> ||
    ?traverse = <http://schema.org/agent> ||
    ?traverse = <http://schema.org/participant> ||
    ?traverse = <http://schema.org/provider> ||
    ?traverse = <http://schema.org/publisher> ||
    ?traverse = <http://schema.org/creator> ||
    ?traverse = <http://schema.org/isRelatedTo>
  )
  FILTER (
    ?clazz = <http://schema.org/Article> ||
    ?clazz = <http://schema.org/Person> ||
    ?clazz = <http://schema.org/Organization> ||
    ?clazz = <http://schema.org/Service> ||
    ?clazz = <http://schema.org/Action> ||
    ?clazz = <http://schema.org/Event> ||
    ?clazz = <http://schema.org/WebPage> ||
    ?clazz = <http://schema.org/Product> ||
    ?clazz = <http://schema.org/Policy>
  )
}

This will effectively add the corresponding locations to all entries that don't have an explicit one according to our current inheritance rules.

@jurecuhalev
jurecuhalev removed their request for review March 26, 2023 08:03
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.

1 participant