Knowledge

RDFLib

Source 📝

2697:- Returns an iterator over all the triples (within the conjunctive graph or just the given context) matching the given pattern. The pattern is specified by providing explicit statement terms (which are used to match against nodes in the underlying store), or None - which indicates a wildcard. NOTE: This interface is expected to return an iterator of tuples of length 3, corresponding to the 3 terms of matching statements, which can be either of : URIRef, Blank Node, Literal, Formula, Variable, or (perhaps) a Context. 3094: 224: 156: 2015: 317: 2108:
part, the core RDF model is adhered to as well as terminology that is consistent with the RDF Model specifications. However, this suggested interface also extends an RDF store with additional requirements necessary to facilitate the aspects of Notation 3 that go beyond the RDF model to provide a framework for First Order Predicate Logic processing and persistence.
2686:- Adds the given statement to a specific context or to the model. The quoted argument is interpreted by formula-aware stores to indicate this statement is quoted/hypothetical. It should be an error to not specify a context and have the quoted argument be True. It should also be an error for the quoted argument to be True when the store is not formula-aware. 25: 2796:. This boundary is equivalent to that of the store instance (which is itself uniquely identified and distinct from other instances of Store that signify other Conjunctive Graphs). It is equivalent to all the named graphs within it and associated with a _default_ graph which is automatically assigned a BNode for an identifier - if one isn't given. 244:, a simple yet powerful language for representing information. This library contains parsers/serializers for almost all of the known RDF serializations, such as RDF/XML, Turtle, N-Triples, & JSON-LD, many of which are now supported in their updated form (e.g. Turtle 1.1). The library also contains both in-memory and persistent 70: 2654:- Opens the store specified by the configuration string. If create is True a store will be created if it does not already exist. If create is False and a store does not already exist an exception is raised. An exception is also raised if a store exists, but there is insufficient permissions to open the store. 2374:
Nodes are a subset of the Terms that the underlying store actually persists. The set of such Terms depends on whether or not the store is formula-aware. Stores that aren't formula-aware would only persist those terms core to the RDF Model, and those that are formula-aware would be able to persist the
2155:
From a store perspective, closed world assumptions also provide the benefit of better query response times due to the explicit closed world boundaries. Closed world boundaries can be made transparent by federated queries that assume each ConjunctiveGraph is a section of a larger, unbounded universe.
2670:
The configuration string is understood by the store implementation and represents all the necessary parameters needed to locate an individual instance of a store. This could be similar to an ODBC string, or in fact be an ODBC string if the connection protocol to the underlying database is ODBC. The
2165:
For the sake of persistence, Conjunctive Graphs must be distinguished by identifiers (that may not necessarily be RDF identifiers or may be an RDF identifier normalized - SHA1/MD5 perhaps - for database naming purposes ) which could be referenced to indicate conjunctive queries (queries made across
2107:
This document attempts to summarize some fundamental components of an RDF store. The motivation is to outline a standard set of interfaces for providing the necessary support needed in order to persist an RDF Graph in a way that is universal and not tied to any specific implementation. For the most
2701:
This function can be thought of as the primary mechanism for producing triples with nodes that match the corresponding terms and term pattern provided. A conjunctive query can be indicated by either providing a value of NULL/None/Empty string value for context or the identifier associated with the
2412:
These 2 additional concepts (formulae and variables) must be thought of as core extensions and distinguishable from the other terms of a triple (for the sake of the persistence roundtrip - at the very least). It's worth noting that the 'scope' of universal quantifiers (variables) and existential
2132:
It's worth noting that the concept of logically grouping triples within an addressable 'set' or 'subgraph' is just barely beyond the scope of the RDF model. The RDF model defines a graph as an arbitrary collection of triples and the semantics of these triples, but doesn't give guidance on how to
2406:
Such a store is responsible for maintaining this separation and ensuring that queries against the entire model (the aggregation of all the contexts - specified by not limiting a 'query' to a specifically name context) do not include quoted statements. Also, it is responsible for distinguishing
871:
datatype or language attribute. The class provides a mechanism to both convert Python literals (and their built-ins such as time/date/datetime) into equivalent RDF Literals and (conversely) convert Literals to their Python equivalent. There is some support of considering datatypes in comparing
2143:
This refers to the 'top-level' Graph. It is the aggregation of all the contexts within it and is also the appropriate, absolute boundary for closed world assumptions / models. This distinction is the easily obtained part of RDF along the path to the semantic web and most of its value is in
2423:
Any query that doesn't limit the store to search within a named context only. Such a query expects a context-aware store to search the entire asserted universe (the conjunctive graph). A formula-aware store is expected not to include quoted statements when matching such a
2646:
An RDF store should provide standard interfaces for the management of database connections. Such interfaces are standard to most database management systems (Oracle, MySQL, Berkeley DB, Postgres, etc..) The following methods are defined to provide this capability:
2826:. The Graph class works with instances of this API (as the first argument to its constructor) for triple-based management of an RDF store including: garbage collection, transaction management, update, pattern matching, removal, length, and database management ( 2671:
open function needs to fail intelligently in order to clearly express that a store (identified by the given configuration string) already exists or that there is no store (at the location specified by the configuration string) depending on the value of create.
2126:
literature and ontology are relevant to this concept. A context could be thought of as only the relationship between an RDF triple and a sub-graph (this is how the term context is used in the Notation 3 Design Issues page) in which it is found or the sub-graph
2149:
There are at least two situations where the closed world assumption is used. The first is where it is assumed that a knowledge base contains all relevant facts. This is common in corporate databases. That is, the information it contains is assumed to be
360:
mean it is fairly simple for programmers with only junior Python skills to manipulate RDF. On the other hand, the Python idioms are simple enough that someone familiar with RDF, but not Python, can probably work out how to use rdflib quite easily.
2234:
A statement that isn't asserted but is referred to in some manner. Most often, this happens when we want to make a statement about another statement (or set of statements) without necessarily saying these quoted statements (are true). For
2300:
Context quoting can be thought of as very similar to reification. The main difference is that quoted statements are not asserted or considered as statements of truth about the universe and can be referenced as a group: a hypothetical RDF
368:
which is a Python dictionary used to store collections of RDF triples in memory. It redefines certain built-in Python object methods in order to exhibit simple graph behaviour, such as simple graph merging via addition (i.e.
2709:- Number of statements in the store. This should only account for non-quoted (asserted) statements if the context is not specified, otherwise it should return the number of statements in the formula or context given. 2390:
An RDF store capable of storing statements within contexts is considered context-aware. Essentially, such a store is able to partition the RDF model it represents into individual, named, and addressable
2133:
consistently address such arbitrary collections. Though a collection of triples can be thought of as a resource itself, the association between a triple and the collection it is a part of is not covered.
631:)) function. This function is a generator of triples that match the pattern given by the arguments. The arguments of these are RDF terms that restrict the triples that are returned. Terms that are 2166:
the entire conjunctive graph) or appear as nodes in asserted statements. In this latter case, such statements could be interpreted as being made about the entire 'known' universe. For example:
2807:
RDFLib graphs support an additional extension of RDF semantics for formulae. For the academically inclined, Graham Klyne's 'formal' extension (see external links) is probably a good read.
436:
class which takes (as its only argument) the Base URI of the namespace. Fully qualified URIs in the namespace can be constructed by attribute / dictionary access on Namespace instances:
2434:
This refers to the requirements on a formula-aware RDF store's persistence mechanism necessary for it to be properly populated by a N3 parser and rendered as syntax by a N3 serializer.
2660:- This closes the database connection. The commit_pending_transaction parameter specifies whether to commit all pending transactions before closing (if the store is transactional). 2413:
quantifiers (BNodes) is the formula (or context - to be specific) in which their statements reside. Beyond this, a Formula-aware store behaves the same as a Context-aware store.
3118: 2679:
An RDF store could provide a standard set of interfaces for the manipulation, management, and/or retrieval of its contained triples (asserted or quoted):
2375:
N3 extensions as well. However, utility terms that only serve the purpose for matching nodes by term-patterns probably will only be terms and not nodes.
3128: 2638:
They must also be distinguishable in persistence to ensure they can be round tripped. Other issues regarding the persistence of N3 terms.
2970:
There are a few high-level APIs that extend RDFLib graphs into other Pythonic idioms. For more a more explicit Python binding, there are
379:
set([ (subject,predicate,object), (subject1,predicate1,object1), ... (subjectN,predicateN,objectN) ])
2810:
Formulae are represented formally by the 'QuotedGraph' class and disjoint from regular RDF graphs in that their statements are quoted.
2401:
An RDF store capable of distinguishing between statements that are asserted and statements that are quoted is considered formula-aware.
2842:) . Additional persistence mechanisms can be supported by implementing this API for a different store. Currently supported databases: 2049:
specification and includes a harness for the publicly available RDF DAWG test suite. Support for SPARQL is provided by two methods:
2876: 35: 256:
having been released on 20 December 2021. It was originally created by Daniel Krech with the first release in November, 2002.
241: 237: 169: 433: 135: 2324:
Terms are the kinds of objects that can appear in a quoted/asserted triple. This includes those that are core to RDF:
109: 2725:- Generator over all contexts in the graph. If triple is specified, a generator over all contexts the triple is in. 421: 193: 416: 406: 365: 248:
back-ends for storing RDF information and numerous convenience functions for declaring graph namespaces, lodging
411: 3123: 2607:
Formulae and variables are distinguishable from URI references, Literals, and BNodes by the following syntax:
2530:
This statement would be asserted in the partition associated with quoted statements (in a formula named _:a)
2793: 3059:
Motik, Boris; Cuenca Grau, Bernardo; Horrocks, Ian; Wu, Zhe; Fokoue, Achille; Lutz, Carsten (2012-12-11),
245: 2792:
A Conjunctive Graph is the most relevant collection of graphs that are considered to be the boundary for
2157: 300: 287: 267: 2871: 2866: 2718:
These interfaces work on contexts and formulae (for stores that are formula-aware) interchangeably.
223: 188: 82:
Daniel Krech (creator), Gunnar Grimnes, Joern Hees (past maintainers), Nicholas J. Car (maintainer)
2444:
An RDF store capable of providing transactional integrity to the RDF operations performed on it.
2380:"The set of nodes of an RDF graph is the set of subjects and objects of triples in the graph. 868: 200: 176: 2999: 2555:
Finally, these statements would be asserted in the same partition (in a formula named _:b)
876:
__. This mapping to and from Python literals is achieved with the following dictionaries:
599:
__ are overridden to support adding and subtracting Graphs to/from each other (in place):
376:
RDFLib graphs emulate container types and are best thought of as a set of 3-item triples:
3014: 395: 155: 3093: 2028:
Please help update this article to reflect recent events or newly available information.
382:
RDFLib graphs are not sorted containers; they have ordinary Python set operations, e.g.
252:
queries and so on. It is in continuous development with the most recent stable release,
399: 181: 787:
of many kinds, but the most common is the serialization (in various formats: RDF/XML,
316: 3112: 2353:
And those that are primarily for matching against 'Nodes' in the underlying Graph:
402:
class, which extends Python unicode. Instances of these are nodes in an RDF graph.
2666:- This destroys the instance of the store identified by the configuration string. 2861: 2123: 291: 2823: 788: 432:
RDFLib provides mechanisms for managing namespaces. In particular, there is a
259:
A number of other Python projects use rdflib for RDF manipulation, including:
77: 2122:
A named, unordered set of statements. Also could be called a sub-graph. The
792: 513: 253: 2975: 807:
is the name of the graph into which the RDF serialization will be parsed.
739:# prints all the triples with the predicate being https://schema.org/name 3037: 69: 3060: 2684:
def add(self, (subject, predicate, object), context=None, quoted=False)
800: 2333:
Literals (which consist of a literal value, datatype and language tag)
3103: 2979: 2856: 2046: 867:
RDFLib 'Literal's essentially behave like Unicode characters with an
249: 283: 273: 3099: 1997:
Maps WXS datatyped Literals to Python. This mapping is used by the
296: 263: 144: 2851: 2496:
Could cause the following statements to be asserted in the store:
357: 277: 2971: 3013:
Cyganiak, Richard; Wood, David; Lanthaler, Markus (2014-02-25),
386:
methods that search triples and return them in arbitrary order.
2819: 2008: 311: 18: 2695:
def triples(self, (subject, predicate, object), context=None)
2156:
So a closed world assumption does not preclude you from an
615:
RDFLib graphs support basic triple pattern matching with a
2306:
Universal Quantifiers / Variables. (relevant references):
2846: 3000:"rdflib/CHANGELOG.md at 6.2.0 · RDFLib/rdflib · GitHub" 2690:
def remove(self, (subject, predicate, object), context)
2240:
Chimezie said "higher-order statements are complicated"
581:"Iterator / Container Protocols are Broken!!" 327: 42: 16:
Python library to serialize, parse and process RDF data
2295:
A context whose statements are quoted or hypothetical.
3087: 3062:
OWL 2 Web Ontology Language Profiles (Second Edition)
214: 2078:- used to change graph content or return RDF using 872:
Literal instances, implemented as an override to __
745:
RDF convenience APIs (RDF collections / containers)
209: 199: 187: 175: 165: 134: 108: 86: 76: 799:parameter is one of turtle, n3, xml, n-triples or 394:The following RDFLib classes (listed below) model 2658:def close(self, commit_pending_transaction=False) 1171:Maps Python instances to WXS datatyped Literals 2238: 839:Similarly, triples can be removed by a call to 2740:RDFLib defines the following kinds of Graphs: 783:="xml") function. The first argument can be a 803:(this last when the JSON-LD plugin is used). 8: 3036:Harris, Steve; Seaborne, Andy (2013-03-21), 2001:() method defined on all Literal instances. 62: 2927:'.. one of the supported Stores ..' 2144:(corporate/enterprise) real-world problems: 3092: 2652:def open(self, configuration, create=True) 2045:RDFLIb supports a majority of the current 222: 154: 68: 61: 2340:Those that extend the RDF model into N3: 2095:Serialization (NTriples, N3, and RDF/XML) 2882:Store instances can be created with the 3119:Python (programming language) libraries 2991: 2211:<urn:uuid:conjunctive-graph-foo> 2190:<urn:uuid:conjunctive-graph-foo> 2172:<urn:uuid:conjunctive-graph-foo> 2346:Universal Quantifications (Variables) 398:in a graph and inherit from a common 7: 3016:RDF 1.1 Concepts and Abstract Syntax 2818:RDFLib provides an abstracted Store 2729:def remove_context(self, identifier) 2453:The following Notation 3 document: 810:Triples can also be added with the 685:"https://schema.org/name" 2965: 2407:universal quantifiers (variables). 795:of an RDF graph as a string). The 759:Triples can be added in two ways: 286:- an add-on module for the Python 14: 2877:Redland RDF Application Framework 2736:Named graphs / conjunctive graphs 266:- A simple implementation of the 45:and remove advice or instruction. 2664:def destroy(self, configuration) 2604:Formulae and Variables as Terms 2309:OWL Definition of SWRL. (browse) 2245:Which can be written as (in N3): 2104:A Universal RDF Store Interface 2013: 315: 115:6.2.0 / July 16, 2022 23: 2723:def contexts(self, triple=None) 2707:def __len__(self, context=None) 587:Set operations on RDFLib graphs 471:"https://schema.org/" 356:RDFLib's use of various Python 3129:Resource Description Framework 508:RDFLib graphs also override __ 1: 270:RL Profile (reasoning engine) 2714:Formula / context interfaces 1575:'nonNegativeInteger' 1515:'nonPositiveInteger' 516:over the contained triples: 364:The core class in RDFLib is 2822:for persistence of RDF and 763:They may be added with the 635:are treated as a wildcard. 3145: 1314:'normalizedString' 3039:SPARQL 1.1 Query Language 2022:This section needs to be 1695:'positiveInteger' 1605:'negativeInteger' 489:https://schema.org/Person 240:library for working with 130: 104: 67: 2888: 2794:closed world assumptions 2609: 2557: 2532: 2498: 2455: 2248: 2169: 1173: 878: 637: 518: 438: 352:RDFLib and Python idioms 2064:queries to a graph (or 1815:'unsignedShort' 512:__ in order to support 2242: 2056:- used to pose SPARQL 1935:'base64Binary' 1845:'unsignedByte' 1665:'unsignedLong' 498:https://schema.org/url 324:This section is empty. 92:; 22 years ago 2966:'Higher-order' idioms 2266:higherOrderStatements 2158:open-world assumption 2076:rdflib.graph.update() 1755:'unsignedInt' 611:Basic triple matching 301:Web Ontology Language 117:; 2 years ago 2872:Random-access memory 2867:Zope Object Database 2771:'ConjunctiveGraph'(_ 2312:SWRL/RuleML Variable 2054:rdflib.graph.query() 43:rewrite this article 2702:Conjunctive Graph. 2642:Database management 2449:Interpreting syntax 2440:Transactional Store 863:RDF Literal support 504:Graphs as iterators 428:Namespace utilities 288:Flask web framework 64: 1374:'language' 1254:'dateTime' 1160:'dateTime' 308:History and status 303:documentation tool 2675:Triple interfaces 2419:Conjunctive Query 2356:REGEX Expressions 2139:Conjunctive Graph 2100:The RDF store API 2090:SPARQL statements 2043: 2042: 1485:'integer' 1455:'decimal' 1404:'boolean' 1025:'boolean' 344: 343: 231: 230: 90:June 4, 2002 60: 59: 36:a manual or guide 3136: 3096: 3091: 3090: 3088:Official website 3073: 3072: 3071: 3070: 3056: 3050: 3049: 3048: 3047: 3033: 3027: 3026: 3025: 3024: 3010: 3004: 3003: 2996: 2961: 2958: 2955: 2952: 2949: 2946: 2943: 2940: 2937: 2934: 2931: 2928: 2925: 2922: 2919: 2916: 2913: 2910: 2907: 2904: 2901: 2898: 2895: 2892: 2841: 2788: 2767: 2754: 2730: 2724: 2708: 2696: 2691: 2685: 2665: 2659: 2653: 2634: 2631: 2628: 2625: 2622: 2619: 2616: 2613: 2600: 2597: 2594: 2591: 2588: 2585: 2582: 2579: 2576: 2573: 2570: 2567: 2564: 2561: 2551: 2548: 2545: 2542: 2539: 2536: 2526: 2523: 2520: 2517: 2514: 2511: 2508: 2505: 2502: 2492: 2489: 2486: 2483: 2480: 2477: 2474: 2471: 2468: 2465: 2462: 2459: 2362:Numerical Ranges 2285: 2282: 2279: 2276: 2273: 2270: 2267: 2264: 2261: 2258: 2255: 2252: 2230:Quoted Statement 2224: 2221: 2218: 2215: 2212: 2209: 2206: 2203: 2200: 2197: 2194: 2191: 2188: 2187:ConjunctiveGraph 2185: 2182: 2179: 2176: 2173: 2077: 2055: 2038: 2035: 2029: 2017: 2016: 2009: 1993: 1990: 1987: 1984: 1981: 1978: 1975: 1972: 1971:'anyURI' 1969: 1966: 1963: 1960: 1957: 1954: 1951: 1948: 1945: 1942: 1939: 1936: 1933: 1930: 1927: 1924: 1921: 1918: 1915: 1912: 1909: 1906: 1905:'double' 1903: 1900: 1897: 1894: 1891: 1888: 1885: 1882: 1879: 1876: 1873: 1870: 1867: 1864: 1861: 1858: 1855: 1852: 1849: 1846: 1843: 1840: 1837: 1834: 1831: 1828: 1825: 1822: 1819: 1816: 1813: 1810: 1807: 1804: 1801: 1798: 1795: 1792: 1789: 1786: 1783: 1780: 1777: 1774: 1771: 1768: 1765: 1762: 1759: 1756: 1753: 1750: 1747: 1744: 1741: 1738: 1735: 1732: 1729: 1726: 1723: 1720: 1717: 1714: 1711: 1708: 1705: 1702: 1699: 1696: 1693: 1690: 1687: 1684: 1681: 1678: 1675: 1672: 1669: 1666: 1663: 1660: 1657: 1654: 1651: 1648: 1645: 1642: 1639: 1636: 1633: 1630: 1627: 1624: 1621: 1618: 1615: 1612: 1609: 1606: 1603: 1600: 1597: 1594: 1591: 1588: 1585: 1582: 1579: 1576: 1573: 1570: 1567: 1564: 1561: 1558: 1555: 1552: 1549: 1546: 1543: 1540: 1537: 1534: 1531: 1528: 1525: 1522: 1519: 1516: 1513: 1510: 1507: 1504: 1501: 1498: 1495: 1492: 1489: 1486: 1483: 1480: 1477: 1474: 1471: 1468: 1465: 1462: 1459: 1456: 1453: 1450: 1447: 1444: 1441: 1438: 1435: 1432: 1429: 1426: 1423: 1420: 1417: 1414: 1411: 1408: 1405: 1402: 1399: 1396: 1393: 1390: 1387: 1384: 1381: 1378: 1375: 1372: 1369: 1366: 1363: 1360: 1357: 1354: 1351: 1348: 1345: 1342: 1339: 1336: 1333: 1330: 1327: 1324: 1321: 1318: 1315: 1312: 1309: 1306: 1303: 1300: 1297: 1294: 1291: 1288: 1285: 1284:'string' 1282: 1279: 1276: 1273: 1270: 1267: 1264: 1261: 1258: 1255: 1252: 1249: 1246: 1243: 1240: 1237: 1234: 1231: 1228: 1225: 1222: 1219: 1216: 1213: 1210: 1207: 1204: 1201: 1198: 1195: 1192: 1189: 1186: 1183: 1180: 1177: 1167: 1164: 1161: 1158: 1155: 1152: 1149: 1146: 1143: 1140: 1137: 1134: 1131: 1128: 1125: 1122: 1119: 1116: 1113: 1110: 1107: 1104: 1101: 1098: 1095: 1092: 1089: 1086: 1083: 1080: 1077: 1074: 1071: 1068: 1065: 1062: 1059: 1056: 1053: 1050: 1047: 1044: 1041: 1038: 1035: 1032: 1029: 1026: 1023: 1020: 1017: 1014: 1011: 1008: 1005: 1002: 999: 996: 993: 990: 987: 984: 981: 978: 975: 972: 969: 966: 963: 960: 957: 954: 951: 948: 945: 942: 939: 936: 933: 930: 927: 924: 921: 918: 915: 912: 909: 906: 903: 900: 897: 894: 891: 888: 885: 882: 835:Removing triples 750:Managing triples 740: 737: 734: 731: 728: 725: 722: 719: 716: 713: 710: 707: 704: 701: 698: 695: 692: 689: 686: 683: 680: 677: 674: 671: 668: 665: 662: 659: 656: 653: 650: 647: 644: 641: 582: 579: 576: 573: 570: 567: 564: 561: 558: 555: 552: 549: 546: 543: 540: 537: 534: 531: 528: 525: 522: 499: 496: 493: 490: 487: 484: 481: 478: 475: 472: 469: 466: 463: 460: 457: 454: 451: 448: 445: 442: 385: 372: 339: 336: 326:You can help by 319: 312: 290:used to deliver 227: 226: 219: 216: 177:Operating system 158: 153: 150: 148: 146: 125: 123: 118: 100: 98: 93: 72: 65: 55: 52: 46: 34:is written like 27: 26: 19: 3144: 3143: 3139: 3138: 3137: 3135: 3134: 3133: 3124:RDF data access 3109: 3108: 3086: 3085: 3082: 3077: 3076: 3068: 3066: 3058: 3057: 3053: 3045: 3043: 3035: 3034: 3030: 3022: 3020: 3012: 3011: 3007: 2998: 2997: 2993: 2988: 2968: 2963: 2962: 2959: 2956: 2953: 2950: 2947: 2944: 2941: 2938: 2935: 2932: 2929: 2926: 2923: 2920: 2917: 2914: 2911: 2908: 2905: 2902: 2899: 2896: 2893: 2890: 2827: 2816: 2805: 2799: 2770: 2758:'QuotedGraph'(_ 2757: 2744: 2738: 2728: 2722: 2716: 2706: 2694: 2689: 2683: 2677: 2663: 2657: 2651: 2644: 2636: 2635: 2632: 2629: 2626: 2623: 2620: 2617: 2614: 2611: 2602: 2601: 2598: 2595: 2592: 2589: 2586: 2583: 2580: 2577: 2574: 2571: 2568: 2565: 2562: 2559: 2553: 2552: 2549: 2546: 2543: 2540: 2537: 2534: 2528: 2527: 2524: 2521: 2518: 2515: 2512: 2509: 2506: 2503: 2500: 2494: 2493: 2490: 2487: 2484: 2481: 2478: 2475: 2472: 2469: 2466: 2463: 2460: 2457: 2451: 2287: 2286: 2283: 2280: 2277: 2274: 2271: 2268: 2265: 2262: 2259: 2256: 2253: 2250: 2226: 2225: 2222: 2219: 2216: 2213: 2210: 2207: 2204: 2201: 2198: 2195: 2192: 2189: 2186: 2183: 2180: 2177: 2174: 2171: 2114: 2102: 2097: 2075: 2053: 2039: 2033: 2030: 2027: 2018: 2014: 2007: 2005:SPARQL querying 1995: 1994: 1991: 1988: 1985: 1982: 1979: 1976: 1973: 1970: 1967: 1964: 1961: 1958: 1955: 1952: 1949: 1946: 1943: 1940: 1937: 1934: 1931: 1928: 1925: 1922: 1919: 1916: 1913: 1910: 1907: 1904: 1901: 1898: 1895: 1892: 1889: 1886: 1883: 1880: 1877: 1875:'float' 1874: 1871: 1868: 1865: 1862: 1859: 1856: 1853: 1850: 1847: 1844: 1841: 1838: 1835: 1832: 1829: 1826: 1823: 1820: 1817: 1814: 1811: 1808: 1805: 1802: 1799: 1796: 1793: 1790: 1787: 1784: 1781: 1778: 1775: 1772: 1769: 1766: 1763: 1760: 1757: 1754: 1751: 1748: 1745: 1742: 1739: 1736: 1733: 1730: 1727: 1725:'short' 1724: 1721: 1718: 1715: 1712: 1709: 1706: 1703: 1700: 1697: 1694: 1691: 1688: 1685: 1682: 1679: 1676: 1673: 1670: 1667: 1664: 1661: 1658: 1655: 1652: 1649: 1646: 1643: 1640: 1637: 1634: 1631: 1628: 1625: 1622: 1619: 1616: 1613: 1610: 1607: 1604: 1601: 1598: 1595: 1592: 1589: 1586: 1583: 1580: 1577: 1574: 1571: 1568: 1565: 1562: 1559: 1556: 1553: 1550: 1547: 1544: 1541: 1538: 1535: 1532: 1529: 1526: 1523: 1520: 1517: 1514: 1511: 1508: 1505: 1502: 1499: 1496: 1493: 1490: 1487: 1484: 1481: 1478: 1475: 1472: 1469: 1466: 1463: 1460: 1457: 1454: 1451: 1448: 1445: 1442: 1439: 1436: 1433: 1430: 1427: 1424: 1421: 1418: 1415: 1412: 1409: 1406: 1403: 1400: 1397: 1394: 1391: 1388: 1385: 1382: 1379: 1376: 1373: 1370: 1367: 1364: 1361: 1358: 1355: 1352: 1349: 1346: 1344:'token' 1343: 1340: 1337: 1334: 1331: 1328: 1325: 1322: 1319: 1316: 1313: 1310: 1307: 1304: 1301: 1298: 1295: 1292: 1289: 1286: 1283: 1280: 1277: 1274: 1271: 1268: 1265: 1262: 1259: 1256: 1253: 1250: 1247: 1244: 1241: 1238: 1235: 1232: 1229: 1226: 1223: 1220: 1217: 1214: 1211: 1208: 1205: 1202: 1199: 1196: 1193: 1190: 1187: 1184: 1181: 1178: 1175: 1169: 1168: 1165: 1162: 1159: 1156: 1153: 1150: 1147: 1144: 1141: 1138: 1135: 1132: 1129: 1126: 1123: 1120: 1117: 1114: 1111: 1108: 1105: 1102: 1099: 1096: 1093: 1090: 1087: 1084: 1081: 1078: 1075: 1072: 1069: 1066: 1063: 1060: 1057: 1054: 1051: 1048: 1045: 1042: 1039: 1036: 1033: 1030: 1027: 1024: 1021: 1018: 1015: 1012: 1009: 1006: 1003: 1000: 997: 994: 991: 988: 985: 982: 979: 976: 973: 970: 967: 964: 961: 958: 955: 952: 949: 946: 943: 940: 937: 935:'float' 934: 931: 928: 925: 922: 919: 916: 913: 910: 907: 904: 901: 898: 895: 892: 889: 886: 883: 880: 865: 837: 757: 752: 747: 742: 741: 738: 735: 732: 729: 726: 723: 720: 717: 714: 711: 708: 705: 702: 699: 696: 693: 690: 687: 684: 681: 678: 675: 672: 669: 666: 663: 660: 657: 654: 651: 648: 645: 642: 639: 613: 589: 584: 583: 580: 577: 574: 571: 568: 565: 562: 559: 556: 553: 550: 547: 544: 541: 538: 535: 532: 529: 526: 523: 520: 506: 501: 500: 497: 494: 491: 488: 485: 482: 479: 476: 473: 470: 467: 464: 461: 458: 455: 452: 449: 446: 443: 440: 430: 392: 390:RDF graph terms 383: 380: 370: 354: 349: 340: 334: 331: 310: 221: 213: 161: 143: 126: 121: 119: 116: 96: 94: 91: 87:Initial release 56: 50: 47: 40: 28: 24: 17: 12: 11: 5: 3142: 3140: 3132: 3131: 3126: 3121: 3111: 3110: 3107: 3106: 3097: 3081: 3080:External links 3078: 3075: 3074: 3051: 3028: 3005: 2990: 2989: 2987: 2984: 2967: 2964: 2889: 2880: 2879: 2874: 2869: 2864: 2859: 2854: 2849: 2815: 2812: 2804: 2801: 2790: 2789: 2768: 2755: 2737: 2734: 2733: 2732: 2726: 2715: 2712: 2711: 2710: 2699: 2698: 2692: 2687: 2676: 2673: 2668: 2667: 2661: 2655: 2643: 2640: 2610: 2558: 2533: 2499: 2456: 2450: 2447: 2446: 2445: 2442: 2436: 2435: 2432: 2426: 2425: 2421: 2415: 2414: 2409: 2408: 2403: 2402: 2399: 2393: 2392: 2388: 2382: 2381: 2377: 2376: 2372: 2366: 2365: 2364: 2363: 2360: 2357: 2350: 2349: 2348: 2347: 2344: 2337: 2336: 2335: 2334: 2331: 2330:URI References 2328: 2322: 2316: 2315: 2314: 2313: 2310: 2303: 2302: 2297: 2296: 2293: 2249: 2247: 2246: 2237: 2236: 2232: 2170: 2168: 2167: 2162: 2161: 2152: 2151: 2146: 2145: 2141: 2135: 2134: 2129: 2128: 2120: 2113: 2110: 2101: 2098: 2096: 2093: 2092: 2091: 2073: 2041: 2040: 2021: 2019: 2012: 2006: 2003: 1785:'byte' 1545:'long' 1269:_strToDateTime 1224:'date' 1194:'time' 1174: 1115:'time' 1070:'date' 995:'long' 879: 864: 861: 836: 833: 832: 831: 808: 756: 755:Adding triples 753: 751: 748: 746: 743: 638: 612: 609: 608: 607: 604: 588: 585: 519: 505: 502: 439: 429: 426: 425: 424: 419: 414: 409: 391: 388: 378: 353: 350: 348: 345: 342: 341: 322: 320: 309: 306: 305: 304: 294: 281: 271: 229: 228: 211: 207: 206: 203: 197: 196: 191: 185: 184: 182:Cross-platform 179: 173: 172: 167: 163: 162: 160: 159: 140: 138: 132: 131: 128: 127: 114: 112: 110:Stable release 106: 105: 102: 101: 88: 84: 83: 80: 74: 73: 58: 57: 31: 29: 22: 15: 13: 10: 9: 6: 4: 3: 2: 3141: 3130: 3127: 3125: 3122: 3120: 3117: 3116: 3114: 3105: 3101: 3098: 3095: 3089: 3084: 3083: 3079: 3064: 3063: 3055: 3052: 3041: 3040: 3032: 3029: 3018: 3017: 3009: 3006: 3001: 2995: 2992: 2985: 2983: 2981: 2977: 2973: 2887: 2885: 2878: 2875: 2873: 2870: 2868: 2865: 2863: 2860: 2858: 2855: 2853: 2850: 2848: 2845: 2844: 2843: 2839: 2835: 2831: 2825: 2821: 2813: 2811: 2808: 2802: 2800: 2797: 2795: 2786: 2782: 2778: 2774: 2769: 2765: 2761: 2756: 2752: 2748: 2743: 2742: 2741: 2735: 2727: 2721: 2720: 2719: 2713: 2705: 2704: 2703: 2693: 2688: 2682: 2681: 2680: 2674: 2672: 2662: 2656: 2650: 2649: 2648: 2641: 2639: 2608: 2605: 2556: 2531: 2497: 2454: 2448: 2443: 2441: 2438: 2437: 2433: 2431: 2430:N3 Round Trip 2428: 2427: 2422: 2420: 2417: 2416: 2411: 2410: 2405: 2404: 2400: 2398: 2397:Formula-aware 2395: 2394: 2389: 2387: 2386:Context-aware 2384: 2383: 2379: 2378: 2373: 2371: 2368: 2367: 2361: 2358: 2355: 2354: 2352: 2351: 2345: 2342: 2341: 2339: 2338: 2332: 2329: 2326: 2325: 2323: 2321: 2318: 2317: 2311: 2308: 2307: 2305: 2304: 2299: 2298: 2294: 2292: 2289: 2288: 2244: 2243: 2241: 2233: 2231: 2228: 2227: 2164: 2163: 2159: 2154: 2153: 2148: 2147: 2142: 2140: 2137: 2136: 2131: 2130: 2125: 2121: 2119: 2116: 2115: 2111: 2109: 2105: 2099: 2094: 2089: 2085: 2081: 2074: 2071: 2067: 2063: 2059: 2052: 2051: 2050: 2048: 2037: 2025: 2020: 2011: 2010: 2004: 2002: 2000: 1635:'int' 1172: 965:'int' 877: 875: 870: 862: 860: 858: 854: 850: 846: 842: 834: 829: 825: 821: 817: 813: 809: 806: 802: 798: 794: 790: 786: 782: 778: 774: 770: 766: 762: 761: 760: 754: 749: 744: 636: 634: 630: 626: 622: 618: 610: 605: 602: 601: 600: 598: 594: 586: 517: 515: 511: 503: 492:>>> 477:>>> 456:>>> 441:>>> 437: 435: 427: 423: 420: 418: 415: 413: 410: 408: 405: 404: 403: 401: 397: 389: 387: 377: 374: 367: 362: 359: 351: 346: 338: 329: 325: 321: 318: 314: 313: 307: 302: 298: 295: 293: 289: 285: 282: 279: 275: 272: 269: 265: 262: 261: 260: 257: 255: 251: 247: 243: 239: 235: 225: 218: 212: 208: 204: 202: 198: 195: 192: 190: 186: 183: 180: 178: 174: 171: 168: 164: 157: 152: 142: 141: 139: 137: 133: 129: 113: 111: 107: 103: 89: 85: 81: 79: 75: 71: 66: 54: 44: 39: 37: 32:This article 30: 21: 20: 3067:, retrieved 3061: 3054: 3044:, retrieved 3038: 3031: 3021:, retrieved 3015: 3008: 2994: 2969: 2906:rdflib.store 2883: 2881: 2837: 2833: 2829: 2817: 2809: 2806: 2798: 2791: 2784: 2780: 2776: 2772: 2763: 2759: 2750: 2746: 2739: 2717: 2700: 2678: 2669: 2645: 2637: 2606: 2603: 2554: 2550:N3Programmer 2529: 2495: 2470:N3Programmer 2452: 2439: 2429: 2418: 2396: 2385: 2369: 2319: 2290: 2239: 2229: 2138: 2124:named graphs 2117: 2106: 2103: 2087: 2083: 2079: 2069: 2065: 2061: 2057: 2044: 2034:October 2019 2031: 2023: 1998: 1996: 1950:decodestring 1170: 873: 866: 856: 852: 848: 844: 840: 838: 827: 823: 819: 815: 811: 804: 796: 784: 780: 776: 772: 768: 764: 758: 632: 628: 624: 620: 616: 614: 596: 592: 590: 509: 507: 431: 393: 381: 375: 371:g3 = g1 + g2 363: 355: 332: 328:adding to it 323: 258: 254:rdflib 6.1.1 233: 232: 78:Developer(s) 48: 41:Please help 33: 2951:conjunctive 2862:Berkeley DB 2814:Persistence 2391:sub-graphs. 2359:Date Ranges 2327:Blank Nodes 2281:complicated 2217:persistedBy 2112:Terminology 1176:XSDToPython 881:PythonToXSD 292:Linked Data 276:- a Python 3113:Categories 3069:2020-04-18 3046:2020-04-18 3023:2020-04-18 2986:References 2939:identifier 2886:function: 2824:Notation 3 2781:identifier 2764:identifier 2751:identifier 2047:SPARQL 1.1 1239:_strToDate 1209:_strToTime 890:basestring 869:XML Schema 814:function: 789:Notation 3 400:Identifier 166:Written in 136:Repository 122:2022-07-16 97:2002-06-04 2745:'Graph'(_ 2088:CONSTRUCT 1145:isoformat 1100:isoformat 1055:isoformat 853:predicate 824:predicate 793:N-Triples 709:has name 661:someGraph 649:predicate 625:predicate 595:__ and __ 575:someGraph 560:predicate 542:someGraph 530:predicate 514:iteration 465:Namespace 453:Namespace 434:Namespace 396:RDF terms 335:July 2010 280:validator 51:July 2021 2803:Formulae 2633:Variable 2599:Migraine 2343:Formulae 2254:chimezie 2235:example: 2150:complete 1999:toPython 1121:datetime 805:publicID 773:publicID 606:G2 -= G2 603:G1 += G1 422:Variable 347:Overview 2838:destroy 2777:default 2624:Formula 2516:implies 2291:Formula 2127:itself. 2118:Context 2024:updated 849:subject 820:subject 801:JSON-LD 667:triples 655:object_ 643:subject 621:subject 617:triples 566:object_ 554:subject 536:object_ 524:subject 417:Literal 284:pyLDAPI 274:pySHACL 210:Website 201:License 194:Library 151:/rdflib 149:/RDFLib 120: ( 95: ( 3104:GitHub 3100:RDFLib 2980:FunOWL 2978:& 2972:Sparta 2915:plugin 2909:import 2900:plugin 2897:import 2894:rdflib 2884:plugin 2857:SQLite 2424:query. 2084:DELETE 2080:INSERT 2058:SELECT 1962:XSD_NS 1944:base64 1926:XSD_NS 1896:XSD_NS 1866:XSD_NS 1836:XSD_NS 1806:XSD_NS 1776:XSD_NS 1746:XSD_NS 1716:XSD_NS 1686:XSD_NS 1656:XSD_NS 1626:XSD_NS 1596:XSD_NS 1566:XSD_NS 1536:XSD_NS 1506:XSD_NS 1476:XSD_NS 1446:XSD_NS 1419:lambda 1395:XSD_NS 1365:XSD_NS 1335:XSD_NS 1305:XSD_NS 1275:XSD_NS 1245:XSD_NS 1215:XSD_NS 1185:XSD_NS 1151:XSD_NS 1130:lambda 1106:XSD_NS 1085:lambda 1061:XSD_NS 1040:lambda 1016:XSD_NS 986:XSD_NS 956:XSD_NS 926:XSD_NS 857:object 845:remove 841:remove 828:object 797:format 785:source 781:format 769:source 721:format 715:" 703:" 679:URIRef 629:object 548:assert 486:Person 450:import 447:rdflib 407:URIRef 358:idioms 297:pyLODE 264:OWL-RL 250:SPARQL 238:Python 234:RDFLib 220:  215:rdflib 170:Python 145:github 63:RDFLib 3065:, W3C 3042:, W3C 3019:, W3C 2954:graph 2933:Store 2912:Store 2852:MySQL 2836:_ / _ 2834:close 2832:_ / _ 2773:store 2760:store 2747:store 2476:=> 2370:Nodes 2320:Terms 2301:Graph 2223:MySQL 2208:Truth 2070:Graph 2066:Store 1914:float 1884:float 1464:float 1434:lower 911:float 765:parse 697:print 412:BNode 384:add() 366:Graph 278:SHACL 246:Graph 236:is a 2976:SuRF 2903:from 2891:from 2830:open 2785:None 2593:type 2544:type 2275:type 2260:said 2199:type 2181:type 2086:and 1986:None 1980:None 1956:None 1920:None 1890:None 1860:None 1830:None 1800:None 1770:None 1764:long 1740:None 1710:None 1680:None 1674:long 1650:None 1620:None 1590:None 1560:None 1554:long 1530:None 1500:None 1494:long 1470:None 1413:None 1389:None 1383:None 1359:None 1353:None 1329:None 1323:None 1299:None 1293:None 1263:None 1233:None 1203:None 1076:time 1031:date 1010:None 1001:bool 980:None 971:long 950:None 920:None 905:None 899:None 777:None 691:None 673:None 633:None 597:isub 593:iadd 510:iter 444:from 299:- a 268:OWL2 217:.dev 189:Type 147:.com 3102:on 2942:=.. 2921:get 2847:HDT 2820:API 2783:_= 2775:_,_ 2762:_,_ 2749:_,_ 2587:rdf 2566:has 2538:rdf 2510:log 2488:has 2269:rdf 2202:log 2193:rdf 2175:rdf 2068:of 2062:ASK 2060:or 1854:int 1824:int 1794:int 1734:int 1704:int 1644:int 1614:int 1584:int 1524:int 1148:(), 1103:(), 1058:(), 941:int 859:)) 830:)). 816:add 812:add 694:)): 640:for 521:for 495:SDO 480:SDO 459:SDO 373:). 330:. 242:RDF 205:BSD 3115:: 2982:. 2974:, 2957:.. 2948:of 2945:id 2936:)( 2766:_) 2753:_) 2627:?x 2615:.. 2560:?x 2535:?x 2482:?x 2461:?x 2263:{: 2082:, 2072:s) 1989:), 1959:), 1923:), 1893:), 1863:), 1833:), 1803:), 1773:), 1743:), 1713:), 1683:), 1653:), 1623:), 1593:), 1563:), 1533:), 1503:), 1473:), 1443:), 1440:in 1437:() 1392:), 1362:), 1332:), 1302:), 1272:), 1242:), 1212:), 1163:), 1118:), 1073:), 1028:), 998:), 968:), 938:), 908:), 874:eq 855:, 851:, 847:(( 843:: 826:, 822:, 818:(( 791:, 779:, 771:, 736:)) 712:{} 706:{} 688:), 670:(( 658:in 619:(( 591:__ 572:in 539:in 3002:. 2960:) 2930:, 2924:( 2918:. 2840:_ 2828:_ 2787:) 2779:_ 2731:- 2630:- 2621:- 2618:} 2612:{ 2596:: 2590:: 2584:c 2581:: 2578:_ 2575:c 2572:: 2569:_ 2563:: 2547:: 2541:: 2525:b 2522:: 2519:_ 2513:: 2507:a 2504:: 2501:_ 2491:} 2485:: 2479:{ 2473:} 2467:: 2464:a 2458:{ 2284:} 2278:: 2272:: 2257:: 2251:: 2220:: 2214:: 2205:: 2196:: 2184:: 2178:: 2160:. 2036:) 2032:( 2026:. 1992:} 1983:, 1977:( 1974:: 1968:u 1965:+ 1953:, 1947:. 1941:( 1938:: 1932:u 1929:+ 1917:, 1911:( 1908:: 1902:u 1899:+ 1887:, 1881:( 1878:: 1872:u 1869:+ 1857:, 1851:( 1848:: 1842:u 1839:+ 1827:, 1821:( 1818:: 1812:u 1809:+ 1797:, 1791:( 1788:: 1782:u 1779:+ 1767:, 1761:( 1758:: 1752:u 1749:+ 1737:, 1731:( 1728:: 1722:u 1719:+ 1707:, 1701:( 1698:: 1692:u 1689:+ 1677:, 1671:( 1668:: 1662:u 1659:+ 1647:, 1641:( 1638:: 1632:u 1629:+ 1617:, 1611:( 1608:: 1602:u 1599:+ 1587:, 1581:( 1578:: 1572:u 1569:+ 1557:, 1551:( 1548:: 1542:u 1539:+ 1527:, 1521:( 1518:: 1512:u 1509:+ 1497:, 1491:( 1488:: 1482:u 1479:+ 1467:, 1461:( 1458:: 1452:u 1449:+ 1431:. 1428:i 1425:: 1422:i 1416:, 1410:( 1407:: 1401:u 1398:+ 1386:, 1380:( 1377:: 1371:u 1368:+ 1356:, 1350:( 1347:: 1341:u 1338:+ 1326:, 1320:( 1317:: 1311:u 1308:+ 1296:, 1290:( 1287:: 1281:u 1278:+ 1266:, 1260:( 1257:: 1251:u 1248:+ 1236:, 1230:( 1227:: 1221:u 1218:+ 1206:, 1200:( 1197:: 1191:u 1188:+ 1182:{ 1179:= 1166:} 1157:u 1154:+ 1142:. 1139:i 1136:: 1133:i 1127:( 1124:: 1112:u 1109:+ 1097:. 1094:i 1091:: 1088:i 1082:( 1079:: 1067:u 1064:+ 1052:. 1049:i 1046:: 1043:i 1037:( 1034:: 1022:u 1019:+ 1013:, 1007:( 1004:: 992:u 989:+ 983:, 977:( 974:: 962:u 959:+ 953:, 947:( 944:: 932:u 929:+ 923:, 917:( 914:: 902:, 896:( 893:: 887:{ 884:= 775:= 767:( 733:o 730:, 727:s 724:( 718:. 700:( 682:( 676:, 664:. 652:, 646:, 627:, 623:, 578:, 569:) 563:, 557:, 551:( 545:: 533:, 527:, 483:. 474:) 468:( 462:= 337:) 333:( 124:) 99:) 53:) 49:( 38:.

Index

a manual or guide
rewrite this article

Developer(s)
Stable release
Repository
github.com/RDFLib/rdflib
Edit this at Wikidata
Python
Operating system
Cross-platform
Type
Library
License
rdflib.dev
Edit this on Wikidata
Python
RDF
Graph
SPARQL
rdflib 6.1.1
OWL-RL
OWL2
pySHACL
SHACL
pyLDAPI
Flask web framework
Linked Data
pyLODE
Web Ontology Language

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.