Buses and Actors
On this page
This page gives an overview of all buses and actors that are used in the default Comunica engines, such as Comunica SPARQL and Comunica SPARQL File Other configurations such as Comunica SPARQL HDT contain additional actors and buses.
This builds upon the core architecture of actors, mediators, and buses. An overview of how these buses and actors are connected can be found in the SPARQL architecture.
Context Preprocess
Package: @comunica/bus-context-preprocess
A bus in which actors can optionally modify the query context.
Subscribed actors need to implement ActorContextPreprocess
.
Name | Package | Description |
---|---|---|
Convert Shortcuts | @comunica/actor-context-preprocess-convert-shortcuts | Expands shortcuts in the context to full context keys. |
Query Source Identify | @comunica/actor-context-preprocess-query-source-identify | Identifies all query sources in the context using the Query Source Identify bus. |
Query Source Skolemize | @comunica/actor-context-preprocess-query-source-skolemize | Places all identified query sources in a skolemization wrapper. |
Set Defaults | @comunica/actor-context-preprocess-set-defaults | Will set default context values for query engines, such as the logger, timestamp, function arguments cache, ... |
Source To Destination | @comunica/actor-context-preprocess-source-to-destination | Defines the write destination only if a single query source has been defined. |
Dereference
Package: @comunica/bus-dereference
Dereferences a path or URL into a (generic) stream.
Subscribed actors need to implement ActorDereference
.
Actors
Name | Package | Description |
---|---|---|
File | @comunica/actor-dereference-file | Dereferences a local file. |
HTTP | @comunica/actor-dereference-http | Dereferences a remote file. |
Fallback | @comunica/actor-dereference-fallback | A fallback actor with the lowest priority. |
Dereference RDF
Package: @comunica/bus-dereference-rdf
Dereferences a path or URL into a stream of quads.
Subscribed actors need to implement ActorDereferenceRdf
.
Actors
Name | Package | Description |
---|---|---|
Parse | @comunica/actor-dereference-rdf-parse | Dereferences RDF using @comunica/bus-dereference . Invokes parsing with @comunica/bus-rdf-parse . |
Hash Bindings
Package: @comunica/bus-hash-bindings
A bus for hashing Bindings
.
Subscribed actors need to implement ActorHashBindings
.
Actors
Name | Package | Description |
---|---|---|
SHA1 | @comunica/actor-hash-bindings-sha1 | Hashes bindings using SHA1. |
Hash Quads
Package: @comunica/bus-hash-quads
A bus for hashing RDF.Quad
.
Subscribed actors need to implement ActorHashQuads
.
Actors
Name | Package | Description |
---|---|---|
SHA1 | @comunica/actor-hash-quads-sha1 | Hashes quads using SHA1. |
HTTP
Package: @comunica/bus-http
Performs HTTP(S) requests.
Subscribed actors need to implement ActorHttp
.
Actors
Name | Package | Description |
---|---|---|
Memento | @comunica/actor-http-memento | Implements the Memento protocol. |
Native | @comunica/actor-http-native | Performs requests using Node's request library. |
Fetch | @comunica/actor-http-fetch | Performs requests using the fetch API. |
Proxy | @comunica/actor-http-proxy | Run requests through a proxy. |
Wayback | @comunica/actor-http-wayback | Run requests through the Wayback machine. |
HTTP Invalidate
Package: @comunica/bus-http-invalidate
A bus for HTTP invalidation events.
Subscribed actors need to implement ActorHttpInvalidate
.
Init
Package: @comunica/bus-init
All Comunica engines start here. This is where they accept generic input parameters, such as CLI arguments.
Subscribed actors need to implement ActorInit
.
Actors
Name | Package | Description |
---|---|---|
Query | @comunica/actor-init-query | Initializes query execution by parsing a given query, optimizing, executing, and serializing results. |
Merge Bindings Context
Package: @comunica/bus-merge-bindings-context
A bus for creating merge handlers that are responsible for merging context entries in bindings with different values.
Subscribed actors need to implement ActorMergeBingsContext
.
Actors
Name | Package | Description |
---|---|---|
Union | @comunica/actor-actor-merge-binding-factory-context-union | Merges context entry values by taking the set-union. |
Optimize Query Operation
Package: @comunica/bus-optimize-query-operation
Apply optional optimizations to the SPARQL algebra before actual execution. Optionally, a modified context can be returned.
Subscribed actors need to implement ActorOptimizeQueryOperation
.
Actors
Name | Package | Description |
---|---|---|
Assign Sources Exhaustive | @comunica/actor-optimize-query-operation-assign-sources-exhaustive | Converts every quad pattern in the query to a union of quad patterns per source. |
BGP to Join | @comunica/actor-optimize-query-operation-bgp-to-join | Converts BGPs into join operations. |
Construct Distinct | @comunica/actor-optimize-query-operation-construct-distinct | Wraps the top-level Construct clause in Distinct if --distinct flag is on. |
Describe To Constructs Subject | @comunica/actor-optimize-query-operation-describe-to-constructs-subject | Converts SPARQL DESCRIBE operations to construct queries with all triples related to a given subject. |
Filter Pushdown | @comunica/actor-optimize-query-operation-filter-pushdown | Pushes down filter expressions into the query plan as deep as possible. |
Join BGP | @comunica/actor-optimize-query-operation-join-bgp | Merges joins of multiple BGPs into a single BGP. |
Join Connected | @comunica/actor-optimize-query-operation-join-connected | Clusters entries within a join operation into separate sub-joins if they are connected by variables. |
Group Sources | @comunica/actor-optimize-query-operation-group-sources | Groups exclusive groups of query operations into sources only if those sources support those grouped operations. |
Prune Empty Source Operations | @comunica/actor-optimize-query-operation-prune-empty-source-operations | Removes operations from the query plan that are guaranteed to produce empty results. |
Rewrite Add | @comunica/actor-optimize-query-operation-rewrite-add | Rewrites ADD operators as DELETEINSERT operations. |
Rewrite Copy | @comunica/actor-optimize-query-operation-rewrite-copy | Rewrites COPY operators as DELETEINSERT operations. |
Rewrite Move | @comunica/actor-optimize-query-operation-rewrite-move | Rewrites MOVE operators as DELETEINSERT operations. |
Query Operation
Package: @comunica/bus-query-operation
Evaluates SPARQL algebra operations.
Subscribed actors need to implement ActorQueryOperation
or ActorQueryOperationTyped
.
Actors
Name | Package | Description |
---|---|---|
Ask | @comunica/actor-query-operation-ask | Handles ASK operations. |
BGP join | @comunica/actor-query-operation-bgp-join | Handles BGPs by delegating to @comunica/bus-rdf-join . |
Construct | @comunica/actor-query-operation-construct | Handles CONSTRUCT operations. |
Describe subject | @comunica/actor-query-operation-describe-subject | Handles DESCRIBE operations. |
Distinct hash | @comunica/actor-query-operation-distinct-hash | Handles DISTINCT operations through hashing. |
Extend | @comunica/actor-query-operation-extend | Handles EXTEND operations. |
Filter | @comunica/actor-query-operation-filter | Handles FILTER operations. |
From quad | @comunica/actor-query-operation-from-quad | handles FROM operations by considering FROM and FROM NAMED as target graph elements in quads. |
Group | @comunica/actor-query-operation-group | Handles GROUP BY operations. |
Join | @comunica/actor-query-operation-join | Handles join operations by delegating as inner join to @comunica/bus-rdf-join . |
Left join | @comunica/actor-query-operation-leftjoin | Handles OPTIONAL operations by delegating as optional join to @comunica/bus-rdf-join . |
Minus | @comunica/actor-query-operation-minus | Handles MINUS operations by delegating as minus join to @comunica/bus-rdf-join . |
Nop | @comunica/actor-query-operation-nop | Handles NOP operations. |
Order by | @comunica/actor-query-operation-orderby | Handles ORDER BY operations. |
Path Alt | @comunica/actor-query-operation-path-alt | Handles alt property path expressions. |
Path Inv | @comunica/actor-query-operation-path-inv | Handles inv property path expressions. |
Path Link | @comunica/actor-query-operation-path-link | Handles link property path expressions. |
Path Nps | @comunica/actor-query-operation-path-nps | Handles nps property path expressions. |
Path One or more | @comunica/actor-query-operation-path-one-or-more | Handles one-or-more property path expressions. |
Path Seq | @comunica/actor-query-operation-path-seq | Handles seq property path expressions. |
Path Zero or more | @comunica/actor-query-operation-path-zero-or-more | Handles zero-or-more property path expressions. |
Path Zero or one | @comunica/actor-query-operation-path-zero-or-one | Handles zero-or-one property path expressions. |
Project | @comunica/actor-query-operation-project | Handles SELECT operations. |
Reduced hash | @comunica/actor-query-operation-reduced-hash | Handles REDUCED operations through hashing. |
Service | @comunica/actor-query-operation-service | Handles SERVICE operations. |
Slice | @comunica/actor-query-operation-slice | Handles LIMIT and OFFSET operations. |
Source | @comunica/actor-query-operation-source | Delegates operations annotated with a query source towards that source. |
Union | @comunica/actor-query-operation-union | Handles UNION operations. |
Values | @comunica/actor-query-operation-values | Handles VALUES operations. |
Update Clear | @comunica/actor-query-operation-update-clear | Handles CLEAR operations. |
Update Composite Update | @comunica/actor-query-operation-update-compositeupdate | Handles `composition of multiple SPARQL update operations. |
Update Create | @comunica/actor-query-operation-update-create | Handles CREATE operations. |
Update Delete Insert | @comunica/actor-query-operation-update-deleteinsert | Handles INSERT DATA , DELETE DATA , and INSERT/DELETE operations. |
Update Drop | @comunica/actor-query-operation-update-drop | Handles DROP operations. |
Update Load | @comunica/actor-query-operation-update-load | Handles LOAD operations. |
Query Parse
Package: @comunica/bus-query-parse
Parsing an input query into (SPARQL) algebra.
Subscribed actors need to implement ActorQueryParse
.
Actors
Name | Package | Description |
---|---|---|
SPARQL | @comunica/actor-query-parse-sparql | Uses SPARQLAlgebra.js for parsing SPARQL query strings into SPARQL algebra. |
GraphQL | @comunica/actor-query-parse-graphql | Parses GraphQL strings into SPARQL algebra following the GraphQL-LD approach. |
Query Process
Package: @comunica/bus-query-process
A bus for fully processing a query. This usually involves parsing, optimizing, and evaluating, which can be delegated to other buses.
Subscribed actors need to implement ActorQueryProcess
.
Actors
Name | Package | Description |
---|---|---|
Annotate Source Binding | @comunica/actor-query-process-annotate-source-binding | Annotates bindings with their sources. |
Explain Logical | @comunica/actor-query-process-explain-logical | Explains the logical query plan after parsing and optimizing. |
Explain Parsed | @comunica/actor-query-process-explain-parsed | Explains the parsed query. |
Explain Physical | @comunica/actor-query-process-explain-physical | Explains the physical query plan after parsing, optimizing, and evaluating. |
Sequential | @comunica/actor-query-process-sequential | Processes a query in a sequential manner. It first parses the query, optimizes it, and then evaluates it. |
Query Result Serialize
Package: @comunica/bus-query-result-serialize
Serializes the query result into a text-based serialization.
Subscribed actors need to implement ActorQueryResultSerialize
.
Actors
Name | Package | Description |
---|---|---|
JSON | @comunica/actor-query-result-serialize-json | Serializes to a simple JSON format. |
RDF | @comunica/actor-query-result-serialize-rdf | Serializes to an RDF format by delegating to @comunica/bus-rdf-serialize . |
Simple | @comunica/actor-query-result-serialize-simple | Serializes to a simple format. |
SPARQL CSV | @comunica/actor-query-result-serialize-sparql-csv | Serializes to SPARQL/CSV. |
SPARQL JSON | @comunica/actor-query-result-serialize-sparql-json | Serializes to SPARQL/JSON. |
SPARQL TSV | @comunica/actor-query-result-serialize-sparql-tsv | Serializes to SPARQL/TSV. |
SPARQL XML | @comunica/actor-query-result-serialize-sparql-xml | Serializes to SPARQL/XML. |
Stats | @comunica/actor-query-result-serialize-stats | Serializes basic statistics. |
Table | @comunica/actor-query-result-serialize-table | Serializes in a simple table format. |
Tree | @comunica/actor-query-result-serialize-tree | Serializes to a JSON tree. |
Query Source Identify
Package: @comunica/bus-query-source-identify
Identifying the types of query sources.
Subscribed actors need to implement ActorQuerySourceIdentify
.
Actors
Name | Package | Description |
---|---|---|
Serialized | @comunica/actor-query-source-identify-serialized | Handles serialized sources.. |
Hypermedia | @comunica/actor-query-source-identify-hypermedia | Handles hypermedia-based sources. |
RDF/JS Source | @comunica/actor-query-source-identify-rdfjs | Handles RDF/JS Sources. |
Query Source Identify Hypermedia
Package: @comunica/bus-query-source-identify-hypermedia
Identifying a query source based on the extracted metadata.
Subscribed actors need to implement ActorQuerySourceIdentifyHypermedia
.
Actors
Name | Package | Description |
---|---|---|
Annotate Source | @comunica/actor-query-source-identify-hypermedia-annotate-source | This actor wraps around other hypermedia sources and adds the URL from which the bindings are derived to the binding's context. |
None | @comunica/actor-query-source-identify-hypermedia-none | The source is considered a raw RDF file, for which all data quads matching the quad pattern are returned. |
QPF | @comunica/actor-query-source-identify-hypermedia-qpf | The source is considered a Triple/Quad Pattern Fragments interface. |
SPARQL | @comunica/actor-query-source-identify-hypermedia-sparql | The source is considered a SPARQL endpoint if it has a service description, for which we use the SPARQL protocol. |
RDF Join
Package: @comunica/bus-rdf-join
Handles joining of bindings streams.
It supports different logical join types, such as inner, optional, and minus joins.
Subscribed actors need to implement ActorRdfJoin
.
Actors
Name | Package | Description |
---|---|---|
Inner Hash | @comunica/actor-rdf-join-inner-hash | Inner hash join of two entries. |
Inner Nested loop | @comunica/actor-rdf-join-inner-nestedloop | Inner nested loop join of two entries. |
Inner None | @comunica/actor-rdf-join-inner-none | Inner join between zero entries, and returns a single binding. |
Inner Single | @comunica/actor-rdf-join-inner-single | Inner join of a single entry, and returns the entry itself. |
Inner Symmetric hash | @comunica/actor-rdf-join-inner-symmetrichash | Inner symmetric hash join of two entries. |
Inner Multi empty | @comunica/actor-rdf-join-inner-multi-empty | Inner multi-join that accepts any number of inner-join entries of which at least one is empty and returns an empty stream. |
Inner Multi Bind | @comunica/actor-rdf-join-inner-multi-bind | Inner multi-join that inner-joins 2 or more streams by picking the one with the lowest cardinality, binding each item with the remaining operations, and recursively resolving those operations by delegating to @comunica/bus-query-operation . |
Inner Multi Bind Source | @comunica/actor-rdf-join-inner-multi-bind-source | Inner multi-join that inner-joins 2 or more streams by picking the one with the lowest cardinality, chunking it according to a certain block size, and joining each chunk with the remaining query by pushing it into the source. |
Inner Multi sequential | @comunica/actor-rdf-join-inner-multi-sequential | Inner multi-join by just picking the two of them hierarchically. |
Inner Multi smallest | @comunica/actor-rdf-join-inner-multi-smallest | Inner multi-join by always picking the first two streams with smallest estimate cardinality. |
Inner Multi smallest filter bindings | @comunica/actor-rdf-join-inner-multi-smallest-filter-bindings | Inner multi-join that inner-joins 2 or more streams by joining the smallest two, and joining the result with the remaining streams by delegating back to the RDF Join bus. While joining the smallest two, the first stream is pushed down as filter into the second stream.. |
Minus Hash | @comunica/actor-rdf-join-minus-hash | Anti-join (minus) of 2 streams using the hash join algorithm. This actor does not support streams that can have undefined values. |
Minus Hash undef | @comunica/actor-rdf-join-minus-hash-undef | Anti-join (minus) of 2 streams using the hash join algorithm. This actor supports streams that can have undefined values. |
Optional Bind | @comunica/actor-rdf-join-optional-bind | Left-join (optional) 2 streams using the bind join algorithm. It binds each item of the first stream with the second operation, and recursively resolving that operation by delegating to @comunica/bus-query-operation . |
Optional Hash | @comunica/actor-rdf-join-optional-hash | Left-join (optional) 2 streams using the hash join algorithm. |
Optional Nested loop | @comunica/actor-rdf-join-optional-nestedloop | Left-join (optional) 2 streams using the nested loop join algorithm. |
Optional Opt Plus | @comunica/actor-rdf-join-optional-optplus | Left-join (optional) 2 streams using the OPT+ algorithm. |
RDF Join Entries Sort
Package: @comunica/bus-rdf-join-entries-sort
Determines the order in which join entries should be ordered.
Subscribed actors need to implement ActorRdfJoinEntriesSort
.
Actors
Name | Package | Description |
---|---|---|
Cardinality | @comunica/actor-rdf-join-entries-sort-cardinality | Orders join entries by increasing cardinality. |
RDF Join Selectivity
Package: @comunica/bus-rdf-join-selectivity
Calculates or estimates the selectivity of joins.
Subscribed actors need to implement ActorRdfJoinSelectivity
.
Actors
Name | Package | Description |
---|---|---|
Variable Counting | @comunica/actor-rdf-join-selectivity-variable-counting | Estimates the selectivity by counting the overlap of variables and non-variables in patterns. |
RDF Metadata
Package: @comunica/bus-rdf-metadata
Extracts the quads relevant for metadata from the stream of data quads.
Subscribed actors need to implement ActorRdfMetadata
.
Actors
Name | Package | Description |
---|---|---|
All | @comunica/actor-rdf-metadata-all | Considers all incoming quads as both data and metadata quads. |
Primary topic | @comunica/actor-rdf-metadata-primary-topic | Splits off the metadata based on the existence of a foaf:primaryTopic link. |
RDF Metadata Accumulate
Package: @comunica/bus-rdf-metadata-accumulate
A bus for aggregating metadata objects together.
Subscribed actors need to implement ActorRdfMetadataAccumulate
.
Actors
Name | Package | Description |
---|---|---|
Can Contain Undefs | @comunica/actor-rdf-metadata-accumulate-cancontainundefs | Accumulate the canContainUndefs field. |
Cardinality | @comunica/actor-rdf-metadata-accumulate-cardinality | Accumulate the cardinality field. |
Page Size | @comunica/actor-rdf-metadata-accumulate-pagesize | Accumulate the pageSize field. |
Request Time | @comunica/actor-rdf-metadata-accumulate-requesttime | Accumulate the requestTime field. |
RDF Metadata Extract
Package: @comunica/bus-rdf-metadata-extract
Create an object with metadata for a given metadata quad stream.
Subscribed actors need to implement ActorRdfMetadataExtract
.
Actors
Name | Package | Description |
---|---|---|
Allow HTTP Methods | @comunica/actor-rdf-metadata-extract-allow-http-methods | Extract the Allow HTTP response header. |
Hydra Controls | @comunica/actor-rdf-metadata-extract-hydra-controls | Extract controls using the Hydra vocabulary. |
Hydra Count | @comunica/actor-rdf-metadata-extract-hydra-count | Extract count estimates using the Hydra vocabulary. |
Hydra Page size | @comunica/actor-rdf-metadata-extract-hydra-pagesize | Extract page sizes using the Hydra vocabulary. |
Patch SPARQL Update | @comunica/actor-rdf-metadata-extract-patch-sparql-update | Checks for the presence of application/sparql-update in the Accept-Patch header. |
Put Accepted | @comunica/actor-rdf-metadata-extract-put-accepted | Extracts the Accept-Put HTTP response header. |
Request Time | @comunica/actor-rdf-metadata-extract-request-time | Extracts the time it took to request the page in milliseconds. |
SPARQL Service | @comunica/actor-rdf-metadata-extract-sparql-service | Extract SPARQL service description metadata. |
RDF Parse
Package: @comunica/bus-rdf-parse
Parses quads from a serialization format.
Subscribed actors need to implement ActorRdfParse
.
Actors
Name | Package | Description |
---|---|---|
HTML | @comunica/actor-rdf-parse-html | Parses HTML documents by delegating to @comunica/bus-rdf-parse-html . |
JSON-LD | @comunica/actor-rdf-parse-jsonld | Parses JSON-LD. |
N3 | @comunica/actor-rdf-parse-n3 | Parses Turtle, Trig, N-triples, or N-Quads. |
RDF/XML | @comunica/actor-rdf-parse-rdfxml | Parses RDF/XML. |
XML RDFa | @comunica/actor-rdf-parse-xml-rdfa | Parses RDFa in XML. |
SHACLC | @comunica/actor-rdf-parse-shaclc | Parses SHACLC. |
RDF Parse HTML
Package: @comunica/bus-rdf-parse-html
Parses quads from an HTML document.
Subscribed actors need to implement ActorRdfParseHtml
.
Actors
Name | Package | Description |
---|---|---|
RDFa | @comunica/actor-rdf-parse-html-rdfa | Parses RDFa. |
Microdata | @comunica/actor-rdf-parse-html-microdata | Parses Microdata to RDF. |
Script | @comunica/actor-rdf-parse-html-script | Parses script tags and attempts to parse them by delegating to @comunica/bus-rdf-parse . |
RDF Resolve Hypermedia Links
Package: @comunica/bus-rdf-resolve-hypermedia-links
Determines which links should be followed from the metadata of the current source.
Subscribed actors need to implement ActorRdfResolveHypermediaLinks
.
Actors
Name | Package | Description |
---|---|---|
Next | @comunica/actor-rdf-resolve-hypermedia-links-next | Follow next page links. |
RDF Resolve Hypermedia Links Queue
Package: @comunica/bus-rdf-resolve-hypermedia-links-queue
Creates ILinkQueue
instances,
which enables different strategies for queueing links.
Subscribed actors need to implement ActorRdfResolveHypermediaLinksQueue
.
Actors
Name | Package | Description |
---|---|---|
FIFO | @comunica/actor-rdf-resolve-hypermedia-links-queue-fifo | Provides a link queue following the first in, first out strategy |
RDF Serialize
Package: @comunica/bus-rdf-serialize
Serializes quads to an RDF serialization format.
Subscribed actors need to implement ActorRdfSerialize
.
Actors
Name | Package | Description |
---|---|---|
JSON-LD | @comunica/actor-rdf-serialize-jsonld | Serializes to JSON-LD. |
N3 | @comunica/actor-rdf-serialize-n3 | Serializes to Turtle, Trig, N-triples, or N-Quads. |
SHACLC | @comunica/actor-rdf-serialize-shaclc | Serializes to SHACLC. |
RDF Update Hypermedia
Package: @comunica/bus-rdf-update-hypermedia
Handle a destination based on the extracted metadata.
Subscribed actors need to implement ActorRdfUpdateHypermedia
.
Actors
Name | Package | Description |
---|---|---|
SPARQL | @comunica/actor-rdf-update-hypermedia-patch-sparql-update | The destination is considered an HTTP APIs accepting PATCH requests containing SPARQL Update queries (application/sparql-update ), such as Solid servers. |
RDF Update Quads
Package: @comunica/bus-rdf-update-quads
Handle the insertion and deletion of streams of quads for a given destination type.
Subscribed actors need to implement ActorRdfUpdateQuads
or ActorRdfUpdateQuadsDestination
Actors
Name | Package | Description |
---|---|---|
RDF/JS Store | @comunica/actor-rdf-update-quads-rdfjs-store | The destination is considered an RDF/JS Store. |
Hypermedia | @comunica/actor-rdf-update-quads-hypermedia | The destination that handles updates by interpreting hypermedia links and controls. |