Set Algebra and Logic in RDF Languages #8
AdamSobieski
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Introduction
Syntax is explored to provide set-algebraic and logical operations in RDF languages and HTTP techniques involving using the
HEADmethod to obtain provenance data are discussed for computational optimization.Set Algebra
Using the
*symbol, a theoretical URL-dereferencing syntax (see: #7), using the?( ... )operator, a theoretical syntax for creating a lambda-invocation expression (see: #9), and using the!symbol, a theoretical expression-evaluation syntax (see: #9), syntax for set-algebraic operations might resemble:These expressions could be nested:
The following set-algebraic operations, which result in
xsd:booleanliterals, could also be provided:With the capability to use the HTTP
HEADmethod to obtain sets' provenance data, including any SPARQLSELECTqueries with which the sets were obtained, one could analyze the SPARQL queries to produce new ones for obtaining sets resulting from set-algebraic operations without having to retrieve and exhaustively iterate or enumerate the input sets.In a sense, one could retrieve sets' "definitions" and use these to construct new sets' "definitions" to compute with and, potentially, to utilize to download resultant sets. Both sets and their provenance data could be stored on, cached on, servers.
Logic
The HTTP
HEADmethod could be used ontext/literalresources of thexsd:booleanvariety to explore their provenance data, in particular those sourceASKSPARQL queries of which they are the result. Logical operations, too, then, could be included in RDF languages, these operations also capable of analyzing SPARQL queries for optimization purposes.With the capability to use the HTTP
HEADmethod to obtain Boolean literals' provenance data, including any SPARQLASKqueries from which the literals result, one could analyze the SPARQL queries to produce new ones for obtaining Boolean literal values resulting from Boolean algebraic operations without having to first evaluate the input values.Dereferencing Lists into Statements
As considered, the syntax:
would result in a list as the subject. For example:
However, with the
*syntax, used to dereference a list, one could express:and the resultant list would be expanded into multiple triples, each list element being the subject of its own triple. For example:
Optimization
Using the
LinkHTTP response header, resources can provide links to their provenance data including any SPARQL queries used to obtain them. When used in combination with the HTTPHEADmethod, this can enable or simplify: (1) performing set-algebraic operations on potentially large sets without having to download and exhaustively iterate or enumerate them, and (2) performing logical operations on Boolean literal values without having to first evaluate them.Developers could use the HTTP
HEADmethod to obtain provenance data for sets of individuals (e.g.,text/uri-listresources) and for sets of RDF statements (e.g.,text/turtleresources) to analyze any available SPARQL queries in order to combine and compose them into new queries to use to obtain sets described or defined in relation to previous ones. Developers could, similarly, use the HTTPHEADmethod to obtain and analyze provenance, e.g.,ASKSPARQL queries, fortext/literalresources of thexsd:booleanvariety.Examples
Drawing inspiration from PROV-AQ, the following HTTP
HEADrequest:might result in the following HTTP response:
What would a
dogs.prov.ttlresource resemble in order to indicate the one or more SPARQL queries used to obtain the set of individuals indogs.uris? It might resemble:Inside of the SPARQL query available in the provenance data for the resource
dogs.uris, in particular inside of itsWHEREclause, one can observe that the set in question is an intersection of a set of dogs and a set of Alice's pets.Note that, in addition to text-string representations of SPARQL queries, the SPIN ontology could be utilized.
Provenance for Resources Resulting from In-progress or Pending Computation
In addition to providing provenance data for resources which have already been computed, there is to consider providing provenance data for resources which have yet to be computed. With these varieties of provenance, one could use the HTTP
HEADmethod to examine any SPARQL queries for resources which are to be computed, are being computed, or will only be computed only upon request.The presence or omission of
prov:startedAtTimeandprov:endedAtTimepredicates and their values could be of use, in addition to other semantic content, for clearly distinguishing between these cases.Provenance for Resources which are Too Complex or Large to Compute, Store, or Transmit
Provenance, including SPARQL utilized to obtain a resource, can also be provided for resources which are estimated by a server to be too complex or large to compute, store, or transmit. For these cases, an HTTP
HEADmethod request might result in the following HTTP response:One could still, in these cases, obtain SPARQL queries for such resources to, for example, form intersections which might be computable, storable, and transmittable.
Requirements
As presently considered, in addition to #7, for all of the envisioned features and optimizations to work, requirements would include:
and SPARQL endpoints would need to be able to (including as a result of HTTP content negotiation):
SELECTqueries to content of MIME typetext/uri-list.isIRI()function in aFILTERclause.ASKqueries to content of MIME typetext/literalof thexsd:booleanvariety.300response codes to redirect querying clients to URL-addressable cached, or memoized, results.Glossary
Algebra of Sets, Boolean Algebra, Extensional and Intensional Definitions, Futures and Promises, Incremental Computing, Language Integrated Query, Lazy Evaluation, Lazy Initialization, Memoization, Query Language, Query Optimization, Set-builder Notation
Conclusion
What do you think about these ideas? Thank you.
All reactions