algebra
Converting the ‘parse-tree’ output of pyparsing to a SPARQL Algebra expression
http://www.w3.org/TR/sparql11-query/#sparqlQuery
Classes:
Functions:
-
BGP– -
Extend– -
Filter– -
Graph– -
Group– -
Join– -
LeftJoin– -
Minus– -
OrderBy– -
Project– -
ToMultiSet– -
Union– -
Values– -
analyse–Some things can be lazily joined.
-
collectAndRemoveFilters–FILTER expressions apply to the whole group graph pattern in which
-
pprintAlgebra– -
reorderTriples–Reorder triple patterns so that we execute the
-
simplify–Remove joins to empty BGPs
-
translate–http://www.w3.org/TR/sparql11-query/#convertSolMod
-
translateAggregates– -
translateAlgebra–Translates a SPARQL 1.1 algebra tree into the corresponding query string.
-
translateExists–Translate the graph pattern used by EXISTS and NOT EXISTS
-
translateGraphGraphPattern– -
translateGroupGraphPattern–http://www.w3.org/TR/sparql11-query/#convertGraphPattern
-
translateGroupOrUnionGraphPattern– -
translateInlineData– -
translatePName–Expand prefixed/relative URIs
-
translatePath–Translate PropertyPath expressions
-
translatePrologue– -
translateQuads– -
translateQuery–Translate a query-parsetree to a SPARQL Algebra Expression
-
translateUpdate–Returns a list of SPARQL Update Algebra expressions
-
translateUpdate1– -
translateValues– -
traverse–Traverse tree, visit each node with visit function
-
triples–
ExpressionNotCoveredException
Bases: Exception
StopTraversal
BGP
BGP(triples: Optional[List[Tuple[Identifier, Identifier, Identifier]]] = None) -> CompValue
Extend
Extend(p: CompValue, expr: Union[Identifier, Expr], var: Variable) -> CompValue
Filter
Graph
Graph(term: Identifier, graph: CompValue) -> CompValue
Group
Join
LeftJoin
Minus
OrderBy
Project
ToMultiSet
Union
Values
analyse
Some things can be lazily joined. This propegates whether they can up the tree and sets lazy flags for all joins
Source code in rdflib/plugins/sparql/algebra.py
collectAndRemoveFilters
FILTER expressions apply to the whole group graph pattern in which they appear.
http://www.w3.org/TR/sparql11-query/#sparqlCollectFilters
Source code in rdflib/plugins/sparql/algebra.py
pprintAlgebra
Source code in rdflib/plugins/sparql/algebra.py
reorderTriples
reorderTriples(l_: Iterable[Tuple[Identifier, Identifier, Identifier]]) -> List[Tuple[Identifier, Identifier, Identifier]]
Reorder triple patterns so that we execute the ones with most bindings first
Source code in rdflib/plugins/sparql/algebra.py
simplify
simplify(n: Any) -> Optional[CompValue]
Remove joins to empty BGPs
Source code in rdflib/plugins/sparql/algebra.py
translate
http://www.w3.org/TR/sparql11-query/#convertSolMod
Source code in rdflib/plugins/sparql/algebra.py
624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 | |
translateAggregates
translateAggregates(q: CompValue, M: CompValue) -> Tuple[CompValue, List[Tuple[Variable, Variable]]]
Source code in rdflib/plugins/sparql/algebra.py
translateAlgebra
translateAlgebra(query_algebra: Query) -> str
Translates a SPARQL 1.1 algebra tree into the corresponding query string.
Parameters:
-
(query_algebraQuery) –An algebra returned by
translateQuery.
Returns:
-
str–The query form generated from the SPARQL 1.1 algebra tree for SELECT queries.
Source code in rdflib/plugins/sparql/algebra.py
translateExists
translateExists(e: Union[Expr, Literal, Variable, URIRef]) -> Union[Expr, Literal, Variable, URIRef]
Translate the graph pattern used by EXISTS and NOT EXISTS http://www.w3.org/TR/sparql11-query/#sparqlCollectFilters
Source code in rdflib/plugins/sparql/algebra.py
translateGraphGraphPattern
translateGroupGraphPattern
http://www.w3.org/TR/sparql11-query/#convertGraphPattern
Source code in rdflib/plugins/sparql/algebra.py
translateGroupOrUnionGraphPattern
Source code in rdflib/plugins/sparql/algebra.py
translateInlineData
translatePName
translatePName(p: Union[CompValue, str], prologue: Prologue) -> Optional[Identifier]
Expand prefixed/relative URIs
Source code in rdflib/plugins/sparql/algebra.py
translatePath
Translate PropertyPath expressions
Source code in rdflib/plugins/sparql/algebra.py
translatePrologue
translatePrologue(p: ParseResults, base: Optional[str], initNs: Optional[Mapping[str, Any]] = None, prologue: Optional[Prologue] = None) -> Prologue
Source code in rdflib/plugins/sparql/algebra.py
translateQuads
translateQuads(quads: CompValue) -> Tuple[List[Tuple[Identifier, Identifier, Identifier]], DefaultDict[str, List[Tuple[Identifier, Identifier, Identifier]]]]
Source code in rdflib/plugins/sparql/algebra.py
translateQuery
translateQuery(q: ParseResults, base: Optional[str] = None, initNs: Optional[Mapping[str, Any]] = None) -> Query
Translate a query-parsetree to a SPARQL Algebra Expression
Return a rdflib.plugins.sparql.sparql.Query object
Source code in rdflib/plugins/sparql/algebra.py
translateUpdate
translateUpdate(q: CompValue, base: Optional[str] = None, initNs: Optional[Mapping[str, Any]] = None) -> Update
Returns a list of SPARQL Update Algebra expressions
Source code in rdflib/plugins/sparql/algebra.py
translateUpdate1
Source code in rdflib/plugins/sparql/algebra.py
translateValues
Source code in rdflib/plugins/sparql/algebra.py
traverse
traverse(tree, visitPre: Callable[[Any], Any] = lambda n: None, visitPost: Callable[[Any], Any] = lambda n: None, complete: Optional[bool] = None) -> Any
Traverse tree, visit each node with visit function visit function may raise StopTraversal to stop traversal if complete!=None, it is returned on complete traversal, otherwise the transformed tree is returned
Source code in rdflib/plugins/sparql/algebra.py
triples
triples(l: Union[List[List[Identifier]], List[Tuple[Identifier, Identifier, Identifier]]]) -> List[Tuple[Identifier, Identifier, Identifier]]