diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments-2.19.2.dist-info/licenses/AUTHORS b/TTS/Kokoro/.venv/Lib/site-packages/pygments-2.19.2.dist-info/licenses/AUTHORS new file mode 100644 index 0000000000000000000000000000000000000000..811c66ae178b354c0a0eb9bd5e7a9ac63b4b056c --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments-2.19.2.dist-info/licenses/AUTHORS @@ -0,0 +1,291 @@ +Pygments is written and maintained by Georg Brandl . + +Major developers are Tim Hatch and Armin Ronacher +. + +Other contributors, listed alphabetically, are: + +* Sam Aaron -- Ioke lexer +* Jean Abou Samra -- LilyPond lexer +* João Abecasis -- JSLT lexer +* Ali Afshar -- image formatter +* Thomas Aglassinger -- Easytrieve, JCL, Rexx, Transact-SQL and VBScript + lexers +* Maxence Ahlouche -- PostgreSQL Explain lexer +* Muthiah Annamalai -- Ezhil lexer +* Nikolay Antipov -- OpenSCAD lexer +* Kumar Appaiah -- Debian control lexer +* Andreas Amann -- AppleScript lexer +* Timothy Armstrong -- Dart lexer fixes +* Jeffrey Arnold -- R/S, Rd, BUGS, Jags, and Stan lexers +* Eiríkr Åsheim -- Uxntal lexer +* Jeremy Ashkenas -- CoffeeScript lexer +* José Joaquín Atria -- Praat lexer +* Stefan Matthias Aust -- Smalltalk lexer +* Lucas Bajolet -- Nit lexer +* Ben Bangert -- Mako lexers +* Max Battcher -- Darcs patch lexer +* Thomas Baruchel -- APL lexer +* Tim Baumann -- (Literate) Agda lexer +* Paul Baumgart, 280 North, Inc. -- Objective-J lexer +* Michael Bayer -- Myghty lexers +* Thomas Beale -- Archetype lexers +* John Benediktsson -- Factor lexer +* David Benjamin, Google LLC -- TLS lexer +* Trevor Bergeron -- mIRC formatter +* Vincent Bernat -- LessCSS lexer +* Christopher Bertels -- Fancy lexer +* Sébastien Bigaret -- QVT Operational lexer +* Jarrett Billingsley -- MiniD lexer +* Adam Blinkinsop -- Haskell, Redcode lexers +* Stéphane Blondon -- Procfile, SGF and Sieve lexers +* Frits van Bommel -- assembler lexers +* Pierre Bourdon -- bugfixes +* Martijn Braam -- Kernel log lexer, BARE lexer +* JD Browne, Google LLC -- GoogleSQL lexer +* Matthias Bussonnier -- ANSI style handling for terminal-256 formatter +* chebee7i -- Python traceback lexer improvements +* Hiram Chirino -- Scaml and Jade lexers +* Mauricio Caceres -- SAS and Stata lexers. +* Michael Camilleri, John Gabriele, sogaiu -- Janet lexer +* Daren Chandisingh -- Gleam lexer +* Ian Cooper -- VGL lexer +* David Corbett -- Inform, Jasmin, JSGF, Snowball, and TADS 3 lexers +* Leaf Corcoran -- MoonScript lexer +* Fraser Cormack -- TableGen lexer +* Gabriel Corona -- ASN.1 lexer +* Christopher Creutzig -- MuPAD lexer +* Daniël W. Crompton -- Pike lexer +* Pete Curry -- bugfixes +* Bryan Davis -- EBNF lexer +* Bruno Deferrari -- Shen lexer +* Walter Dörwald -- UL4 lexer +* Luke Drummond -- Meson lexer +* Giedrius Dubinskas -- HTML formatter improvements +* Owen Durni -- Haxe lexer +* Alexander Dutton, Oxford University Computing Services -- SPARQL lexer +* James Edwards -- Terraform lexer +* Nick Efford -- Python 3 lexer +* Sven Efftinge -- Xtend lexer +* Artem Egorkine -- terminal256 formatter +* Matthew Fernandez -- CAmkES lexer +* Paweł Fertyk -- GDScript lexer, HTML formatter improvements +* Michael Ficarra -- CPSA lexer +* James H. Fisher -- PostScript lexer +* Amanda Fitch, Google LLC -- GoogleSQL lexer +* William S. Fulton -- SWIG lexer +* Carlos Galdino -- Elixir and Elixir Console lexers +* Michael Galloy -- IDL lexer +* Naveen Garg -- Autohotkey lexer +* Simon Garnotel -- FreeFem++ lexer +* Laurent Gautier -- R/S lexer +* Alex Gaynor -- PyPy log lexer +* Richard Gerkin -- Igor Pro lexer +* Alain Gilbert -- TypeScript lexer +* Alex Gilding -- BlitzBasic lexer +* GitHub, Inc -- DASM16, Augeas, TOML, and Slash lexers +* Bertrand Goetzmann -- Groovy lexer +* Krzysiek Goj -- Scala lexer +* Rostyslav Golda -- FloScript lexer +* Andrey Golovizin -- BibTeX lexers +* Matt Good -- Genshi, Cheetah lexers +* Michał Górny -- vim modeline support +* Alex Gosse -- TrafficScript lexer +* Patrick Gotthardt -- PHP namespaces support +* Hubert Gruniaux -- C and C++ lexer improvements +* Olivier Guibe -- Asymptote lexer +* Phil Hagelberg -- Fennel lexer +* Florian Hahn -- Boogie lexer +* Martin Harriman -- SNOBOL lexer +* Matthew Harrison -- SVG formatter +* Steven Hazel -- Tcl lexer +* Dan Michael Heggø -- Turtle lexer +* Aslak Hellesøy -- Gherkin lexer +* Greg Hendershott -- Racket lexer +* Justin Hendrick -- ParaSail lexer +* Jordi Gutiérrez Hermoso -- Octave lexer +* David Hess, Fish Software, Inc. -- Objective-J lexer +* Ken Hilton -- Typographic Number Theory and Arrow lexers +* Varun Hiremath -- Debian control lexer +* Rob Hoelz -- Perl 6 lexer +* Doug Hogan -- Mscgen lexer +* Ben Hollis -- Mason lexer +* Max Horn -- GAP lexer +* Fred Hornsey -- OMG IDL Lexer +* Alastair Houghton -- Lexer inheritance facility +* Tim Howard -- BlitzMax lexer +* Dustin Howett -- Logos lexer +* Ivan Inozemtsev -- Fantom lexer +* Hiroaki Itoh -- Shell console rewrite, Lexers for PowerShell session, + MSDOS session, BC, WDiff +* Brian R. Jackson -- Tea lexer +* Christian Jann -- ShellSession lexer +* Jonas Camillus Jeppesen -- Line numbers and line highlighting for + RTF-formatter +* Dennis Kaarsemaker -- sources.list lexer +* Dmitri Kabak -- Inferno Limbo lexer +* Igor Kalnitsky -- vhdl lexer +* Colin Kennedy - USD lexer +* Alexander Kit -- MaskJS lexer +* Pekka Klärck -- Robot Framework lexer +* Gerwin Klein -- Isabelle lexer +* Eric Knibbe -- Lasso lexer +* Stepan Koltsov -- Clay lexer +* Oliver Kopp - Friendly grayscale style +* Adam Koprowski -- Opa lexer +* Benjamin Kowarsch -- Modula-2 lexer +* Domen Kožar -- Nix lexer +* Oleh Krekel -- Emacs Lisp lexer +* Alexander Kriegisch -- Kconfig and AspectJ lexers +* Marek Kubica -- Scheme lexer +* Jochen Kupperschmidt -- Markdown processor +* Gerd Kurzbach -- Modelica lexer +* Jon Larimer, Google Inc. -- Smali lexer +* Olov Lassus -- Dart lexer +* Matt Layman -- TAP lexer +* Dan Lazin, Google LLC -- GoogleSQL lexer +* Kristian Lyngstøl -- Varnish lexers +* Sylvestre Ledru -- Scilab lexer +* Chee Sing Lee -- Flatline lexer +* Mark Lee -- Vala lexer +* Thomas Linder Puls -- Visual Prolog lexer +* Pete Lomax -- Phix lexer +* Valentin Lorentz -- C++ lexer improvements +* Ben Mabey -- Gherkin lexer +* Angus MacArthur -- QML lexer +* Louis Mandel -- X10 lexer +* Louis Marchand -- Eiffel lexer +* Simone Margaritelli -- Hybris lexer +* Tim Martin - World of Warcraft TOC lexer +* Kirk McDonald -- D lexer +* Gordon McGregor -- SystemVerilog lexer +* Stephen McKamey -- Duel/JBST lexer +* Brian McKenna -- F# lexer +* Charles McLaughlin -- Puppet lexer +* Kurt McKee -- Tera Term macro lexer, PostgreSQL updates, MySQL overhaul, JSON lexer +* Joe Eli McIlvain -- Savi lexer +* Lukas Meuser -- BBCode formatter, Lua lexer +* Cat Miller -- Pig lexer +* Paul Miller -- LiveScript lexer +* Hong Minhee -- HTTP lexer +* Michael Mior -- Awk lexer +* Bruce Mitchener -- Dylan lexer rewrite +* Reuben Morais -- SourcePawn lexer +* Jon Morton -- Rust lexer +* Paulo Moura -- Logtalk lexer +* Mher Movsisyan -- DTD lexer +* Dejan Muhamedagic -- Crmsh lexer +* Adrien Nayrat -- PostgreSQL Explain lexer +* Ana Nelson -- Ragel, ANTLR, R console lexers +* David Neto, Google LLC -- WebGPU Shading Language lexer +* Kurt Neufeld -- Markdown lexer +* Nam T. Nguyen -- Monokai style +* Jesper Noehr -- HTML formatter "anchorlinenos" +* Mike Nolta -- Julia lexer +* Avery Nortonsmith -- Pointless lexer +* Jonas Obrist -- BBCode lexer +* Edward O'Callaghan -- Cryptol lexer +* David Oliva -- Rebol lexer +* Pat Pannuto -- nesC lexer +* Jon Parise -- Protocol buffers and Thrift lexers +* Benjamin Peterson -- Test suite refactoring +* Ronny Pfannschmidt -- BBCode lexer +* Dominik Picheta -- Nimrod lexer +* Andrew Pinkham -- RTF Formatter Refactoring +* Clément Prévost -- UrbiScript lexer +* Tanner Prynn -- cmdline -x option and loading lexers from files +* Oleh Prypin -- Crystal lexer (based on Ruby lexer) +* Nick Psaris -- K and Q lexers +* Xidorn Quan -- Web IDL lexer +* Elias Rabel -- Fortran fixed form lexer +* raichoo -- Idris lexer +* Daniel Ramirez -- GDScript lexer +* Kashif Rasul -- CUDA lexer +* Nathan Reed -- HLSL lexer +* Justin Reidy -- MXML lexer +* Jonathon Reinhart, Google LLC -- Soong lexer +* Norman Richards -- JSON lexer +* Corey Richardson -- Rust lexer updates +* Fabrizio Riguzzi -- cplint leder +* Lubomir Rintel -- GoodData MAQL and CL lexers +* Andre Roberge -- Tango style +* Georg Rollinger -- HSAIL lexer +* Michiel Roos -- TypoScript lexer +* Konrad Rudolph -- LaTeX formatter enhancements +* Mario Ruggier -- Evoque lexers +* Miikka Salminen -- Lovelace style, Hexdump lexer, lexer enhancements +* Stou Sandalski -- NumPy, FORTRAN, tcsh and XSLT lexers +* Matteo Sasso -- Common Lisp lexer +* Joe Schafer -- Ada lexer +* Max Schillinger -- TiddlyWiki5 lexer +* Andrew Schmidt -- X++ lexer +* Ken Schutte -- Matlab lexers +* René Schwaiger -- Rainbow Dash style +* Sebastian Schweizer -- Whiley lexer +* Tassilo Schweyer -- Io, MOOCode lexers +* Pablo Seminario -- PromQL lexer +* Ted Shaw -- AutoIt lexer +* Joerg Sieker -- ABAP lexer +* Robert Simmons -- Standard ML lexer +* Kirill Simonov -- YAML lexer +* Corbin Simpson -- Monte lexer +* Ville Skyttä -- ASCII armored lexer +* Alexander Smishlajev -- Visual FoxPro lexer +* Steve Spigarelli -- XQuery lexer +* Jerome St-Louis -- eC lexer +* Camil Staps -- Clean and NuSMV lexers; Solarized style +* James Strachan -- Kotlin lexer +* Tom Stuart -- Treetop lexer +* Colin Sullivan -- SuperCollider lexer +* Ben Swift -- Extempore lexer +* tatt61880 -- Kuin lexer +* Edoardo Tenani -- Arduino lexer +* Tiberius Teng -- default style overhaul +* Jeremy Thurgood -- Erlang, Squid config lexers +* Brian Tiffin -- OpenCOBOL lexer +* Bob Tolbert -- Hy lexer +* Doug Torrance -- Macaulay2 lexer +* Matthias Trute -- Forth lexer +* Tuoa Spi T4 -- Bdd lexer +* Erick Tryzelaar -- Felix lexer +* Alexander Udalov -- Kotlin lexer improvements +* Thomas Van Doren -- Chapel lexer +* Dave Van Ee -- Uxntal lexer updates +* Daniele Varrazzo -- PostgreSQL lexers +* Abe Voelker -- OpenEdge ABL lexer +* Pepijn de Vos -- HTML formatter CTags support +* Matthias Vallentin -- Bro lexer +* Benoît Vinot -- AMPL lexer +* Linh Vu Hong -- RSL lexer +* Taavi Väänänen -- Debian control lexer +* Immanuel Washington -- Smithy lexer +* Nathan Weizenbaum -- Haml and Sass lexers +* Nathan Whetsell -- Csound lexers +* Dietmar Winkler -- Modelica lexer +* Nils Winter -- Smalltalk lexer +* Davy Wybiral -- Clojure lexer +* Whitney Young -- ObjectiveC lexer +* Diego Zamboni -- CFengine3 lexer +* Enrique Zamudio -- Ceylon lexer +* Alex Zimin -- Nemerle lexer +* Rob Zimmerman -- Kal lexer +* Evgenii Zheltonozhskii -- Maple lexer +* Vincent Zurczak -- Roboconf lexer +* Hubert Gruniaux -- C and C++ lexer improvements +* Thomas Symalla -- AMDGPU Lexer +* 15b3 -- Image Formatter improvements +* Fabian Neumann -- CDDL lexer +* Thomas Duboucher -- CDDL lexer +* Philipp Imhof -- Pango Markup formatter +* Thomas Voss -- Sed lexer +* Martin Fischer -- WCAG contrast testing +* Marc Auberer -- Spice lexer +* Amr Hesham -- Carbon lexer +* diskdance -- Wikitext lexer +* vanillajonathan -- PRQL lexer +* Nikolay Antipov -- OpenSCAD lexer +* Markus Meyer, Nextron Systems -- YARA lexer +* Hannes Römer -- Mojo lexer +* Jan Frederik Schaefer -- PDDL lexer + +Many thanks for all contributions! diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments-2.19.2.dist-info/licenses/LICENSE b/TTS/Kokoro/.venv/Lib/site-packages/pygments-2.19.2.dist-info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..446a1a805c8a949579fb8a9799f2bec7777349dc --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments-2.19.2.dist-info/licenses/LICENSE @@ -0,0 +1,25 @@ +Copyright (c) 2006-2022 by the respective authors (see AUTHORS file). +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/__init__.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..31ab5d18c398b7dd980cfa5d19d4a5d6921d4127 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/__init__.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/__main__.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/__main__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6bbc01d522b07762a587113a37299a3970220a9b Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/__main__.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/cmdline.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/cmdline.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..365352e079310ac0a7cd9e838f469e110bb3f5de Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/cmdline.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/console.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/console.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7f423682c8bc7d3c868340af4dd219b93e5540a1 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/console.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/filter.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/filter.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..010962d8dd84b4bde71d60bf8c57fa3904db7a01 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/filter.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/formatter.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/formatter.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9bca226c14cf456975f2aee13a84ed7f13a8a671 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/formatter.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/lexer.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/lexer.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..536dcb0540f9852aba89c27479cf97f1f65dc456 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/lexer.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/modeline.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/modeline.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cb3276aec69e31f26793be19e2df7da15979ebfe Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/modeline.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/plugin.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/plugin.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f730be598f8f22249b9e5d909b010bf3c5cf68ec Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/plugin.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/regexopt.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/regexopt.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4a5db3b32281c96cae95f6018061cad9852c9e54 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/regexopt.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/scanner.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/scanner.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0a5fd0c29cf2d0b55de77686d2f7bb9506848de2 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/scanner.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/sphinxext.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/sphinxext.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f6f3180a7c3c1d18e18b6bd5adc3c1e64ecf6451 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/sphinxext.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/style.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/style.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..325cb88c7e2f1e4890697e420ca1968fe44e4df7 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/style.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/token.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/token.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1657cc547ac1219d437148db9b06892d725a66da Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/token.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/unistring.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/unistring.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1b62402a0fa563c6221e06c29ee6ff2eb7a42360 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/unistring.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/util.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/util.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..32a9d970bba245d348a35318c2464064388576f9 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/__pycache__/util.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/filters/__pycache__/__init__.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/filters/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9edaac7e047c82b21b038d6a049c26578a34db8d Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/filters/__pycache__/__init__.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/__init__.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5cfc9ad3f49c33cc9a58cef9441606eac273c189 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/__init__.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/_mapping.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/_mapping.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1a5a6132cb8783ecd0efcd3f2540e61555089f78 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/_mapping.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/bbcode.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/bbcode.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5231dcaa2467639662cefd29163a2277733c383b Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/bbcode.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/groff.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/groff.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..49d6b4134a9a6a3c3d36ff61fcc61ac1a45ff354 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/groff.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/html.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/html.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9ce0871a9ecb6a80b92a06abba0eeb40f0cb71a1 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/html.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/img.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/img.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0c7bb6415c1a3b0b8b0348c00a0f4924474735aa Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/img.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/irc.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/irc.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8be46832fa317b5561ef5a22a98673264d39a7c0 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/irc.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/latex.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/latex.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e03acf6ee57f41110944fddb957bfc22e257707f Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/latex.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/other.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/other.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..97b46dbcf6d07f7249ef5f31dbb04232d1a2881e Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/other.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/pangomarkup.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/pangomarkup.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fe7321c234f3f988879e796a8f7997399a70fcdf Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/pangomarkup.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/rtf.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/rtf.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1d4595dcd63b7739c679906ea59b7ba1ee0984c0 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/rtf.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/svg.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/svg.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2bf75bc99f22abbe25439fd576c8740662579b51 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/svg.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/terminal.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/terminal.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0b694229433c01b36b2799f36a967da7ec271db0 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/terminal.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/terminal256.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/terminal256.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6ad34cd37adcac18a45d883d3df8dcaa37732e3d Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/formatters/__pycache__/terminal256.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__init__.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..da5100095cd1bb5ef84873372437c21d7209bc99 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__init__.py @@ -0,0 +1,362 @@ +""" + pygments.lexers + ~~~~~~~~~~~~~~~ + + Pygments lexers. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re +import sys +import types +import fnmatch +from os.path import basename + +from pygments.lexers._mapping import LEXERS +from pygments.modeline import get_filetype_from_buffer +from pygments.plugin import find_plugin_lexers +from pygments.util import ClassNotFound, guess_decode + +COMPAT = { + 'Python3Lexer': 'PythonLexer', + 'Python3TracebackLexer': 'PythonTracebackLexer', + 'LeanLexer': 'Lean3Lexer', +} + +__all__ = ['get_lexer_by_name', 'get_lexer_for_filename', 'find_lexer_class', + 'guess_lexer', 'load_lexer_from_file'] + list(LEXERS) + list(COMPAT) + +_lexer_cache = {} +_pattern_cache = {} + + +def _fn_matches(fn, glob): + """Return whether the supplied file name fn matches pattern filename.""" + if glob not in _pattern_cache: + pattern = _pattern_cache[glob] = re.compile(fnmatch.translate(glob)) + return pattern.match(fn) + return _pattern_cache[glob].match(fn) + + +def _load_lexers(module_name): + """Load a lexer (and all others in the module too).""" + mod = __import__(module_name, None, None, ['__all__']) + for lexer_name in mod.__all__: + cls = getattr(mod, lexer_name) + _lexer_cache[cls.name] = cls + + +def get_all_lexers(plugins=True): + """Return a generator of tuples in the form ``(name, aliases, + filenames, mimetypes)`` of all know lexers. + + If *plugins* is true (the default), plugin lexers supplied by entrypoints + are also returned. Otherwise, only builtin ones are considered. + """ + for item in LEXERS.values(): + yield item[1:] + if plugins: + for lexer in find_plugin_lexers(): + yield lexer.name, lexer.aliases, lexer.filenames, lexer.mimetypes + + +def find_lexer_class(name): + """ + Return the `Lexer` subclass that with the *name* attribute as given by + the *name* argument. + """ + if name in _lexer_cache: + return _lexer_cache[name] + # lookup builtin lexers + for module_name, lname, aliases, _, _ in LEXERS.values(): + if name == lname: + _load_lexers(module_name) + return _lexer_cache[name] + # continue with lexers from setuptools entrypoints + for cls in find_plugin_lexers(): + if cls.name == name: + return cls + + +def find_lexer_class_by_name(_alias): + """ + Return the `Lexer` subclass that has `alias` in its aliases list, without + instantiating it. + + Like `get_lexer_by_name`, but does not instantiate the class. + + Will raise :exc:`pygments.util.ClassNotFound` if no lexer with that alias is + found. + + .. versionadded:: 2.2 + """ + if not _alias: + raise ClassNotFound(f'no lexer for alias {_alias!r} found') + # lookup builtin lexers + for module_name, name, aliases, _, _ in LEXERS.values(): + if _alias.lower() in aliases: + if name not in _lexer_cache: + _load_lexers(module_name) + return _lexer_cache[name] + # continue with lexers from setuptools entrypoints + for cls in find_plugin_lexers(): + if _alias.lower() in cls.aliases: + return cls + raise ClassNotFound(f'no lexer for alias {_alias!r} found') + + +def get_lexer_by_name(_alias, **options): + """ + Return an instance of a `Lexer` subclass that has `alias` in its + aliases list. The lexer is given the `options` at its + instantiation. + + Will raise :exc:`pygments.util.ClassNotFound` if no lexer with that alias is + found. + """ + if not _alias: + raise ClassNotFound(f'no lexer for alias {_alias!r} found') + + # lookup builtin lexers + for module_name, name, aliases, _, _ in LEXERS.values(): + if _alias.lower() in aliases: + if name not in _lexer_cache: + _load_lexers(module_name) + return _lexer_cache[name](**options) + # continue with lexers from setuptools entrypoints + for cls in find_plugin_lexers(): + if _alias.lower() in cls.aliases: + return cls(**options) + raise ClassNotFound(f'no lexer for alias {_alias!r} found') + + +def load_lexer_from_file(filename, lexername="CustomLexer", **options): + """Load a lexer from a file. + + This method expects a file located relative to the current working + directory, which contains a Lexer class. By default, it expects the + Lexer to be name CustomLexer; you can specify your own class name + as the second argument to this function. + + Users should be very careful with the input, because this method + is equivalent to running eval on the input file. + + Raises ClassNotFound if there are any problems importing the Lexer. + + .. versionadded:: 2.2 + """ + try: + # This empty dict will contain the namespace for the exec'd file + custom_namespace = {} + with open(filename, 'rb') as f: + exec(f.read(), custom_namespace) + # Retrieve the class `lexername` from that namespace + if lexername not in custom_namespace: + raise ClassNotFound(f'no valid {lexername} class found in {filename}') + lexer_class = custom_namespace[lexername] + # And finally instantiate it with the options + return lexer_class(**options) + except OSError as err: + raise ClassNotFound(f'cannot read {filename}: {err}') + except ClassNotFound: + raise + except Exception as err: + raise ClassNotFound(f'error when loading custom lexer: {err}') + + +def find_lexer_class_for_filename(_fn, code=None): + """Get a lexer for a filename. + + If multiple lexers match the filename pattern, use ``analyse_text()`` to + figure out which one is more appropriate. + + Returns None if not found. + """ + matches = [] + fn = basename(_fn) + for modname, name, _, filenames, _ in LEXERS.values(): + for filename in filenames: + if _fn_matches(fn, filename): + if name not in _lexer_cache: + _load_lexers(modname) + matches.append((_lexer_cache[name], filename)) + for cls in find_plugin_lexers(): + for filename in cls.filenames: + if _fn_matches(fn, filename): + matches.append((cls, filename)) + + if isinstance(code, bytes): + # decode it, since all analyse_text functions expect unicode + code = guess_decode(code) + + def get_rating(info): + cls, filename = info + # explicit patterns get a bonus + bonus = '*' not in filename and 0.5 or 0 + # The class _always_ defines analyse_text because it's included in + # the Lexer class. The default implementation returns None which + # gets turned into 0.0. Run scripts/detect_missing_analyse_text.py + # to find lexers which need it overridden. + if code: + return cls.analyse_text(code) + bonus, cls.__name__ + return cls.priority + bonus, cls.__name__ + + if matches: + matches.sort(key=get_rating) + # print "Possible lexers, after sort:", matches + return matches[-1][0] + + +def get_lexer_for_filename(_fn, code=None, **options): + """Get a lexer for a filename. + + Return a `Lexer` subclass instance that has a filename pattern + matching `fn`. The lexer is given the `options` at its + instantiation. + + Raise :exc:`pygments.util.ClassNotFound` if no lexer for that filename + is found. + + If multiple lexers match the filename pattern, use their ``analyse_text()`` + methods to figure out which one is more appropriate. + """ + res = find_lexer_class_for_filename(_fn, code) + if not res: + raise ClassNotFound(f'no lexer for filename {_fn!r} found') + return res(**options) + + +def get_lexer_for_mimetype(_mime, **options): + """ + Return a `Lexer` subclass instance that has `mime` in its mimetype + list. The lexer is given the `options` at its instantiation. + + Will raise :exc:`pygments.util.ClassNotFound` if not lexer for that mimetype + is found. + """ + for modname, name, _, _, mimetypes in LEXERS.values(): + if _mime in mimetypes: + if name not in _lexer_cache: + _load_lexers(modname) + return _lexer_cache[name](**options) + for cls in find_plugin_lexers(): + if _mime in cls.mimetypes: + return cls(**options) + raise ClassNotFound(f'no lexer for mimetype {_mime!r} found') + + +def _iter_lexerclasses(plugins=True): + """Return an iterator over all lexer classes.""" + for key in sorted(LEXERS): + module_name, name = LEXERS[key][:2] + if name not in _lexer_cache: + _load_lexers(module_name) + yield _lexer_cache[name] + if plugins: + yield from find_plugin_lexers() + + +def guess_lexer_for_filename(_fn, _text, **options): + """ + As :func:`guess_lexer()`, but only lexers which have a pattern in `filenames` + or `alias_filenames` that matches `filename` are taken into consideration. + + :exc:`pygments.util.ClassNotFound` is raised if no lexer thinks it can + handle the content. + """ + fn = basename(_fn) + primary = {} + matching_lexers = set() + for lexer in _iter_lexerclasses(): + for filename in lexer.filenames: + if _fn_matches(fn, filename): + matching_lexers.add(lexer) + primary[lexer] = True + for filename in lexer.alias_filenames: + if _fn_matches(fn, filename): + matching_lexers.add(lexer) + primary[lexer] = False + if not matching_lexers: + raise ClassNotFound(f'no lexer for filename {fn!r} found') + if len(matching_lexers) == 1: + return matching_lexers.pop()(**options) + result = [] + for lexer in matching_lexers: + rv = lexer.analyse_text(_text) + if rv == 1.0: + return lexer(**options) + result.append((rv, lexer)) + + def type_sort(t): + # sort by: + # - analyse score + # - is primary filename pattern? + # - priority + # - last resort: class name + return (t[0], primary[t[1]], t[1].priority, t[1].__name__) + result.sort(key=type_sort) + + return result[-1][1](**options) + + +def guess_lexer(_text, **options): + """ + Return a `Lexer` subclass instance that's guessed from the text in + `text`. For that, the :meth:`.analyse_text()` method of every known lexer + class is called with the text as argument, and the lexer which returned the + highest value will be instantiated and returned. + + :exc:`pygments.util.ClassNotFound` is raised if no lexer thinks it can + handle the content. + """ + + if not isinstance(_text, str): + inencoding = options.get('inencoding', options.get('encoding')) + if inencoding: + _text = _text.decode(inencoding or 'utf8') + else: + _text, _ = guess_decode(_text) + + # try to get a vim modeline first + ft = get_filetype_from_buffer(_text) + + if ft is not None: + try: + return get_lexer_by_name(ft, **options) + except ClassNotFound: + pass + + best_lexer = [0.0, None] + for lexer in _iter_lexerclasses(): + rv = lexer.analyse_text(_text) + if rv == 1.0: + return lexer(**options) + if rv > best_lexer[0]: + best_lexer[:] = (rv, lexer) + if not best_lexer[0] or best_lexer[1] is None: + raise ClassNotFound('no lexer matching the text found') + return best_lexer[1](**options) + + +class _automodule(types.ModuleType): + """Automatically import lexers.""" + + def __getattr__(self, name): + info = LEXERS.get(name) + if info: + _load_lexers(info[0]) + cls = _lexer_cache[info[1]] + setattr(self, name, cls) + return cls + if name in COMPAT: + return getattr(self, COMPAT[name]) + raise AttributeError(name) + + +oldmod = sys.modules[__name__] +newmod = _automodule(__name__) +newmod.__dict__.update(oldmod.__dict__) +sys.modules[__name__] = newmod +del newmod.newmod, newmod.oldmod, newmod.sys, newmod.types diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/__init__.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a58f4fdb2bb72339ecdf074be80edb511693d609 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/__init__.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_ada_builtins.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_ada_builtins.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8ddf7043267a81988b2a614e8e44ee73d647c583 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_ada_builtins.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_asy_builtins.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_asy_builtins.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6752af33ff398bb76be5eb606b4c0faab85f5355 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_asy_builtins.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_cl_builtins.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_cl_builtins.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d60755a599328a6cf63743a5beaf4c1ce193deb5 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_cl_builtins.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_cocoa_builtins.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_cocoa_builtins.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fe6a1dcc9ae8d31093b9917f495293238c10fecc Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_cocoa_builtins.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_csound_builtins.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_csound_builtins.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..78a6316eef04362e28e3864dec889c5cbb26d3e2 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_csound_builtins.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_css_builtins.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_css_builtins.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2131250d360a050880f8da53c5189cc5eec6cc30 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_css_builtins.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_googlesql_builtins.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_googlesql_builtins.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..03720a7ea2193577be57304dab6dd055fdb1135f Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_googlesql_builtins.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_julia_builtins.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_julia_builtins.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6555cdefb8b48ff446e8683141a81297afaae2e3 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_julia_builtins.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_lasso_builtins.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_lasso_builtins.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d7b1a56992f77e1247338ff1973163782eecff64 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_lasso_builtins.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_lilypond_builtins.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_lilypond_builtins.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..939bf518e3e0bfc045de21ef92e914085a65cd7b Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_lilypond_builtins.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_lua_builtins.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_lua_builtins.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c16bffb05eb0442dd95a421fec2d1f806808b143 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_lua_builtins.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_luau_builtins.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_luau_builtins.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7268c920087e7ab2465fe6fd09205db7856a4682 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_luau_builtins.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_mapping.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_mapping.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8fc5520473bed0feb9da0827a190570da4e283d2 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_mapping.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_mql_builtins.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_mql_builtins.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..56197bf6c92474361e6f1ba49529bafbe5655635 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_mql_builtins.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_mysql_builtins.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_mysql_builtins.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..84daab11becad4cc77d9570e75666cd655146b1a Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_mysql_builtins.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_openedge_builtins.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_openedge_builtins.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0b60dcfaf3d33885f00e7939ea474a1337ee92bc Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_openedge_builtins.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_php_builtins.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_php_builtins.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..eb81503e8eae49a2e2bfe34b3154c1c5898588cf Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_php_builtins.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_postgres_builtins.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_postgres_builtins.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..41ca535fb8f8b0c0d20bd557ef501dee480b512f Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_postgres_builtins.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_qlik_builtins.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_qlik_builtins.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..15f62323d53aa2f6be018f5ffeef294d00f22b85 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_qlik_builtins.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_scheme_builtins.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_scheme_builtins.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b42639792a35026f666e04abfc8d5956ba328128 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_scheme_builtins.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_scilab_builtins.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_scilab_builtins.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bd7dd842183227a5c733fc8c636dac7c5f0d5a74 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_scilab_builtins.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_sourcemod_builtins.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_sourcemod_builtins.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e6a156dfb425258477a037f092df548da5ba2d95 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_sourcemod_builtins.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_sql_builtins.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_sql_builtins.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2b8095393a9247fcf8a2fb6a10f3d2f493721b22 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_sql_builtins.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_stan_builtins.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_stan_builtins.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c6969369e02ab3e8f111da59e734e194410e6d99 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_stan_builtins.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_stata_builtins.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_stata_builtins.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e4dbda26e714373583417a97754fd466d167c9c5 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_stata_builtins.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_tsql_builtins.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_tsql_builtins.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b7051f2953ef6b3b4290c33ab57afb3ecd1f6714 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_tsql_builtins.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_usd_builtins.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_usd_builtins.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..df29af7a8a7a615ecdc9b7247577e7907ca709ff Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_usd_builtins.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_vbscript_builtins.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_vbscript_builtins.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b19bbf730cdb1ff0525766c1f98ce007433c8ba7 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_vbscript_builtins.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_vim_builtins.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_vim_builtins.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2ccca5ca05ffc5e9794242966af7afc179208346 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/_vim_builtins.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/actionscript.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/actionscript.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9e4a9a5882ced66390d1b928b04458df641c483a Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/actionscript.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ada.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ada.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..550de4de1bbbb84fbf42e14bb19bdffe79d4c012 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ada.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/agile.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/agile.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e6637bacf04c4a7058c4ba1f679d851323725954 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/agile.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/algebra.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/algebra.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..44790b9e5dcca64377c1aa943bc6e73f679e1146 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/algebra.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ambient.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ambient.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..445966ad793cb08afca3a03e2c679fa5012de752 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ambient.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/amdgpu.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/amdgpu.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..972b22958f319d1b97a9e7fee54cccca460ce0dc Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/amdgpu.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ampl.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ampl.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..818147774d644ae75d84b897bfe34d03749cfade Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ampl.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/apdlexer.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/apdlexer.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..96bebe0cb8da5a7925047e2e0952370365478a2a Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/apdlexer.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/apl.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/apl.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..536a3bf60582846b6592961d139c631c4e47af84 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/apl.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/archetype.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/archetype.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c4afe0c0171e147b1f7e5149ab65f6812197a936 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/archetype.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/arrow.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/arrow.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fb9c58f0fb0fe42165f9453affa8b1348975b977 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/arrow.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/arturo.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/arturo.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..745299e540c4f6beadecd223d4b066270b55c3c0 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/arturo.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/asc.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/asc.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a364d7c7834e733e7d7419aaee2f8e0517ca5b4e Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/asc.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/asm.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/asm.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e08f46e4b37e4f447e1956fd4a99f26c412a8568 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/asm.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/asn1.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/asn1.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..21bfd0055737eae39ca3359d4c4002c84439c10e Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/asn1.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/automation.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/automation.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..95b31e4439aeea20cfd4057d101ffb093e922955 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/automation.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/bare.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/bare.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6ad90a54702fa0aed0c73ad3d87a03d175d5a71d Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/bare.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/basic.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/basic.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..26c0f4a4303cfe7a0395c8489ef7c908c3526804 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/basic.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/bdd.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/bdd.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bdfe85288123c6c89c1886610b68bfdc6caad919 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/bdd.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/berry.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/berry.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fd7e7c9550ced9f449f3ff7e0714b86de7adcfe7 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/berry.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/bibtex.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/bibtex.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..abc06666f15a373894e43830d57d38870bda4106 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/bibtex.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/blueprint.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/blueprint.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..711e4c1d092047fc991810f1ddf0cb9b9497aa28 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/blueprint.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/boa.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/boa.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fafa5fdca65834791463d53ecbdbb42d383d2849 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/boa.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/bqn.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/bqn.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4eb5288958933c75cd1c1acd06c3f67b75bf22b1 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/bqn.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/business.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/business.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c6a552209eff284f31ba6bdc1256a64fb0e5753b Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/business.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/c_cpp.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/c_cpp.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bdfd6710b117a8629ff1454e21dd16e3f2ffa987 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/c_cpp.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/c_like.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/c_like.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dfe04b4f93ccba1e3af6520de19bb270013c014a Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/c_like.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/capnproto.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/capnproto.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9c58e3ab84003dd8930296f040ab72a0126bda20 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/capnproto.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/carbon.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/carbon.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6b27f1b922e8dde78b9e82303e4bd92ecffa64bb Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/carbon.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/cddl.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/cddl.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c1f4a9f9d5bc506afa75eb1f40f95803667460b1 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/cddl.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/chapel.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/chapel.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b9f99338e87fb32366ab9bc6008a4f050acd3876 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/chapel.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/clean.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/clean.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c95af35d0bbd5fa98d7f5787302eaac10212f45d Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/clean.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/codeql.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/codeql.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d394c50d9f51a22adbadbf4ff32ac3b989f56d41 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/codeql.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/comal.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/comal.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bf421e4a0bf8f423c57b84aaa9cd4612976eaaaa Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/comal.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/compiled.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/compiled.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d76ee389fbb44967aa90ae2af30ec1d7ef4fe9cf Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/compiled.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/configs.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/configs.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bf4b50085f94864811d283fa35d1c6a60b20d895 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/configs.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/console.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/console.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..492ce759a34f706ccc711ef0b994b8f5e5970bca Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/console.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/cplint.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/cplint.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..56c82192f1db416435fe3135eb45d7bc8897ac7b Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/cplint.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/crystal.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/crystal.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e911deea9133b6a6501341ebabcafe9d3a121abb Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/crystal.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/csound.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/csound.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..93f6601a09723da5038a42b57b7c2657d9860cb6 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/csound.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/css.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/css.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9edef17b7227f30a67ca4782c5ff5f8d11f33ac1 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/css.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/d.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/d.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..eb9f121edc192e2ef5078e37f38942aeb7b484ee Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/d.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/dalvik.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/dalvik.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3248d868ff1bd3af6c0c3b76e015b28a9a1843a9 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/dalvik.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/data.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/data.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1accc3ce9ee06177bc673dbd7fd3e1c909cd2d18 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/data.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/dax.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/dax.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..36832572b49a8036038d6840f9a7d49da1a4a6ee Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/dax.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/devicetree.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/devicetree.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ef603829a6277f0594443f8186390ca37365517c Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/devicetree.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/diff.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/diff.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fe4d643363f124a1c23feb0a40e55eb602a5a75f Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/diff.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/dns.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/dns.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..59d1a55ad222a3d5d2efe2ea05cbbe0ea5b80742 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/dns.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/dotnet.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/dotnet.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..07a8fc633059589fa66204a2b868ff82110b17ec Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/dotnet.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/dsls.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/dsls.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..652de3922cace24c18b522354c1c32a681081f65 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/dsls.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/dylan.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/dylan.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..10949a7fd3bcc8e65f88f6fc8e3a8beff24b1f3f Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/dylan.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ecl.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ecl.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d9e42c6ed8f654e0368456556d0e9d032947f68e Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ecl.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/eiffel.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/eiffel.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..35d46ce2487cbd09aaca2a84bfa45675d03b6be7 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/eiffel.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/elm.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/elm.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..386a500d672dff3616d7a494dddfb1951fc99e56 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/elm.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/elpi.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/elpi.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bdfce386a6f69e4aa200b80cc04739d725111991 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/elpi.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/email.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/email.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f7f279c3820545029f197b17b20205e6b246569a Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/email.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/erlang.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/erlang.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a2312a269275ad9408731deea38c5b0eaad44f76 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/erlang.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/esoteric.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/esoteric.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a43813b56935656703bcc9004194de2c6cf3a2ba Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/esoteric.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ezhil.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ezhil.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0244022aad830af970a1270a8ef481a002f25c87 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ezhil.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/factor.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/factor.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9e23ce84a41b8c28c1e047a72a0bbe2ae44bf9b2 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/factor.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/fantom.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/fantom.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..50ea835ad479b1ce769115f94d912c5df2681aab Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/fantom.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/felix.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/felix.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..eb1bcda897ef7355fcc8b02aeae789373ea7c8c2 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/felix.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/fift.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/fift.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..21eb884b13a5d9079d0317a67621f7c28be8dda5 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/fift.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/floscript.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/floscript.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c51fb4d0993459b82fe4e5819249126e3409c67e Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/floscript.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/forth.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/forth.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..03e08d243668ce035c44a8ad6f8472d49743f2e5 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/forth.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/fortran.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/fortran.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..74baf9876e917c3f5c5cb175bf6e512489dd94a5 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/fortran.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/foxpro.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/foxpro.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9580cbe80bbad27604e9c378b208fb6d2208abed Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/foxpro.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/freefem.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/freefem.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b7edb16d675dbfc669dd747b4c1f37802b7186d4 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/freefem.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/func.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/func.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..33f5c78d114ad20a10bd21268b2c9e06f5a1de9a Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/func.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/functional.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/functional.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..72999ab8ce6d04a522217838bf022a1490961266 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/functional.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/futhark.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/futhark.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..06fb90781b7eba0f3dbed93660f338a76c35b902 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/futhark.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/gcodelexer.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/gcodelexer.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..10b2bcb0edfd132bfc2382ab45a93262fd5af279 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/gcodelexer.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/gdscript.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/gdscript.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f70e3e2bf6418d117cb94c82c27fe79cacac571a Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/gdscript.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/gleam.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/gleam.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0d7f1e2c5e0732a65561f7696c2d6e09a7d3c705 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/gleam.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/go.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/go.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..77d33698b8ad9989f05dc713ec40596febdf15d1 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/go.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/grammar_notation.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/grammar_notation.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b120d5732af5790df0f6baa5079bec2e8aa4ecaa Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/grammar_notation.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/graph.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/graph.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c5d046933bbfbdab38ee23e621c12eea98753eae Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/graph.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/graphics.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/graphics.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..984481c2a3de56bbea378036554a8297091ef5c6 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/graphics.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/graphql.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/graphql.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8b91cade59711c7647d286f420a799c7cdd832d5 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/graphql.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/graphviz.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/graphviz.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cb5ba142ecf34f65f10c13a3e37bd0728c5a5872 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/graphviz.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/gsql.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/gsql.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..be70cf2a7b0ae5d79e7b605c657cedf376b3b891 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/gsql.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/hare.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/hare.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3cb1f68b658933204376da7bf20e7d4986a4f5a3 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/hare.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/haskell.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/haskell.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..de9332fc90d48cacacb8d1cc2eb96e557f0c39c9 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/haskell.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/haxe.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/haxe.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e350b3b98ab5576ae8d331725f57b52737bcae82 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/haxe.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/hdl.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/hdl.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8a86f24c36105eb07bf087a4e3063ea41963b82a Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/hdl.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/hexdump.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/hexdump.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a232e683cc13b26256a0e606b5b85e059dd0485e Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/hexdump.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/html.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/html.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d2164773209d10cf697b0b2f0b1d0c9111033168 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/html.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/idl.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/idl.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cb71a965ae8c711d174a615bda35b4d83d0eb83a Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/idl.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/igor.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/igor.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6a49bb46441873c907ac9140c92d2bb2157fcf62 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/igor.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/inferno.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/inferno.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6b72d887964a2e9acd99d3bb9b29e128044f391d Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/inferno.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/installers.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/installers.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4fe614c586c94f049f33fdc58616c09c7919fe05 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/installers.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/int_fiction.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/int_fiction.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..097726ebaf42c81f9020d58ae82d2a81812a5038 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/int_fiction.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/iolang.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/iolang.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9078d13555be9005df7349a09e473c9828124eb9 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/iolang.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/j.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/j.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cf09df5b8c657fd9d531c08b46e7ec37bd1f915d Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/j.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/javascript.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/javascript.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a266b64e986dd3f08f50355ed283d4a51df5d3ef Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/javascript.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/jmespath.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/jmespath.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..95b7216b6f08f04b073a75b09453e8a89787609c Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/jmespath.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/jslt.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/jslt.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1a03106fad0d3edd3eeb6fb4fe31906def397574 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/jslt.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/json5.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/json5.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6619376f7d6886f455933f5ebe5c1b8f3d8a28ea Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/json5.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/jsonnet.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/jsonnet.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e733b3fb853f3d7f1cbe1bba8699eab48e544914 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/jsonnet.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/jsx.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/jsx.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3b1af2531cc09ac3bfa989e3c69c198eb3045af9 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/jsx.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/julia.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/julia.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..115415e2c047bb587c5b85f135d10d14b8c11b36 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/julia.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/jvm.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/jvm.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8ef31a1814a35e98636b6a47abb788f9a9eef606 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/jvm.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/kuin.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/kuin.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..492a33e861aedd62a5feeb72d74b3552ccba8140 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/kuin.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/kusto.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/kusto.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..26af6a737530175430daf089ca9f83617343abb8 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/kusto.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ldap.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ldap.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..15aa26df80be74e3dee15c1fe76bac35fa396d95 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ldap.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/lean.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/lean.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4e5e17a0024e1c36116d0621c9b9b8b2cf06c24e Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/lean.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/lilypond.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/lilypond.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d7f030f0b5940857fa26910fa052d56e66a7c708 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/lilypond.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/macaulay2.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/macaulay2.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cbc75b9f886ffa339474b161c3aaa3ea4577b921 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/macaulay2.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/make.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/make.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7526da95cf6d4f969d27716e0aa14468ced6d37c Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/make.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/maple.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/maple.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..78c2062293ed0d1a4fa1e2f27a8b048178be8f22 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/maple.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/markup.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/markup.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3ffb1a3b44d1dc368ffbe9008d36e351c34997b7 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/markup.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/math.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/math.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..751a5037a733a8916e90284510b59c32f8c13ebf Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/math.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/matlab.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/matlab.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ed470684d142717b2e7caaca57e710a37681f3aa Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/matlab.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/maxima.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/maxima.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..24194738db47e9df92989afb82cfabdd8413fc51 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/maxima.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/meson.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/meson.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..47c3d3d4672697bb6e2811195d0d93de0b7b83de Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/meson.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/mime.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/mime.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ee256dca677bf62c46d37f56fd52628d89f7cec3 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/mime.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/minecraft.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/minecraft.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4dda8bc786f5786f40d06c2043c9e1065cde9ecd Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/minecraft.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/mips.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/mips.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7d95efaa27c88bc911cbf1ad23a081f3f88eff7a Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/mips.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ml.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ml.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..eba717fae5b7ea81e8aaa26166a63985d07dcb41 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ml.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/modeling.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/modeling.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c698963768f494df5afaa30911101cc364e2f966 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/modeling.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/modula2.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/modula2.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3219a86bd46eb548ef6e2c9b32210dab64758b65 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/modula2.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/mojo.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/mojo.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6f7a27f41397f3ed397685846fb275b8273a60e7 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/mojo.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/monte.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/monte.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..88bd0f8c89d62578f46d0d2cb1dae605b55c6068 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/monte.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/mosel.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/mosel.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..34caaad92fc5b65f4d6facec27cc8a0d25db3e8b Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/mosel.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ncl.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ncl.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f35c76c3e14f8401b9349b68819050b88f1cf10e Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ncl.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/nimrod.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/nimrod.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1659badb3df8ae1b5d6bccc3c8697dd9de673d2b Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/nimrod.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/nit.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/nit.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dcd813493877c8c74a375ba415f74c0ce6e96ee4 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/nit.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/nix.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/nix.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4b004bf12969c89c3a7ea4883fd3f8fb5200fb83 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/nix.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/numbair.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/numbair.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..96015dea5862d1ff9b4913e4895d401be0d8bb68 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/numbair.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/oberon.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/oberon.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2cade0f6cce8f7a9ffcc3ad432bbd9faac4f2a23 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/oberon.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/objective.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/objective.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b126109985fb170ba3645b3c940a7d6f10e21167 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/objective.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ooc.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ooc.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f54598f2cfe985d3ae30f0e0c79433896ccd740e Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ooc.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/openscad.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/openscad.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d50c7fa4fd820e30a7408d74c2fe59e34697e493 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/openscad.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/other.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/other.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..39d1fc353308c16b3b06448b885601772875d3ae Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/other.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/parasail.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/parasail.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6d803b5e4e8de8124f1d9c5e86f73487ff1a818b Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/parasail.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/parsers.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/parsers.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6b09ec10ff003b7ee8520049fdc25790a9c3cb47 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/parsers.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/pascal.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/pascal.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..660559da1e08403a27b33cbd3b45b66338aa2a87 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/pascal.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/pawn.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/pawn.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8d9eb8df0370a0333b4a3340c37b1df3218b83bc Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/pawn.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/pddl.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/pddl.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1961baf3529810188ee7372b3fec3a52049b3234 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/pddl.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/perl.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/perl.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f948886faf9a0e7dd431e2cb6d20c9dd3a5ebf45 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/perl.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/phix.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/phix.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d133af00ef1a35483345a11768f3630a528b78f7 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/phix.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/php.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/php.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d41915a0e6dc7425b4e9b83a34ae0fb39bcf4938 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/php.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/pointless.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/pointless.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d289d1405bb0b1cf259cb3676b7c69708d3dbc4c Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/pointless.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/pony.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/pony.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7ea4dd70249dd5642c0e7657f33f10b47efec723 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/pony.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/praat.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/praat.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8fbbba7410a544ac10dcd99f3e99fcaf4967b6b7 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/praat.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/procfile.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/procfile.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..18f6995959ca4513d34948da0f68755e0a43ccf8 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/procfile.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/prolog.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/prolog.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e52f66b56cb8a08209c701ff4f1f2e0d1a05f8ca Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/prolog.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/promql.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/promql.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4ff7315e3bd8cc7f9535fa278e16280c00346068 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/promql.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/prql.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/prql.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4e8d19e5b8da124e8de9cca322d4a74e581dddb5 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/prql.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ptx.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ptx.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f1f712dc943456c1d95d4c8c39c1796c47391753 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ptx.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/python.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/python.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1ccb214bb9204eb0df9e18073dc3184353f95d80 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/python.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/q.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/q.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fc2849a1cd41ff2f609407951b5e8feae7b84d06 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/q.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/qlik.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/qlik.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8ada17f27a9f821369fc994e8f699c11d2cc7ce2 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/qlik.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/qvt.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/qvt.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4ddb51f3bdfcc2897ca13568af1269d0abf0c4a8 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/qvt.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/r.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/r.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..21cd747a0071391b4852ff522f8625ca8ef762b3 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/r.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/rdf.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/rdf.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ef7538123c938051a79a4cf4c588d63421a87c7d Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/rdf.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/rebol.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/rebol.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..da69161cc45d076e3854ab4bf30867dbeb4736d7 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/rebol.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/rego.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/rego.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d85780c3298b182586428aca32c1062fbe674fa1 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/rego.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/resource.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/resource.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..27db2f7947b6afde6d2d41bfc39122d23ea27129 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/resource.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ride.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ride.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..882d6d91aab8827f11244e9f91721c7514302c18 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ride.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/rita.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/rita.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ebf83e047c925e43ceaa0a8c32418612f69e2e11 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/rita.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/rnc.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/rnc.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4e0c92e0f2b1fb33747013b62972d41105b10375 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/rnc.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/roboconf.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/roboconf.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..062816f63528644d342c8973e6ca5ac84b02bb65 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/roboconf.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/robotframework.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/robotframework.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ab27fbd64c2dd0155649cf062e305791f8aad588 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/robotframework.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ruby.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ruby.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5e77d1558b7930e31966705a18914df1ef07bf68 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ruby.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/rust.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/rust.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..036ec59504e9e44044a68aa489fb8ef77a2e7ae4 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/rust.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/sas.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/sas.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ddb37fa0d1176eb7b890ba281855951df6ebba45 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/sas.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/savi.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/savi.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cf83bf3e271a74a27a801a5ebed5a20498a43fb6 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/savi.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/scdoc.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/scdoc.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d6678ebed997f6c34bd84fa2ae89138d76b48e0e Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/scdoc.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/scripting.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/scripting.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2a4168abc1f9914d9d4e63c220da1fb58cf231ec Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/scripting.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/sgf.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/sgf.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ad5647da44d97999b701a986bd11ff1c0a8febea Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/sgf.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/shell.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/shell.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f8210e5bc5a4a2f3f61fb355635cf66a47c980fd Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/shell.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/sieve.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/sieve.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3433f502766b2635ca42de070493721bbc3969b4 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/sieve.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/slash.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/slash.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a09611470568ea32877b3e6b5061da88c03a5c79 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/slash.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/smalltalk.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/smalltalk.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f43ca7ba271cc2f0088db3471c9e6d62193dda85 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/smalltalk.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/smithy.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/smithy.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9b46a1c85169d28f1eb47537ec9ca316a391310f Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/smithy.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/smv.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/smv.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fa462e7406aaa216ade0b9f82c867d586f917d1b Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/smv.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/snobol.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/snobol.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..23172ab44fbc8adf66b15b3756597ea80d700544 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/snobol.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/solidity.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/solidity.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..57a139b2912f4585e74405c091b09999a42bd441 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/solidity.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/soong.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/soong.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..356ce72216c436f9ab3bf40c4d33f52f2697ebcf Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/soong.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/sophia.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/sophia.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bfc3c3ee6af79c5db2800453317177c91645548e Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/sophia.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/special.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/special.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5a6326d3c13953077d9be21b6608980c7158a1d8 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/special.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/spice.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/spice.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d109b8d0437ed3cba726b2ae533ee789e739caff Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/spice.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/sql.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/sql.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..38a018881516fbe564da43cc97d0d44497dc624c Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/sql.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/srcinfo.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/srcinfo.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3cc93d0a438ea128e5aaa3f299bcd114f6854c7c Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/srcinfo.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/stata.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/stata.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2e607fbd7153eb768236bd5674cded63acc2e095 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/stata.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/supercollider.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/supercollider.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1ccd36933c48ec39e15a29886d4a1acd1a89c99b Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/supercollider.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/tablegen.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/tablegen.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e5e96322a4a3de6a052ce66295b01f89e544f790 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/tablegen.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/tact.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/tact.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bd49c7f3d2108313dff644d49811191fe1b2671d Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/tact.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/tal.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/tal.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c06083baab9652619af310db96fb06a7f4ea7af7 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/tal.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/tcl.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/tcl.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..525e338de72a4c5cb81e19fd1620f9e145af584d Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/tcl.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/teal.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/teal.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c49251eff8157c860c0f543fcf9dcf6c27e4de9b Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/teal.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/templates.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/templates.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d11e775215f1ce7193e5896aee23601f038e1dc0 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/templates.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/teraterm.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/teraterm.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9ff20bcdd0e6cad45bf2a740b6fe3ca082e2ad55 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/teraterm.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/testing.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/testing.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7e17385fca82d0c75473cde4b5cdac2e6f3d70ee Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/testing.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/text.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/text.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2349b639eb7f752751e8effae552765f14b244fe Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/text.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/textedit.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/textedit.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..484d49f5300e8ffc31f7d8c9590e3c4d776e75b3 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/textedit.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/textfmts.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/textfmts.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c6c93a2702e77cb7d9657c6dbf3fddc6d67155fb Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/textfmts.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/theorem.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/theorem.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ee102515d680832ab20a45327390586629985c0c Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/theorem.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/thingsdb.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/thingsdb.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7d4814719b5d60171f62d8cf3210f2d88d18a42a Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/thingsdb.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/tlb.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/tlb.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cab074970ee049c81e148fed221d7c568fefd611 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/tlb.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/tls.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/tls.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b3d58ef772071335a53ed63e7ef2007a8f9c34ea Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/tls.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/tnt.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/tnt.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a14f0d28e49ea6d9f99541d3d9b71d83655348d0 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/tnt.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/trafficscript.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/trafficscript.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e3d4c765e2d5211d5c918910b7a03e965ce2e7e2 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/trafficscript.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/typoscript.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/typoscript.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c0f5c42d04410f608b49ce6dd6808c65f1488635 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/typoscript.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/typst.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/typst.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c2e93ca1a3d40793b5d563742f716d3393571972 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/typst.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ul4.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ul4.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fda4189105bb701ed1409f0522e5b1813d3847ea Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/ul4.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/unicon.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/unicon.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b636055287efdadf6b946c1e35eb7bc7aa6b204f Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/unicon.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/urbi.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/urbi.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e02d63d77c7a2e2cd4e95f1904198481b28b300d Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/urbi.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/usd.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/usd.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d1040bf274425a960b374bc5f79971495622c8dd Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/usd.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/varnish.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/varnish.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dc0263de4fddd7737b6e1fd475c0886f1adb6f61 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/varnish.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/verification.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/verification.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..613e57a77c50edcceebd55d60a5ab9886fdb4cc3 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/verification.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/verifpal.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/verifpal.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b8838a59302b3ffe8815eb49b03cd78c18509566 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/verifpal.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/vip.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/vip.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e3c425dada2dff714f5db634a87ea4378fc9d8b1 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/vip.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/vyper.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/vyper.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..94433235a150f11ace0ed87c88adea950deb1d1a Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/vyper.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/web.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/web.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7fbec38f9e62de26afd140feda87fcb3ad6b269f Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/web.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/webassembly.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/webassembly.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..25192d6ff8635ab816ca265a4bfd3164bba007ed Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/webassembly.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/webidl.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/webidl.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5000b0142ae62832da09a0e60cf9654b8d125459 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/webidl.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/webmisc.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/webmisc.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d299c307263697ccf48ba4c0cbfb2a55bbccc2be Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/webmisc.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/wgsl.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/wgsl.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f4e43d998995773666c77614f4938a664e297f07 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/wgsl.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/whiley.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/whiley.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..aa5b4ab4fa50075b9c48d3ed11af24e782296268 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/whiley.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/wowtoc.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/wowtoc.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..10f9f475da6482c0297163024bf4a03ec990a576 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/wowtoc.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/wren.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/wren.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f1f471f62452917f6b51f7ed22fb0141d19f8ade Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/wren.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/x10.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/x10.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e4dd92cb2a6b216645b36c37ff9ffb3d34c7a136 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/x10.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/xorg.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/xorg.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c2a60e00b6e659df5da09a606c6061acaba73523 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/xorg.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/yang.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/yang.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..057f602d2e53e39b42591769d9e154be4749c833 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/yang.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/yara.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/yara.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6c66b2090388859f31ca35acbb5934428abe1546 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/yara.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/zig.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/zig.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..77604468170c55c8c0d53e025934da823ebfadc0 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/__pycache__/zig.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/_scheme_builtins.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/_scheme_builtins.py new file mode 100644 index 0000000000000000000000000000000000000000..c35a533d1b5eac057b94786585238c539d200433 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/_scheme_builtins.py @@ -0,0 +1,1609 @@ +""" + pygments.lexers._scheme_builtins + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Scheme builtins. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +# Autogenerated by external/scheme-builtins-generator.scm +# using Guile 3.0.5.130-5a1e7. + +scheme_keywords = { + "*unspecified*", + "...", + "=>", + "@", + "@@", + "_", + "add-to-load-path", + "and", + "begin", + "begin-deprecated", + "case", + "case-lambda", + "case-lambda*", + "cond", + "cond-expand", + "current-filename", + "current-source-location", + "debug-set!", + "define", + "define*", + "define-inlinable", + "define-library", + "define-macro", + "define-module", + "define-once", + "define-option-interface", + "define-private", + "define-public", + "define-record-type", + "define-syntax", + "define-syntax-parameter", + "define-syntax-rule", + "define-values", + "defmacro", + "defmacro-public", + "delay", + "do", + "else", + "eval-when", + "export", + "export!", + "export-syntax", + "false-if-exception", + "identifier-syntax", + "if", + "import", + "include", + "include-ci", + "include-from-path", + "include-library-declarations", + "lambda", + "lambda*", + "let", + "let*", + "let*-values", + "let-syntax", + "let-values", + "letrec", + "letrec*", + "letrec-syntax", + "library", + "load", + "match", + "match-lambda", + "match-lambda*", + "match-let", + "match-let*", + "match-letrec", + "or", + "parameterize", + "print-set!", + "quasiquote", + "quasisyntax", + "quote", + "quote-syntax", + "re-export", + "re-export-syntax", + "read-set!", + "require-extension", + "set!", + "start-stack", + "syntax", + "syntax-case", + "syntax-error", + "syntax-parameterize", + "syntax-rules", + "unless", + "unquote", + "unquote-splicing", + "unsyntax", + "unsyntax-splicing", + "use-modules", + "when", + "while", + "with-ellipsis", + "with-fluids", + "with-syntax", + "λ", +} + +scheme_builtins = { + "$sc-dispatch", + "%char-set-dump", + "%get-pre-modules-obarray", + "%get-stack-size", + "%global-site-dir", + "%init-rdelim-builtins", + "%init-rw-builtins", + "%library-dir", + "%load-announce", + "%load-hook", + "%make-void-port", + "%package-data-dir", + "%port-property", + "%print-module", + "%resolve-variable", + "%search-load-path", + "%set-port-property!", + "%site-ccache-dir", + "%site-dir", + "%start-stack", + "%string-dump", + "%symbol-dump", + "%warn-auto-compilation-enabled", + "*", + "+", + "-", + "->bool", + "->char-set", + "/", + "1+", + "1-", + "<", + "<=", + "=", + ">", + ">=", + "abort-to-prompt", + "abort-to-prompt*", + "abs", + "absolute-file-name?", + "accept", + "access?", + "acons", + "acos", + "acosh", + "add-hook!", + "addrinfo:addr", + "addrinfo:canonname", + "addrinfo:fam", + "addrinfo:flags", + "addrinfo:protocol", + "addrinfo:socktype", + "adjust-port-revealed!", + "alarm", + "alist-cons", + "alist-copy", + "alist-delete", + "alist-delete!", + "allocate-struct", + "and-map", + "and=>", + "angle", + "any", + "append", + "append!", + "append-map", + "append-map!", + "append-reverse", + "append-reverse!", + "apply", + "array->list", + "array-cell-ref", + "array-cell-set!", + "array-contents", + "array-copy!", + "array-copy-in-order!", + "array-dimensions", + "array-equal?", + "array-fill!", + "array-for-each", + "array-in-bounds?", + "array-index-map!", + "array-length", + "array-map!", + "array-map-in-order!", + "array-rank", + "array-ref", + "array-set!", + "array-shape", + "array-slice", + "array-slice-for-each", + "array-slice-for-each-in-order", + "array-type", + "array-type-code", + "array?", + "ash", + "asin", + "asinh", + "assert-load-verbosity", + "assoc", + "assoc-ref", + "assoc-remove!", + "assoc-set!", + "assq", + "assq-ref", + "assq-remove!", + "assq-set!", + "assv", + "assv-ref", + "assv-remove!", + "assv-set!", + "atan", + "atanh", + "autoload-done!", + "autoload-done-or-in-progress?", + "autoload-in-progress!", + "backtrace", + "basename", + "batch-mode?", + "beautify-user-module!", + "bind", + "bind-textdomain-codeset", + "bindtextdomain", + "bit-count", + "bit-count*", + "bit-extract", + "bit-invert!", + "bit-position", + "bit-set*!", + "bitvector", + "bitvector->list", + "bitvector-bit-clear?", + "bitvector-bit-set?", + "bitvector-clear-all-bits!", + "bitvector-clear-bit!", + "bitvector-clear-bits!", + "bitvector-count", + "bitvector-count-bits", + "bitvector-fill!", + "bitvector-flip-all-bits!", + "bitvector-length", + "bitvector-position", + "bitvector-ref", + "bitvector-set!", + "bitvector-set-all-bits!", + "bitvector-set-bit!", + "bitvector-set-bits!", + "bitvector?", + "boolean?", + "bound-identifier=?", + "break", + "break!", + "caaaar", + "caaadr", + "caaar", + "caadar", + "caaddr", + "caadr", + "caar", + "cadaar", + "cadadr", + "cadar", + "caddar", + "cadddr", + "caddr", + "cadr", + "call-with-blocked-asyncs", + "call-with-current-continuation", + "call-with-deferred-observers", + "call-with-include-port", + "call-with-input-file", + "call-with-input-string", + "call-with-module-autoload-lock", + "call-with-output-file", + "call-with-output-string", + "call-with-port", + "call-with-prompt", + "call-with-unblocked-asyncs", + "call-with-values", + "call/cc", + "canonicalize-path", + "car", + "car+cdr", + "catch", + "cdaaar", + "cdaadr", + "cdaar", + "cdadar", + "cdaddr", + "cdadr", + "cdar", + "cddaar", + "cddadr", + "cddar", + "cdddar", + "cddddr", + "cdddr", + "cddr", + "cdr", + "ceiling", + "ceiling-quotient", + "ceiling-remainder", + "ceiling/", + "centered-quotient", + "centered-remainder", + "centered/", + "char->integer", + "char-alphabetic?", + "char-ci<=?", + "char-ci=?", + "char-ci>?", + "char-downcase", + "char-general-category", + "char-is-both?", + "char-lower-case?", + "char-numeric?", + "char-ready?", + "char-set", + "char-set->list", + "char-set->string", + "char-set-adjoin", + "char-set-adjoin!", + "char-set-any", + "char-set-complement", + "char-set-complement!", + "char-set-contains?", + "char-set-copy", + "char-set-count", + "char-set-cursor", + "char-set-cursor-next", + "char-set-delete", + "char-set-delete!", + "char-set-diff+intersection", + "char-set-diff+intersection!", + "char-set-difference", + "char-set-difference!", + "char-set-every", + "char-set-filter", + "char-set-filter!", + "char-set-fold", + "char-set-for-each", + "char-set-hash", + "char-set-intersection", + "char-set-intersection!", + "char-set-map", + "char-set-ref", + "char-set-size", + "char-set-unfold", + "char-set-unfold!", + "char-set-union", + "char-set-union!", + "char-set-xor", + "char-set-xor!", + "char-set<=", + "char-set=", + "char-set?", + "char-titlecase", + "char-upcase", + "char-upper-case?", + "char-whitespace?", + "char<=?", + "char=?", + "char>?", + "char?", + "chdir", + "chmod", + "chown", + "chroot", + "circular-list", + "circular-list?", + "close", + "close-fdes", + "close-input-port", + "close-output-port", + "close-port", + "closedir", + "command-line", + "complex?", + "compose", + "concatenate", + "concatenate!", + "cond-expand-provide", + "connect", + "cons", + "cons*", + "cons-source", + "const", + "convert-assignment", + "copy-file", + "copy-random-state", + "copy-tree", + "cos", + "cosh", + "count", + "crypt", + "ctermid", + "current-dynamic-state", + "current-error-port", + "current-input-port", + "current-language", + "current-load-port", + "current-module", + "current-output-port", + "current-time", + "current-warning-port", + "datum->random-state", + "datum->syntax", + "debug-disable", + "debug-enable", + "debug-options", + "debug-options-interface", + "default-duplicate-binding-handler", + "default-duplicate-binding-procedures", + "default-prompt-tag", + "define!", + "define-module*", + "defined?", + "delete", + "delete!", + "delete-duplicates", + "delete-duplicates!", + "delete-file", + "delete1!", + "delq", + "delq!", + "delq1!", + "delv", + "delv!", + "delv1!", + "denominator", + "directory-stream?", + "dirname", + "display", + "display-application", + "display-backtrace", + "display-error", + "dotted-list?", + "doubly-weak-hash-table?", + "drain-input", + "drop", + "drop-right", + "drop-right!", + "drop-while", + "dup", + "dup->fdes", + "dup->inport", + "dup->outport", + "dup->port", + "dup2", + "duplicate-port", + "dynamic-call", + "dynamic-func", + "dynamic-link", + "dynamic-object?", + "dynamic-pointer", + "dynamic-state?", + "dynamic-unlink", + "dynamic-wind", + "effective-version", + "eighth", + "end-of-char-set?", + "endgrent", + "endhostent", + "endnetent", + "endprotoent", + "endpwent", + "endservent", + "ensure-batch-mode!", + "environ", + "eof-object?", + "eq?", + "equal?", + "eqv?", + "error", + "euclidean-quotient", + "euclidean-remainder", + "euclidean/", + "eval", + "eval-string", + "even?", + "every", + "exact->inexact", + "exact-integer-sqrt", + "exact-integer?", + "exact?", + "exception-accessor", + "exception-args", + "exception-kind", + "exception-predicate", + "exception-type?", + "exception?", + "execl", + "execle", + "execlp", + "exit", + "exp", + "expt", + "f32vector", + "f32vector->list", + "f32vector-length", + "f32vector-ref", + "f32vector-set!", + "f32vector?", + "f64vector", + "f64vector->list", + "f64vector-length", + "f64vector-ref", + "f64vector-set!", + "f64vector?", + "fcntl", + "fdes->inport", + "fdes->outport", + "fdes->ports", + "fdopen", + "fifth", + "file-encoding", + "file-exists?", + "file-is-directory?", + "file-name-separator?", + "file-port?", + "file-position", + "file-set-position", + "fileno", + "filter", + "filter!", + "filter-map", + "find", + "find-tail", + "finite?", + "first", + "flock", + "floor", + "floor-quotient", + "floor-remainder", + "floor/", + "fluid->parameter", + "fluid-bound?", + "fluid-ref", + "fluid-ref*", + "fluid-set!", + "fluid-thread-local?", + "fluid-unset!", + "fluid?", + "flush-all-ports", + "fold", + "fold-right", + "for-each", + "force", + "force-output", + "format", + "fourth", + "frame-address", + "frame-arguments", + "frame-dynamic-link", + "frame-instruction-pointer", + "frame-previous", + "frame-procedure-name", + "frame-return-address", + "frame-source", + "frame-stack-pointer", + "frame?", + "free-identifier=?", + "fsync", + "ftell", + "gai-strerror", + "gc", + "gc-disable", + "gc-dump", + "gc-enable", + "gc-run-time", + "gc-stats", + "gcd", + "generate-temporaries", + "gensym", + "get-internal-real-time", + "get-internal-run-time", + "get-output-string", + "get-print-state", + "getaddrinfo", + "getaffinity", + "getcwd", + "getegid", + "getenv", + "geteuid", + "getgid", + "getgr", + "getgrent", + "getgrgid", + "getgrnam", + "getgroups", + "gethost", + "gethostbyaddr", + "gethostbyname", + "gethostent", + "gethostname", + "getitimer", + "getlogin", + "getnet", + "getnetbyaddr", + "getnetbyname", + "getnetent", + "getpass", + "getpeername", + "getpgrp", + "getpid", + "getppid", + "getpriority", + "getproto", + "getprotobyname", + "getprotobynumber", + "getprotoent", + "getpw", + "getpwent", + "getpwnam", + "getpwuid", + "getrlimit", + "getserv", + "getservbyname", + "getservbyport", + "getservent", + "getsid", + "getsockname", + "getsockopt", + "gettext", + "gettimeofday", + "getuid", + "gmtime", + "group:gid", + "group:mem", + "group:name", + "group:passwd", + "hash", + "hash-clear!", + "hash-count", + "hash-create-handle!", + "hash-fold", + "hash-for-each", + "hash-for-each-handle", + "hash-get-handle", + "hash-map->list", + "hash-ref", + "hash-remove!", + "hash-set!", + "hash-table?", + "hashq", + "hashq-create-handle!", + "hashq-get-handle", + "hashq-ref", + "hashq-remove!", + "hashq-set!", + "hashv", + "hashv-create-handle!", + "hashv-get-handle", + "hashv-ref", + "hashv-remove!", + "hashv-set!", + "hashx-create-handle!", + "hashx-get-handle", + "hashx-ref", + "hashx-remove!", + "hashx-set!", + "hook->list", + "hook-empty?", + "hook?", + "hostent:addr-list", + "hostent:addrtype", + "hostent:aliases", + "hostent:length", + "hostent:name", + "identifier?", + "identity", + "imag-part", + "in-vicinity", + "include-deprecated-features", + "inet-lnaof", + "inet-makeaddr", + "inet-netof", + "inet-ntop", + "inet-pton", + "inexact->exact", + "inexact?", + "inf", + "inf?", + "inherit-print-state", + "input-port?", + "install-r6rs!", + "install-r7rs!", + "integer->char", + "integer-expt", + "integer-length", + "integer?", + "interaction-environment", + "iota", + "isatty?", + "issue-deprecation-warning", + "keyword->symbol", + "keyword-like-symbol->keyword", + "keyword?", + "kill", + "kw-arg-ref", + "last", + "last-pair", + "lcm", + "length", + "length+", + "link", + "list", + "list->array", + "list->bitvector", + "list->char-set", + "list->char-set!", + "list->f32vector", + "list->f64vector", + "list->s16vector", + "list->s32vector", + "list->s64vector", + "list->s8vector", + "list->string", + "list->symbol", + "list->typed-array", + "list->u16vector", + "list->u32vector", + "list->u64vector", + "list->u8vector", + "list->vector", + "list-cdr-ref", + "list-cdr-set!", + "list-copy", + "list-head", + "list-index", + "list-ref", + "list-set!", + "list-tabulate", + "list-tail", + "list=", + "list?", + "listen", + "load-compiled", + "load-extension", + "load-from-path", + "load-in-vicinity", + "load-user-init", + "local-define", + "local-define-module", + "local-ref", + "local-ref-module", + "local-remove", + "local-set!", + "localtime", + "log", + "log10", + "logand", + "logbit?", + "logcount", + "logior", + "lognot", + "logtest", + "logxor", + "lookup-duplicates-handlers", + "lset-adjoin", + "lset-diff+intersection", + "lset-diff+intersection!", + "lset-difference", + "lset-difference!", + "lset-intersection", + "lset-intersection!", + "lset-union", + "lset-union!", + "lset-xor", + "lset-xor!", + "lset<=", + "lset=", + "lstat", + "macro-binding", + "macro-name", + "macro-transformer", + "macro-type", + "macro?", + "macroexpand", + "macroexpanded?", + "magnitude", + "major-version", + "make-array", + "make-autoload-interface", + "make-bitvector", + "make-doubly-weak-hash-table", + "make-exception", + "make-exception-from-throw", + "make-exception-type", + "make-f32vector", + "make-f64vector", + "make-fluid", + "make-fresh-user-module", + "make-generalized-vector", + "make-guardian", + "make-hash-table", + "make-hook", + "make-list", + "make-module", + "make-modules-in", + "make-mutable-parameter", + "make-object-property", + "make-parameter", + "make-polar", + "make-procedure-with-setter", + "make-promise", + "make-prompt-tag", + "make-record-type", + "make-rectangular", + "make-regexp", + "make-s16vector", + "make-s32vector", + "make-s64vector", + "make-s8vector", + "make-shared-array", + "make-socket-address", + "make-soft-port", + "make-srfi-4-vector", + "make-stack", + "make-string", + "make-struct-layout", + "make-struct/no-tail", + "make-struct/simple", + "make-symbol", + "make-syntax-transformer", + "make-thread-local-fluid", + "make-typed-array", + "make-u16vector", + "make-u32vector", + "make-u64vector", + "make-u8vector", + "make-unbound-fluid", + "make-undefined-variable", + "make-variable", + "make-variable-transformer", + "make-vector", + "make-vtable", + "make-weak-key-hash-table", + "make-weak-value-hash-table", + "map", + "map!", + "map-in-order", + "max", + "member", + "memoize-expression", + "memoized-typecode", + "memq", + "memv", + "merge", + "merge!", + "micro-version", + "min", + "minor-version", + "mkdir", + "mkdtemp", + "mknod", + "mkstemp", + "mkstemp!", + "mktime", + "module-add!", + "module-autoload!", + "module-binder", + "module-bound?", + "module-call-observers", + "module-clear!", + "module-constructor", + "module-declarative?", + "module-defer-observers", + "module-define!", + "module-define-submodule!", + "module-defined?", + "module-duplicates-handlers", + "module-ensure-local-variable!", + "module-export!", + "module-export-all!", + "module-filename", + "module-for-each", + "module-generate-unique-id!", + "module-gensym", + "module-import-interface", + "module-import-obarray", + "module-kind", + "module-local-variable", + "module-locally-bound?", + "module-make-local-var!", + "module-map", + "module-modified", + "module-name", + "module-next-unique-id", + "module-obarray", + "module-obarray-get-handle", + "module-obarray-ref", + "module-obarray-remove!", + "module-obarray-set!", + "module-observe", + "module-observe-weak", + "module-observers", + "module-public-interface", + "module-re-export!", + "module-ref", + "module-ref-submodule", + "module-remove!", + "module-replace!", + "module-replacements", + "module-reverse-lookup", + "module-search", + "module-set!", + "module-submodule-binder", + "module-submodules", + "module-symbol-binding", + "module-symbol-interned?", + "module-symbol-local-binding", + "module-symbol-locally-interned?", + "module-transformer", + "module-unobserve", + "module-use!", + "module-use-interfaces!", + "module-uses", + "module-variable", + "module-version", + "module-weak-observers", + "module?", + "modulo", + "modulo-expt", + "move->fdes", + "nan", + "nan?", + "negate", + "negative?", + "nested-define!", + "nested-define-module!", + "nested-ref", + "nested-ref-module", + "nested-remove!", + "nested-set!", + "netent:addrtype", + "netent:aliases", + "netent:name", + "netent:net", + "newline", + "ngettext", + "nice", + "nil?", + "ninth", + "noop", + "not", + "not-pair?", + "null-environment", + "null-list?", + "null?", + "number->string", + "number?", + "numerator", + "object->string", + "object-address", + "object-properties", + "object-property", + "odd?", + "open", + "open-fdes", + "open-file", + "open-input-file", + "open-input-string", + "open-io-file", + "open-output-file", + "open-output-string", + "opendir", + "or-map", + "output-port?", + "pair-fold", + "pair-fold-right", + "pair-for-each", + "pair?", + "parameter-converter", + "parameter-fluid", + "parameter?", + "parse-path", + "parse-path-with-ellipsis", + "partition", + "partition!", + "passwd:dir", + "passwd:gecos", + "passwd:gid", + "passwd:name", + "passwd:passwd", + "passwd:shell", + "passwd:uid", + "pause", + "peek", + "peek-char", + "pipe", + "pk", + "port->fdes", + "port-closed?", + "port-column", + "port-conversion-strategy", + "port-encoding", + "port-filename", + "port-for-each", + "port-line", + "port-mode", + "port-revealed", + "port-with-print-state", + "port?", + "positive?", + "primitive-_exit", + "primitive-eval", + "primitive-exit", + "primitive-fork", + "primitive-load", + "primitive-load-path", + "primitive-move->fdes", + "primitive-read", + "print-disable", + "print-enable", + "print-exception", + "print-options", + "print-options-interface", + "procedure", + "procedure-documentation", + "procedure-minimum-arity", + "procedure-name", + "procedure-properties", + "procedure-property", + "procedure-source", + "procedure-with-setter?", + "procedure?", + "process-use-modules", + "program-arguments", + "promise?", + "proper-list?", + "protoent:aliases", + "protoent:name", + "protoent:proto", + "provide", + "provided?", + "purify-module!", + "putenv", + "quit", + "quotient", + "raise", + "raise-exception", + "random", + "random-state->datum", + "random-state-from-platform", + "random:exp", + "random:hollow-sphere!", + "random:normal", + "random:normal-vector!", + "random:solid-sphere!", + "random:uniform", + "rational?", + "rationalize", + "read", + "read-char", + "read-disable", + "read-enable", + "read-hash-extend", + "read-hash-procedure", + "read-hash-procedures", + "read-options", + "read-options-interface", + "read-syntax", + "readdir", + "readlink", + "real-part", + "real?", + "record-accessor", + "record-constructor", + "record-modifier", + "record-predicate", + "record-type-constructor", + "record-type-descriptor", + "record-type-extensible?", + "record-type-fields", + "record-type-has-parent?", + "record-type-mutable-fields", + "record-type-name", + "record-type-opaque?", + "record-type-parent", + "record-type-parents", + "record-type-properties", + "record-type-uid", + "record-type?", + "record?", + "recv!", + "recvfrom!", + "redirect-port", + "reduce", + "reduce-right", + "regexp-exec", + "regexp?", + "release-port-handle", + "reload-module", + "remainder", + "remove", + "remove!", + "remove-hook!", + "rename-file", + "repl-reader", + "reset-hook!", + "resolve-interface", + "resolve-module", + "resolve-r6rs-interface", + "restore-signals", + "restricted-vector-sort!", + "reverse", + "reverse!", + "reverse-list->string", + "rewinddir", + "rmdir", + "round", + "round-ash", + "round-quotient", + "round-remainder", + "round/", + "run-hook", + "s16vector", + "s16vector->list", + "s16vector-length", + "s16vector-ref", + "s16vector-set!", + "s16vector?", + "s32vector", + "s32vector->list", + "s32vector-length", + "s32vector-ref", + "s32vector-set!", + "s32vector?", + "s64vector", + "s64vector->list", + "s64vector-length", + "s64vector-ref", + "s64vector-set!", + "s64vector?", + "s8vector", + "s8vector->list", + "s8vector-length", + "s8vector-ref", + "s8vector-set!", + "s8vector?", + "save-module-excursion", + "scheme-report-environment", + "scm-error", + "search-path", + "second", + "seed->random-state", + "seek", + "select", + "self-evaluating?", + "send", + "sendfile", + "sendto", + "servent:aliases", + "servent:name", + "servent:port", + "servent:proto", + "set-autoloaded!", + "set-car!", + "set-cdr!", + "set-current-dynamic-state", + "set-current-error-port", + "set-current-input-port", + "set-current-module", + "set-current-output-port", + "set-exception-printer!", + "set-module-binder!", + "set-module-declarative?!", + "set-module-duplicates-handlers!", + "set-module-filename!", + "set-module-kind!", + "set-module-name!", + "set-module-next-unique-id!", + "set-module-obarray!", + "set-module-observers!", + "set-module-public-interface!", + "set-module-submodule-binder!", + "set-module-submodules!", + "set-module-transformer!", + "set-module-uses!", + "set-module-version!", + "set-object-properties!", + "set-object-property!", + "set-port-column!", + "set-port-conversion-strategy!", + "set-port-encoding!", + "set-port-filename!", + "set-port-line!", + "set-port-revealed!", + "set-procedure-minimum-arity!", + "set-procedure-properties!", + "set-procedure-property!", + "set-program-arguments", + "set-source-properties!", + "set-source-property!", + "set-struct-vtable-name!", + "set-symbol-property!", + "set-tm:gmtoff", + "set-tm:hour", + "set-tm:isdst", + "set-tm:mday", + "set-tm:min", + "set-tm:mon", + "set-tm:sec", + "set-tm:wday", + "set-tm:yday", + "set-tm:year", + "set-tm:zone", + "setaffinity", + "setegid", + "setenv", + "seteuid", + "setgid", + "setgr", + "setgrent", + "setgroups", + "sethost", + "sethostent", + "sethostname", + "setitimer", + "setlocale", + "setnet", + "setnetent", + "setpgid", + "setpriority", + "setproto", + "setprotoent", + "setpw", + "setpwent", + "setrlimit", + "setserv", + "setservent", + "setsid", + "setsockopt", + "setter", + "setuid", + "setvbuf", + "seventh", + "shared-array-increments", + "shared-array-offset", + "shared-array-root", + "shutdown", + "sigaction", + "simple-exceptions", + "simple-format", + "sin", + "sinh", + "sixth", + "sleep", + "sloppy-assoc", + "sloppy-assq", + "sloppy-assv", + "sockaddr:addr", + "sockaddr:fam", + "sockaddr:flowinfo", + "sockaddr:path", + "sockaddr:port", + "sockaddr:scopeid", + "socket", + "socketpair", + "sort", + "sort!", + "sort-list", + "sort-list!", + "sorted?", + "source-properties", + "source-property", + "span", + "span!", + "split-at", + "split-at!", + "sqrt", + "stable-sort", + "stable-sort!", + "stack-id", + "stack-length", + "stack-ref", + "stack?", + "stat", + "stat:atime", + "stat:atimensec", + "stat:blksize", + "stat:blocks", + "stat:ctime", + "stat:ctimensec", + "stat:dev", + "stat:gid", + "stat:ino", + "stat:mode", + "stat:mtime", + "stat:mtimensec", + "stat:nlink", + "stat:perms", + "stat:rdev", + "stat:size", + "stat:type", + "stat:uid", + "status:exit-val", + "status:stop-sig", + "status:term-sig", + "strerror", + "strftime", + "string", + "string->char-set", + "string->char-set!", + "string->list", + "string->number", + "string->symbol", + "string-any", + "string-any-c-code", + "string-append", + "string-append/shared", + "string-bytes-per-char", + "string-capitalize", + "string-capitalize!", + "string-ci->symbol", + "string-ci<", + "string-ci<=", + "string-ci<=?", + "string-ci<>", + "string-ci", + "string-ci>=", + "string-ci>=?", + "string-ci>?", + "string-compare", + "string-compare-ci", + "string-concatenate", + "string-concatenate-reverse", + "string-concatenate-reverse/shared", + "string-concatenate/shared", + "string-contains", + "string-contains-ci", + "string-copy", + "string-copy!", + "string-count", + "string-delete", + "string-downcase", + "string-downcase!", + "string-drop", + "string-drop-right", + "string-every", + "string-every-c-code", + "string-fill!", + "string-filter", + "string-fold", + "string-fold-right", + "string-for-each", + "string-for-each-index", + "string-hash", + "string-hash-ci", + "string-index", + "string-index-right", + "string-join", + "string-length", + "string-map", + "string-map!", + "string-normalize-nfc", + "string-normalize-nfd", + "string-normalize-nfkc", + "string-normalize-nfkd", + "string-null?", + "string-pad", + "string-pad-right", + "string-prefix-ci?", + "string-prefix-length", + "string-prefix-length-ci", + "string-prefix?", + "string-ref", + "string-replace", + "string-reverse", + "string-reverse!", + "string-rindex", + "string-set!", + "string-skip", + "string-skip-right", + "string-split", + "string-suffix-ci?", + "string-suffix-length", + "string-suffix-length-ci", + "string-suffix?", + "string-tabulate", + "string-take", + "string-take-right", + "string-titlecase", + "string-titlecase!", + "string-tokenize", + "string-trim", + "string-trim-both", + "string-trim-right", + "string-unfold", + "string-unfold-right", + "string-upcase", + "string-upcase!", + "string-utf8-length", + "string-xcopy!", + "string<", + "string<=", + "string<=?", + "string<>", + "string", + "string>=", + "string>=?", + "string>?", + "string?", + "strptime", + "struct-layout", + "struct-ref", + "struct-ref/unboxed", + "struct-set!", + "struct-set!/unboxed", + "struct-vtable", + "struct-vtable-name", + "struct-vtable?", + "struct?", + "substring", + "substring-fill!", + "substring-move!", + "substring/copy", + "substring/read-only", + "substring/shared", + "supports-source-properties?", + "symbol", + "symbol->keyword", + "symbol->string", + "symbol-append", + "symbol-fref", + "symbol-fset!", + "symbol-hash", + "symbol-interned?", + "symbol-pref", + "symbol-prefix-proc", + "symbol-property", + "symbol-property-remove!", + "symbol-pset!", + "symbol?", + "symlink", + "sync", + "syntax->datum", + "syntax-source", + "syntax-violation", + "system", + "system*", + "system-async-mark", + "system-error-errno", + "system-file-name-convention", + "take", + "take!", + "take-right", + "take-while", + "take-while!", + "tan", + "tanh", + "tcgetpgrp", + "tcsetpgrp", + "tenth", + "textdomain", + "third", + "throw", + "thunk?", + "times", + "tm:gmtoff", + "tm:hour", + "tm:isdst", + "tm:mday", + "tm:min", + "tm:mon", + "tm:sec", + "tm:wday", + "tm:yday", + "tm:year", + "tm:zone", + "tmpfile", + "tmpnam", + "tms:clock", + "tms:cstime", + "tms:cutime", + "tms:stime", + "tms:utime", + "transpose-array", + "truncate", + "truncate-file", + "truncate-quotient", + "truncate-remainder", + "truncate/", + "try-load-module", + "try-module-autoload", + "ttyname", + "typed-array?", + "tzset", + "u16vector", + "u16vector->list", + "u16vector-length", + "u16vector-ref", + "u16vector-set!", + "u16vector?", + "u32vector", + "u32vector->list", + "u32vector-length", + "u32vector-ref", + "u32vector-set!", + "u32vector?", + "u64vector", + "u64vector->list", + "u64vector-length", + "u64vector-ref", + "u64vector-set!", + "u64vector?", + "u8vector", + "u8vector->list", + "u8vector-length", + "u8vector-ref", + "u8vector-set!", + "u8vector?", + "ucs-range->char-set", + "ucs-range->char-set!", + "umask", + "uname", + "unfold", + "unfold-right", + "unmemoize-expression", + "unread-char", + "unread-string", + "unsetenv", + "unspecified?", + "unzip1", + "unzip2", + "unzip3", + "unzip4", + "unzip5", + "use-srfis", + "user-modules-declarative?", + "using-readline?", + "usleep", + "utime", + "utsname:machine", + "utsname:nodename", + "utsname:release", + "utsname:sysname", + "utsname:version", + "values", + "variable-bound?", + "variable-ref", + "variable-set!", + "variable-unset!", + "variable?", + "vector", + "vector->list", + "vector-copy", + "vector-fill!", + "vector-length", + "vector-move-left!", + "vector-move-right!", + "vector-ref", + "vector-set!", + "vector?", + "version", + "version-matches?", + "waitpid", + "warn", + "weak-key-hash-table?", + "weak-value-hash-table?", + "with-continuation-barrier", + "with-dynamic-state", + "with-error-to-file", + "with-error-to-port", + "with-error-to-string", + "with-exception-handler", + "with-fluid*", + "with-fluids*", + "with-input-from-file", + "with-input-from-port", + "with-input-from-string", + "with-output-to-file", + "with-output-to-port", + "with-output-to-string", + "with-throw-handler", + "write", + "write-char", + "xcons", + "xsubstring", + "zero?", + "zip", +} + diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/_scilab_builtins.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/_scilab_builtins.py new file mode 100644 index 0000000000000000000000000000000000000000..af49b46a8e3f66d2c87b9f39fd86d1cf4fa1b8b8 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/_scilab_builtins.py @@ -0,0 +1,3093 @@ +""" + pygments.lexers._scilab_builtins + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Builtin list for the ScilabLexer. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +# Autogenerated + +commands_kw = ( + 'abort', + 'apropos', + 'break', + 'case', + 'catch', + 'continue', + 'do', + 'else', + 'elseif', + 'end', + 'endfunction', + 'for', + 'function', + 'help', + 'if', + 'pause', + 'quit', + 'select', + 'then', + 'try', + 'while', +) + +functions_kw = ( + '!!_invoke_', + '%H5Object_e', + '%H5Object_fieldnames', + '%H5Object_p', + '%XMLAttr_6', + '%XMLAttr_e', + '%XMLAttr_i_XMLElem', + '%XMLAttr_length', + '%XMLAttr_p', + '%XMLAttr_size', + '%XMLDoc_6', + '%XMLDoc_e', + '%XMLDoc_i_XMLList', + '%XMLDoc_p', + '%XMLElem_6', + '%XMLElem_e', + '%XMLElem_i_XMLDoc', + '%XMLElem_i_XMLElem', + '%XMLElem_i_XMLList', + '%XMLElem_p', + '%XMLList_6', + '%XMLList_e', + '%XMLList_i_XMLElem', + '%XMLList_i_XMLList', + '%XMLList_length', + '%XMLList_p', + '%XMLList_size', + '%XMLNs_6', + '%XMLNs_e', + '%XMLNs_i_XMLElem', + '%XMLNs_p', + '%XMLSet_6', + '%XMLSet_e', + '%XMLSet_length', + '%XMLSet_p', + '%XMLSet_size', + '%XMLValid_p', + '%_EClass_6', + '%_EClass_e', + '%_EClass_p', + '%_EObj_0', + '%_EObj_1__EObj', + '%_EObj_1_b', + '%_EObj_1_c', + '%_EObj_1_i', + '%_EObj_1_s', + '%_EObj_2__EObj', + '%_EObj_2_b', + '%_EObj_2_c', + '%_EObj_2_i', + '%_EObj_2_s', + '%_EObj_3__EObj', + '%_EObj_3_b', + '%_EObj_3_c', + '%_EObj_3_i', + '%_EObj_3_s', + '%_EObj_4__EObj', + '%_EObj_4_b', + '%_EObj_4_c', + '%_EObj_4_i', + '%_EObj_4_s', + '%_EObj_5', + '%_EObj_6', + '%_EObj_a__EObj', + '%_EObj_a_b', + '%_EObj_a_c', + '%_EObj_a_i', + '%_EObj_a_s', + '%_EObj_d__EObj', + '%_EObj_d_b', + '%_EObj_d_c', + '%_EObj_d_i', + '%_EObj_d_s', + '%_EObj_disp', + '%_EObj_e', + '%_EObj_g__EObj', + '%_EObj_g_b', + '%_EObj_g_c', + '%_EObj_g_i', + '%_EObj_g_s', + '%_EObj_h__EObj', + '%_EObj_h_b', + '%_EObj_h_c', + '%_EObj_h_i', + '%_EObj_h_s', + '%_EObj_i__EObj', + '%_EObj_j__EObj', + '%_EObj_j_b', + '%_EObj_j_c', + '%_EObj_j_i', + '%_EObj_j_s', + '%_EObj_k__EObj', + '%_EObj_k_b', + '%_EObj_k_c', + '%_EObj_k_i', + '%_EObj_k_s', + '%_EObj_l__EObj', + '%_EObj_l_b', + '%_EObj_l_c', + '%_EObj_l_i', + '%_EObj_l_s', + '%_EObj_m__EObj', + '%_EObj_m_b', + '%_EObj_m_c', + '%_EObj_m_i', + '%_EObj_m_s', + '%_EObj_n__EObj', + '%_EObj_n_b', + '%_EObj_n_c', + '%_EObj_n_i', + '%_EObj_n_s', + '%_EObj_o__EObj', + '%_EObj_o_b', + '%_EObj_o_c', + '%_EObj_o_i', + '%_EObj_o_s', + '%_EObj_p', + '%_EObj_p__EObj', + '%_EObj_p_b', + '%_EObj_p_c', + '%_EObj_p_i', + '%_EObj_p_s', + '%_EObj_q__EObj', + '%_EObj_q_b', + '%_EObj_q_c', + '%_EObj_q_i', + '%_EObj_q_s', + '%_EObj_r__EObj', + '%_EObj_r_b', + '%_EObj_r_c', + '%_EObj_r_i', + '%_EObj_r_s', + '%_EObj_s__EObj', + '%_EObj_s_b', + '%_EObj_s_c', + '%_EObj_s_i', + '%_EObj_s_s', + '%_EObj_t', + '%_EObj_x__EObj', + '%_EObj_x_b', + '%_EObj_x_c', + '%_EObj_x_i', + '%_EObj_x_s', + '%_EObj_y__EObj', + '%_EObj_y_b', + '%_EObj_y_c', + '%_EObj_y_i', + '%_EObj_y_s', + '%_EObj_z__EObj', + '%_EObj_z_b', + '%_EObj_z_c', + '%_EObj_z_i', + '%_EObj_z_s', + '%_eigs', + '%_load', + '%b_1__EObj', + '%b_2__EObj', + '%b_3__EObj', + '%b_4__EObj', + '%b_a__EObj', + '%b_d__EObj', + '%b_g__EObj', + '%b_h__EObj', + '%b_i_XMLList', + '%b_i__EObj', + '%b_j__EObj', + '%b_k__EObj', + '%b_l__EObj', + '%b_m__EObj', + '%b_n__EObj', + '%b_o__EObj', + '%b_p__EObj', + '%b_q__EObj', + '%b_r__EObj', + '%b_s__EObj', + '%b_x__EObj', + '%b_y__EObj', + '%b_z__EObj', + '%c_1__EObj', + '%c_2__EObj', + '%c_3__EObj', + '%c_4__EObj', + '%c_a__EObj', + '%c_d__EObj', + '%c_g__EObj', + '%c_h__EObj', + '%c_i_XMLAttr', + '%c_i_XMLDoc', + '%c_i_XMLElem', + '%c_i_XMLList', + '%c_i__EObj', + '%c_j__EObj', + '%c_k__EObj', + '%c_l__EObj', + '%c_m__EObj', + '%c_n__EObj', + '%c_o__EObj', + '%c_p__EObj', + '%c_q__EObj', + '%c_r__EObj', + '%c_s__EObj', + '%c_x__EObj', + '%c_y__EObj', + '%c_z__EObj', + '%ce_i_XMLList', + '%fptr_i_XMLList', + '%h_i_XMLList', + '%hm_i_XMLList', + '%i_1__EObj', + '%i_2__EObj', + '%i_3__EObj', + '%i_4__EObj', + '%i_a__EObj', + '%i_abs', + '%i_cumprod', + '%i_cumsum', + '%i_d__EObj', + '%i_diag', + '%i_g__EObj', + '%i_h__EObj', + '%i_i_XMLList', + '%i_i__EObj', + '%i_j__EObj', + '%i_k__EObj', + '%i_l__EObj', + '%i_m__EObj', + '%i_matrix', + '%i_max', + '%i_maxi', + '%i_min', + '%i_mini', + '%i_mput', + '%i_n__EObj', + '%i_o__EObj', + '%i_p', + '%i_p__EObj', + '%i_prod', + '%i_q__EObj', + '%i_r__EObj', + '%i_s__EObj', + '%i_sum', + '%i_tril', + '%i_triu', + '%i_x__EObj', + '%i_y__EObj', + '%i_z__EObj', + '%ip_i_XMLList', + '%l_i_XMLList', + '%l_i__EObj', + '%lss_i_XMLList', + '%mc_i_XMLList', + '%msp_full', + '%msp_i_XMLList', + '%msp_spget', + '%p_i_XMLList', + '%ptr_i_XMLList', + '%r_i_XMLList', + '%s_1__EObj', + '%s_2__EObj', + '%s_3__EObj', + '%s_4__EObj', + '%s_a__EObj', + '%s_d__EObj', + '%s_g__EObj', + '%s_h__EObj', + '%s_i_XMLList', + '%s_i__EObj', + '%s_j__EObj', + '%s_k__EObj', + '%s_l__EObj', + '%s_m__EObj', + '%s_n__EObj', + '%s_o__EObj', + '%s_p__EObj', + '%s_q__EObj', + '%s_r__EObj', + '%s_s__EObj', + '%s_x__EObj', + '%s_y__EObj', + '%s_z__EObj', + '%sp_i_XMLList', + '%spb_i_XMLList', + '%st_i_XMLList', + 'Calendar', + 'ClipBoard', + 'Matplot', + 'Matplot1', + 'PlaySound', + 'TCL_DeleteInterp', + 'TCL_DoOneEvent', + 'TCL_EvalFile', + 'TCL_EvalStr', + 'TCL_ExistArray', + 'TCL_ExistInterp', + 'TCL_ExistVar', + 'TCL_GetVar', + 'TCL_GetVersion', + 'TCL_SetVar', + 'TCL_UnsetVar', + 'TCL_UpVar', + '_', + '_code2str', + '_d', + '_str2code', + 'about', + 'abs', + 'acos', + 'addModulePreferences', + 'addcolor', + 'addf', + 'addhistory', + 'addinter', + 'addlocalizationdomain', + 'amell', + 'and', + 'argn', + 'arl2_ius', + 'ascii', + 'asin', + 'atan', + 'backslash', + 'balanc', + 'banner', + 'base2dec', + 'basename', + 'bdiag', + 'beep', + 'besselh', + 'besseli', + 'besselj', + 'besselk', + 'bessely', + 'beta', + 'bezout', + 'bfinit', + 'blkfc1i', + 'blkslvi', + 'bool2s', + 'browsehistory', + 'browsevar', + 'bsplin3val', + 'buildDoc', + 'buildouttb', + 'bvode', + 'c_link', + 'call', + 'callblk', + 'captions', + 'cd', + 'cdfbet', + 'cdfbin', + 'cdfchi', + 'cdfchn', + 'cdff', + 'cdffnc', + 'cdfgam', + 'cdfnbn', + 'cdfnor', + 'cdfpoi', + 'cdft', + 'ceil', + 'champ', + 'champ1', + 'chdir', + 'chol', + 'clc', + 'clean', + 'clear', + 'clearfun', + 'clearglobal', + 'closeEditor', + 'closeEditvar', + 'closeXcos', + 'code2str', + 'coeff', + 'color', + 'comp', + 'completion', + 'conj', + 'contour2di', + 'contr', + 'conv2', + 'convstr', + 'copy', + 'copyfile', + 'corr', + 'cos', + 'coserror', + 'createdir', + 'cshep2d', + 'csvDefault', + 'csvIsnum', + 'csvRead', + 'csvStringToDouble', + 'csvTextScan', + 'csvWrite', + 'ctree2', + 'ctree3', + 'ctree4', + 'cumprod', + 'cumsum', + 'curblock', + 'curblockc', + 'daskr', + 'dasrt', + 'dassl', + 'data2sig', + 'datatipCreate', + 'datatipManagerMode', + 'datatipMove', + 'datatipRemove', + 'datatipSetDisplay', + 'datatipSetInterp', + 'datatipSetOrientation', + 'datatipSetStyle', + 'datatipToggle', + 'dawson', + 'dct', + 'debug', + 'dec2base', + 'deff', + 'definedfields', + 'degree', + 'delbpt', + 'delete', + 'deletefile', + 'delip', + 'delmenu', + 'det', + 'dgettext', + 'dhinf', + 'diag', + 'diary', + 'diffobjs', + 'disp', + 'dispbpt', + 'displayhistory', + 'disposefftwlibrary', + 'dlgamma', + 'dnaupd', + 'dneupd', + 'double', + 'drawaxis', + 'drawlater', + 'drawnow', + 'driver', + 'dsaupd', + 'dsearch', + 'dseupd', + 'dst', + 'duplicate', + 'editvar', + 'emptystr', + 'end_scicosim', + 'ereduc', + 'erf', + 'erfc', + 'erfcx', + 'erfi', + 'errcatch', + 'errclear', + 'error', + 'eval_cshep2d', + 'exec', + 'execstr', + 'exists', + 'exit', + 'exp', + 'expm', + 'exportUI', + 'export_to_hdf5', + 'eye', + 'fadj2sp', + 'fec', + 'feval', + 'fft', + 'fftw', + 'fftw_flags', + 'fftw_forget_wisdom', + 'fftwlibraryisloaded', + 'figure', + 'file', + 'filebrowser', + 'fileext', + 'fileinfo', + 'fileparts', + 'filesep', + 'find', + 'findBD', + 'findfiles', + 'fire_closing_finished', + 'floor', + 'format', + 'fort', + 'fprintfMat', + 'freq', + 'frexp', + 'fromc', + 'fromjava', + 'fscanfMat', + 'fsolve', + 'fstair', + 'full', + 'fullpath', + 'funcprot', + 'funptr', + 'gamma', + 'gammaln', + 'geom3d', + 'get', + 'getURL', + 'get_absolute_file_path', + 'get_fftw_wisdom', + 'getblocklabel', + 'getcallbackobject', + 'getdate', + 'getdebuginfo', + 'getdefaultlanguage', + 'getdrives', + 'getdynlibext', + 'getenv', + 'getfield', + 'gethistory', + 'gethistoryfile', + 'getinstalledlookandfeels', + 'getio', + 'getlanguage', + 'getlongpathname', + 'getlookandfeel', + 'getmd5', + 'getmemory', + 'getmodules', + 'getos', + 'getpid', + 'getrelativefilename', + 'getscicosvars', + 'getscilabmode', + 'getshortpathname', + 'gettext', + 'getvariablesonstack', + 'getversion', + 'glist', + 'global', + 'glue', + 'grand', + 'graphicfunction', + 'grayplot', + 'grep', + 'gsort', + 'gstacksize', + 'h5attr', + 'h5close', + 'h5cp', + 'h5dataset', + 'h5dump', + 'h5exists', + 'h5flush', + 'h5get', + 'h5group', + 'h5isArray', + 'h5isAttr', + 'h5isCompound', + 'h5isFile', + 'h5isGroup', + 'h5isList', + 'h5isRef', + 'h5isSet', + 'h5isSpace', + 'h5isType', + 'h5isVlen', + 'h5label', + 'h5ln', + 'h5ls', + 'h5mount', + 'h5mv', + 'h5open', + 'h5read', + 'h5readattr', + 'h5rm', + 'h5umount', + 'h5write', + 'h5writeattr', + 'havewindow', + 'helpbrowser', + 'hess', + 'hinf', + 'historymanager', + 'historysize', + 'host', + 'htmlDump', + 'htmlRead', + 'htmlReadStr', + 'htmlWrite', + 'iconvert', + 'ieee', + 'ilib_verbose', + 'imag', + 'impl', + 'import_from_hdf5', + 'imult', + 'inpnvi', + 'int', + 'int16', + 'int2d', + 'int32', + 'int3d', + 'int8', + 'interp', + 'interp2d', + 'interp3d', + 'intg', + 'intppty', + 'inttype', + 'inv', + 'invoke_lu', + 'is_handle_valid', + 'is_hdf5_file', + 'isalphanum', + 'isascii', + 'isdef', + 'isdigit', + 'isdir', + 'isequal', + 'isequalbitwise', + 'iserror', + 'isfile', + 'isglobal', + 'isletter', + 'isnum', + 'isreal', + 'iswaitingforinput', + 'jallowClassReloading', + 'jarray', + 'jautoTranspose', + 'jautoUnwrap', + 'javaclasspath', + 'javalibrarypath', + 'jcast', + 'jcompile', + 'jconvMatrixMethod', + 'jcreatejar', + 'jdeff', + 'jdisableTrace', + 'jenableTrace', + 'jexists', + 'jgetclassname', + 'jgetfield', + 'jgetfields', + 'jgetinfo', + 'jgetmethods', + 'jimport', + 'jinvoke', + 'jinvoke_db', + 'jnewInstance', + 'jremove', + 'jsetfield', + 'junwrap', + 'junwraprem', + 'jwrap', + 'jwrapinfloat', + 'kron', + 'lasterror', + 'ldiv', + 'ldivf', + 'legendre', + 'length', + 'lib', + 'librarieslist', + 'libraryinfo', + 'light', + 'linear_interpn', + 'lines', + 'link', + 'linmeq', + 'list', + 'listvar_in_hdf5', + 'load', + 'loadGui', + 'loadScicos', + 'loadXcos', + 'loadfftwlibrary', + 'loadhistory', + 'log', + 'log1p', + 'lsq', + 'lsq_splin', + 'lsqrsolve', + 'lsslist', + 'lstcat', + 'lstsize', + 'ltitr', + 'lu', + 'ludel', + 'lufact', + 'luget', + 'lusolve', + 'macr2lst', + 'macr2tree', + 'matfile_close', + 'matfile_listvar', + 'matfile_open', + 'matfile_varreadnext', + 'matfile_varwrite', + 'matrix', + 'max', + 'maxfiles', + 'mclearerr', + 'mclose', + 'meof', + 'merror', + 'messagebox', + 'mfprintf', + 'mfscanf', + 'mget', + 'mgeti', + 'mgetl', + 'mgetstr', + 'min', + 'mlist', + 'mode', + 'model2blk', + 'mopen', + 'move', + 'movefile', + 'mprintf', + 'mput', + 'mputl', + 'mputstr', + 'mscanf', + 'mseek', + 'msprintf', + 'msscanf', + 'mtell', + 'mtlb_mode', + 'mtlb_sparse', + 'mucomp', + 'mulf', + 'name2rgb', + 'nearfloat', + 'newaxes', + 'newest', + 'newfun', + 'nnz', + 'norm', + 'notify', + 'number_properties', + 'ode', + 'odedc', + 'ones', + 'openged', + 'opentk', + 'optim', + 'or', + 'ordmmd', + 'parallel_concurrency', + 'parallel_run', + 'param3d', + 'param3d1', + 'part', + 'pathconvert', + 'pathsep', + 'phase_simulation', + 'plot2d', + 'plot2d1', + 'plot2d2', + 'plot2d3', + 'plot2d4', + 'plot3d', + 'plot3d1', + 'plotbrowser', + 'pointer_xproperty', + 'poly', + 'ppol', + 'pppdiv', + 'predef', + 'preferences', + 'print', + 'printf', + 'printfigure', + 'printsetupbox', + 'prod', + 'progressionbar', + 'prompt', + 'pwd', + 'qld', + 'qp_solve', + 'qr', + 'raise_window', + 'rand', + 'rankqr', + 'rat', + 'rcond', + 'rdivf', + 'read', + 'read4b', + 'read_csv', + 'readb', + 'readgateway', + 'readmps', + 'real', + 'realtime', + 'realtimeinit', + 'regexp', + 'relocate_handle', + 'remez', + 'removeModulePreferences', + 'removedir', + 'removelinehistory', + 'res_with_prec', + 'resethistory', + 'residu', + 'resume', + 'return', + 'ricc', + 'rlist', + 'roots', + 'rotate_axes', + 'round', + 'rpem', + 'rtitr', + 'rubberbox', + 'save', + 'saveGui', + 'saveafterncommands', + 'saveconsecutivecommands', + 'savehistory', + 'schur', + 'sci_haltscicos', + 'sci_tree2', + 'sci_tree3', + 'sci_tree4', + 'sciargs', + 'scicos_debug', + 'scicos_debug_count', + 'scicos_time', + 'scicosim', + 'scinotes', + 'sctree', + 'semidef', + 'set', + 'set_blockerror', + 'set_fftw_wisdom', + 'set_xproperty', + 'setbpt', + 'setdefaultlanguage', + 'setenv', + 'setfield', + 'sethistoryfile', + 'setlanguage', + 'setlookandfeel', + 'setmenu', + 'sfact', + 'sfinit', + 'show_window', + 'sident', + 'sig2data', + 'sign', + 'simp', + 'simp_mode', + 'sin', + 'size', + 'slash', + 'sleep', + 'sorder', + 'sparse', + 'spchol', + 'spcompack', + 'spec', + 'spget', + 'splin', + 'splin2d', + 'splin3d', + 'splitURL', + 'spones', + 'sprintf', + 'sqrt', + 'stacksize', + 'str2code', + 'strcat', + 'strchr', + 'strcmp', + 'strcspn', + 'strindex', + 'string', + 'stringbox', + 'stripblanks', + 'strncpy', + 'strrchr', + 'strrev', + 'strsplit', + 'strspn', + 'strstr', + 'strsubst', + 'strtod', + 'strtok', + 'subf', + 'sum', + 'svd', + 'swap_handles', + 'symfcti', + 'syredi', + 'system_getproperty', + 'system_setproperty', + 'ta2lpd', + 'tan', + 'taucs_chdel', + 'taucs_chfact', + 'taucs_chget', + 'taucs_chinfo', + 'taucs_chsolve', + 'tempname', + 'testmatrix', + 'timer', + 'tlist', + 'tohome', + 'tokens', + 'toolbar', + 'toprint', + 'tr_zer', + 'tril', + 'triu', + 'type', + 'typename', + 'uiDisplayTree', + 'uicontextmenu', + 'uicontrol', + 'uigetcolor', + 'uigetdir', + 'uigetfile', + 'uigetfont', + 'uimenu', + 'uint16', + 'uint32', + 'uint8', + 'uipopup', + 'uiputfile', + 'uiwait', + 'ulink', + 'umf_ludel', + 'umf_lufact', + 'umf_luget', + 'umf_luinfo', + 'umf_lusolve', + 'umfpack', + 'unglue', + 'unix', + 'unsetmenu', + 'unzoom', + 'updatebrowsevar', + 'usecanvas', + 'useeditor', + 'user', + 'var2vec', + 'varn', + 'vec2var', + 'waitbar', + 'warnBlockByUID', + 'warning', + 'what', + 'where', + 'whereis', + 'who', + 'winsid', + 'with_module', + 'writb', + 'write', + 'write4b', + 'write_csv', + 'x_choose', + 'x_choose_modeless', + 'x_dialog', + 'x_mdialog', + 'xarc', + 'xarcs', + 'xarrows', + 'xchange', + 'xchoicesi', + 'xclick', + 'xcos', + 'xcosAddToolsMenu', + 'xcosConfigureXmlFile', + 'xcosDiagramToScilab', + 'xcosPalCategoryAdd', + 'xcosPalDelete', + 'xcosPalDisable', + 'xcosPalEnable', + 'xcosPalGenerateIcon', + 'xcosPalGet', + 'xcosPalLoad', + 'xcosPalMove', + 'xcosSimulationStarted', + 'xcosUpdateBlock', + 'xdel', + 'xend', + 'xfarc', + 'xfarcs', + 'xfpoly', + 'xfpolys', + 'xfrect', + 'xget', + 'xgetmouse', + 'xgraduate', + 'xgrid', + 'xinit', + 'xlfont', + 'xls_open', + 'xls_read', + 'xmlAddNs', + 'xmlAppend', + 'xmlAsNumber', + 'xmlAsText', + 'xmlDTD', + 'xmlDelete', + 'xmlDocument', + 'xmlDump', + 'xmlElement', + 'xmlFormat', + 'xmlGetNsByHref', + 'xmlGetNsByPrefix', + 'xmlGetOpenDocs', + 'xmlIsValidObject', + 'xmlName', + 'xmlNs', + 'xmlRead', + 'xmlReadStr', + 'xmlRelaxNG', + 'xmlRemove', + 'xmlSchema', + 'xmlSetAttributes', + 'xmlValidate', + 'xmlWrite', + 'xmlXPath', + 'xname', + 'xpause', + 'xpoly', + 'xpolys', + 'xrect', + 'xrects', + 'xs2bmp', + 'xs2emf', + 'xs2eps', + 'xs2gif', + 'xs2jpg', + 'xs2pdf', + 'xs2png', + 'xs2ppm', + 'xs2ps', + 'xs2svg', + 'xsegs', + 'xset', + 'xstring', + 'xstringb', + 'xtitle', + 'zeros', + 'znaupd', + 'zneupd', + 'zoom_rect', +) + +macros_kw = ( + '!_deff_wrapper', + '%0_i_st', + '%3d_i_h', + '%Block_xcosUpdateBlock', + '%TNELDER_p', + '%TNELDER_string', + '%TNMPLOT_p', + '%TNMPLOT_string', + '%TOPTIM_p', + '%TOPTIM_string', + '%TSIMPLEX_p', + '%TSIMPLEX_string', + '%_EVoid_p', + '%_gsort', + '%_listvarinfile', + '%_rlist', + '%_save', + '%_sodload', + '%_strsplit', + '%_unwrap', + '%ar_p', + '%asn', + '%b_a_b', + '%b_a_s', + '%b_c_s', + '%b_c_spb', + '%b_cumprod', + '%b_cumsum', + '%b_d_s', + '%b_diag', + '%b_e', + '%b_f_s', + '%b_f_spb', + '%b_g_s', + '%b_g_spb', + '%b_grand', + '%b_h_s', + '%b_h_spb', + '%b_i_b', + '%b_i_ce', + '%b_i_h', + '%b_i_hm', + '%b_i_s', + '%b_i_sp', + '%b_i_spb', + '%b_i_st', + '%b_iconvert', + '%b_l_b', + '%b_l_s', + '%b_m_b', + '%b_m_s', + '%b_matrix', + '%b_n_hm', + '%b_o_hm', + '%b_p_s', + '%b_prod', + '%b_r_b', + '%b_r_s', + '%b_s_b', + '%b_s_s', + '%b_string', + '%b_sum', + '%b_tril', + '%b_triu', + '%b_x_b', + '%b_x_s', + '%bicg', + '%bicgstab', + '%c_a_c', + '%c_b_c', + '%c_b_s', + '%c_diag', + '%c_dsearch', + '%c_e', + '%c_eye', + '%c_f_s', + '%c_grand', + '%c_i_c', + '%c_i_ce', + '%c_i_h', + '%c_i_hm', + '%c_i_lss', + '%c_i_r', + '%c_i_s', + '%c_i_st', + '%c_matrix', + '%c_n_l', + '%c_n_st', + '%c_o_l', + '%c_o_st', + '%c_ones', + '%c_rand', + '%c_tril', + '%c_triu', + '%cblock_c_cblock', + '%cblock_c_s', + '%cblock_e', + '%cblock_f_cblock', + '%cblock_p', + '%cblock_size', + '%ce_6', + '%ce_c_ce', + '%ce_e', + '%ce_f_ce', + '%ce_i_ce', + '%ce_i_s', + '%ce_i_st', + '%ce_matrix', + '%ce_p', + '%ce_size', + '%ce_string', + '%ce_t', + '%cgs', + '%champdat_i_h', + '%choose', + '%diagram_xcos', + '%dir_p', + '%fptr_i_st', + '%grand_perm', + '%grayplot_i_h', + '%h_i_st', + '%hmS_k_hmS_generic', + '%hm_1_hm', + '%hm_1_s', + '%hm_2_hm', + '%hm_2_s', + '%hm_3_hm', + '%hm_3_s', + '%hm_4_hm', + '%hm_4_s', + '%hm_5', + '%hm_a_hm', + '%hm_a_r', + '%hm_a_s', + '%hm_abs', + '%hm_and', + '%hm_bool2s', + '%hm_c_hm', + '%hm_ceil', + '%hm_conj', + '%hm_cos', + '%hm_cumprod', + '%hm_cumsum', + '%hm_d_hm', + '%hm_d_s', + '%hm_degree', + '%hm_dsearch', + '%hm_e', + '%hm_exp', + '%hm_eye', + '%hm_f_hm', + '%hm_find', + '%hm_floor', + '%hm_g_hm', + '%hm_grand', + '%hm_gsort', + '%hm_h_hm', + '%hm_i_b', + '%hm_i_ce', + '%hm_i_h', + '%hm_i_hm', + '%hm_i_i', + '%hm_i_p', + '%hm_i_r', + '%hm_i_s', + '%hm_i_st', + '%hm_iconvert', + '%hm_imag', + '%hm_int', + '%hm_isnan', + '%hm_isreal', + '%hm_j_hm', + '%hm_j_s', + '%hm_k_hm', + '%hm_k_s', + '%hm_log', + '%hm_m_p', + '%hm_m_r', + '%hm_m_s', + '%hm_matrix', + '%hm_max', + '%hm_mean', + '%hm_median', + '%hm_min', + '%hm_n_b', + '%hm_n_c', + '%hm_n_hm', + '%hm_n_i', + '%hm_n_p', + '%hm_n_s', + '%hm_o_b', + '%hm_o_c', + '%hm_o_hm', + '%hm_o_i', + '%hm_o_p', + '%hm_o_s', + '%hm_ones', + '%hm_or', + '%hm_p', + '%hm_prod', + '%hm_q_hm', + '%hm_r_s', + '%hm_rand', + '%hm_real', + '%hm_round', + '%hm_s', + '%hm_s_hm', + '%hm_s_r', + '%hm_s_s', + '%hm_sign', + '%hm_sin', + '%hm_size', + '%hm_sqrt', + '%hm_stdev', + '%hm_string', + '%hm_sum', + '%hm_x_hm', + '%hm_x_p', + '%hm_x_s', + '%hm_zeros', + '%i_1_s', + '%i_2_s', + '%i_3_s', + '%i_4_s', + '%i_Matplot', + '%i_a_i', + '%i_a_s', + '%i_and', + '%i_ascii', + '%i_b_s', + '%i_bezout', + '%i_champ', + '%i_champ1', + '%i_contour', + '%i_contour2d', + '%i_d_i', + '%i_d_s', + '%i_dsearch', + '%i_e', + '%i_fft', + '%i_g_i', + '%i_gcd', + '%i_grand', + '%i_h_i', + '%i_i_ce', + '%i_i_h', + '%i_i_hm', + '%i_i_i', + '%i_i_s', + '%i_i_st', + '%i_j_i', + '%i_j_s', + '%i_l_s', + '%i_lcm', + '%i_length', + '%i_m_i', + '%i_m_s', + '%i_mfprintf', + '%i_mprintf', + '%i_msprintf', + '%i_n_s', + '%i_o_s', + '%i_or', + '%i_p_i', + '%i_p_s', + '%i_plot2d', + '%i_plot2d1', + '%i_plot2d2', + '%i_q_s', + '%i_r_i', + '%i_r_s', + '%i_round', + '%i_s_i', + '%i_s_s', + '%i_sign', + '%i_string', + '%i_x_i', + '%i_x_s', + '%ip_a_s', + '%ip_i_st', + '%ip_m_s', + '%ip_n_ip', + '%ip_o_ip', + '%ip_p', + '%ip_part', + '%ip_s_s', + '%ip_string', + '%k', + '%l_i_h', + '%l_i_s', + '%l_i_st', + '%l_isequal', + '%l_n_c', + '%l_n_l', + '%l_n_m', + '%l_n_p', + '%l_n_s', + '%l_n_st', + '%l_o_c', + '%l_o_l', + '%l_o_m', + '%l_o_p', + '%l_o_s', + '%l_o_st', + '%lss_a_lss', + '%lss_a_p', + '%lss_a_r', + '%lss_a_s', + '%lss_c_lss', + '%lss_c_p', + '%lss_c_r', + '%lss_c_s', + '%lss_e', + '%lss_eye', + '%lss_f_lss', + '%lss_f_p', + '%lss_f_r', + '%lss_f_s', + '%lss_i_ce', + '%lss_i_lss', + '%lss_i_p', + '%lss_i_r', + '%lss_i_s', + '%lss_i_st', + '%lss_inv', + '%lss_l_lss', + '%lss_l_p', + '%lss_l_r', + '%lss_l_s', + '%lss_m_lss', + '%lss_m_p', + '%lss_m_r', + '%lss_m_s', + '%lss_n_lss', + '%lss_n_p', + '%lss_n_r', + '%lss_n_s', + '%lss_norm', + '%lss_o_lss', + '%lss_o_p', + '%lss_o_r', + '%lss_o_s', + '%lss_ones', + '%lss_r_lss', + '%lss_r_p', + '%lss_r_r', + '%lss_r_s', + '%lss_rand', + '%lss_s', + '%lss_s_lss', + '%lss_s_p', + '%lss_s_r', + '%lss_s_s', + '%lss_size', + '%lss_t', + '%lss_v_lss', + '%lss_v_p', + '%lss_v_r', + '%lss_v_s', + '%lt_i_s', + '%m_n_l', + '%m_o_l', + '%mc_i_h', + '%mc_i_s', + '%mc_i_st', + '%mc_n_st', + '%mc_o_st', + '%mc_string', + '%mps_p', + '%mps_string', + '%msp_a_s', + '%msp_abs', + '%msp_e', + '%msp_find', + '%msp_i_s', + '%msp_i_st', + '%msp_length', + '%msp_m_s', + '%msp_maxi', + '%msp_n_msp', + '%msp_nnz', + '%msp_o_msp', + '%msp_p', + '%msp_sparse', + '%msp_spones', + '%msp_t', + '%p_a_lss', + '%p_a_r', + '%p_c_lss', + '%p_c_r', + '%p_cumprod', + '%p_cumsum', + '%p_d_p', + '%p_d_r', + '%p_d_s', + '%p_det', + '%p_e', + '%p_f_lss', + '%p_f_r', + '%p_grand', + '%p_i_ce', + '%p_i_h', + '%p_i_hm', + '%p_i_lss', + '%p_i_p', + '%p_i_r', + '%p_i_s', + '%p_i_st', + '%p_inv', + '%p_j_s', + '%p_k_p', + '%p_k_r', + '%p_k_s', + '%p_l_lss', + '%p_l_p', + '%p_l_r', + '%p_l_s', + '%p_m_hm', + '%p_m_lss', + '%p_m_r', + '%p_matrix', + '%p_n_l', + '%p_n_lss', + '%p_n_r', + '%p_o_l', + '%p_o_lss', + '%p_o_r', + '%p_o_sp', + '%p_p_s', + '%p_part', + '%p_prod', + '%p_q_p', + '%p_q_r', + '%p_q_s', + '%p_r_lss', + '%p_r_p', + '%p_r_r', + '%p_r_s', + '%p_s_lss', + '%p_s_r', + '%p_simp', + '%p_string', + '%p_sum', + '%p_v_lss', + '%p_v_p', + '%p_v_r', + '%p_v_s', + '%p_x_hm', + '%p_x_r', + '%p_y_p', + '%p_y_r', + '%p_y_s', + '%p_z_p', + '%p_z_r', + '%p_z_s', + '%pcg', + '%plist_p', + '%plist_string', + '%r_0', + '%r_a_hm', + '%r_a_lss', + '%r_a_p', + '%r_a_r', + '%r_a_s', + '%r_c_lss', + '%r_c_p', + '%r_c_r', + '%r_c_s', + '%r_clean', + '%r_cumprod', + '%r_cumsum', + '%r_d_p', + '%r_d_r', + '%r_d_s', + '%r_det', + '%r_diag', + '%r_e', + '%r_eye', + '%r_f_lss', + '%r_f_p', + '%r_f_r', + '%r_f_s', + '%r_i_ce', + '%r_i_hm', + '%r_i_lss', + '%r_i_p', + '%r_i_r', + '%r_i_s', + '%r_i_st', + '%r_inv', + '%r_j_s', + '%r_k_p', + '%r_k_r', + '%r_k_s', + '%r_l_lss', + '%r_l_p', + '%r_l_r', + '%r_l_s', + '%r_m_hm', + '%r_m_lss', + '%r_m_p', + '%r_m_r', + '%r_m_s', + '%r_matrix', + '%r_n_lss', + '%r_n_p', + '%r_n_r', + '%r_n_s', + '%r_norm', + '%r_o_lss', + '%r_o_p', + '%r_o_r', + '%r_o_s', + '%r_ones', + '%r_p', + '%r_p_s', + '%r_prod', + '%r_q_p', + '%r_q_r', + '%r_q_s', + '%r_r_lss', + '%r_r_p', + '%r_r_r', + '%r_r_s', + '%r_rand', + '%r_s', + '%r_s_hm', + '%r_s_lss', + '%r_s_p', + '%r_s_r', + '%r_s_s', + '%r_simp', + '%r_size', + '%r_string', + '%r_sum', + '%r_t', + '%r_tril', + '%r_triu', + '%r_v_lss', + '%r_v_p', + '%r_v_r', + '%r_v_s', + '%r_varn', + '%r_x_p', + '%r_x_r', + '%r_x_s', + '%r_y_p', + '%r_y_r', + '%r_y_s', + '%r_z_p', + '%r_z_r', + '%r_z_s', + '%s_1_hm', + '%s_1_i', + '%s_2_hm', + '%s_2_i', + '%s_3_hm', + '%s_3_i', + '%s_4_hm', + '%s_4_i', + '%s_5', + '%s_a_b', + '%s_a_hm', + '%s_a_i', + '%s_a_ip', + '%s_a_lss', + '%s_a_msp', + '%s_a_r', + '%s_a_sp', + '%s_and', + '%s_b_i', + '%s_b_s', + '%s_bezout', + '%s_c_b', + '%s_c_cblock', + '%s_c_lss', + '%s_c_r', + '%s_c_sp', + '%s_d_b', + '%s_d_i', + '%s_d_p', + '%s_d_r', + '%s_d_sp', + '%s_e', + '%s_f_b', + '%s_f_cblock', + '%s_f_lss', + '%s_f_r', + '%s_f_sp', + '%s_g_b', + '%s_g_s', + '%s_gcd', + '%s_grand', + '%s_h_b', + '%s_h_s', + '%s_i_b', + '%s_i_c', + '%s_i_ce', + '%s_i_h', + '%s_i_hm', + '%s_i_i', + '%s_i_lss', + '%s_i_p', + '%s_i_r', + '%s_i_s', + '%s_i_sp', + '%s_i_spb', + '%s_i_st', + '%s_j_i', + '%s_k_hm', + '%s_k_p', + '%s_k_r', + '%s_k_sp', + '%s_l_b', + '%s_l_hm', + '%s_l_i', + '%s_l_lss', + '%s_l_p', + '%s_l_r', + '%s_l_s', + '%s_l_sp', + '%s_lcm', + '%s_m_b', + '%s_m_hm', + '%s_m_i', + '%s_m_ip', + '%s_m_lss', + '%s_m_msp', + '%s_m_r', + '%s_matrix', + '%s_n_hm', + '%s_n_i', + '%s_n_l', + '%s_n_lss', + '%s_n_r', + '%s_n_st', + '%s_o_hm', + '%s_o_i', + '%s_o_l', + '%s_o_lss', + '%s_o_r', + '%s_o_st', + '%s_or', + '%s_p_b', + '%s_p_i', + '%s_pow', + '%s_q_hm', + '%s_q_i', + '%s_q_p', + '%s_q_r', + '%s_q_sp', + '%s_r_b', + '%s_r_i', + '%s_r_lss', + '%s_r_p', + '%s_r_r', + '%s_r_s', + '%s_r_sp', + '%s_s_b', + '%s_s_hm', + '%s_s_i', + '%s_s_ip', + '%s_s_lss', + '%s_s_r', + '%s_s_sp', + '%s_simp', + '%s_v_lss', + '%s_v_p', + '%s_v_r', + '%s_v_s', + '%s_x_b', + '%s_x_hm', + '%s_x_i', + '%s_x_r', + '%s_y_p', + '%s_y_r', + '%s_y_sp', + '%s_z_p', + '%s_z_r', + '%s_z_sp', + '%sn', + '%sp_a_s', + '%sp_a_sp', + '%sp_and', + '%sp_c_s', + '%sp_ceil', + '%sp_conj', + '%sp_cos', + '%sp_cumprod', + '%sp_cumsum', + '%sp_d_s', + '%sp_d_sp', + '%sp_det', + '%sp_diag', + '%sp_e', + '%sp_exp', + '%sp_f_s', + '%sp_floor', + '%sp_grand', + '%sp_gsort', + '%sp_i_ce', + '%sp_i_h', + '%sp_i_s', + '%sp_i_sp', + '%sp_i_st', + '%sp_int', + '%sp_inv', + '%sp_k_s', + '%sp_k_sp', + '%sp_l_s', + '%sp_l_sp', + '%sp_length', + '%sp_max', + '%sp_min', + '%sp_norm', + '%sp_or', + '%sp_p_s', + '%sp_prod', + '%sp_q_s', + '%sp_q_sp', + '%sp_r_s', + '%sp_r_sp', + '%sp_round', + '%sp_s_s', + '%sp_s_sp', + '%sp_sin', + '%sp_sqrt', + '%sp_string', + '%sp_sum', + '%sp_tril', + '%sp_triu', + '%sp_y_s', + '%sp_y_sp', + '%sp_z_s', + '%sp_z_sp', + '%spb_and', + '%spb_c_b', + '%spb_cumprod', + '%spb_cumsum', + '%spb_diag', + '%spb_e', + '%spb_f_b', + '%spb_g_b', + '%spb_g_spb', + '%spb_h_b', + '%spb_h_spb', + '%spb_i_b', + '%spb_i_ce', + '%spb_i_h', + '%spb_i_st', + '%spb_or', + '%spb_prod', + '%spb_sum', + '%spb_tril', + '%spb_triu', + '%st_6', + '%st_c_st', + '%st_e', + '%st_f_st', + '%st_i_b', + '%st_i_c', + '%st_i_fptr', + '%st_i_h', + '%st_i_i', + '%st_i_ip', + '%st_i_lss', + '%st_i_msp', + '%st_i_p', + '%st_i_r', + '%st_i_s', + '%st_i_sp', + '%st_i_spb', + '%st_i_st', + '%st_matrix', + '%st_n_c', + '%st_n_l', + '%st_n_mc', + '%st_n_p', + '%st_n_s', + '%st_o_c', + '%st_o_l', + '%st_o_mc', + '%st_o_p', + '%st_o_s', + '%st_o_tl', + '%st_p', + '%st_size', + '%st_string', + '%st_t', + '%ticks_i_h', + '%xls_e', + '%xls_p', + '%xlssheet_e', + '%xlssheet_p', + '%xlssheet_size', + '%xlssheet_string', + 'DominationRank', + 'G_make', + 'IsAScalar', + 'NDcost', + 'OS_Version', + 'PlotSparse', + 'ReadHBSparse', + 'TCL_CreateSlave', + 'abcd', + 'abinv', + 'accept_func_default', + 'accept_func_vfsa', + 'acf', + 'acosd', + 'acosh', + 'acoshm', + 'acosm', + 'acot', + 'acotd', + 'acoth', + 'acsc', + 'acscd', + 'acsch', + 'add_demo', + 'add_help_chapter', + 'add_module_help_chapter', + 'add_param', + 'add_profiling', + 'adj2sp', + 'aff2ab', + 'ana_style', + 'analpf', + 'analyze', + 'aplat', + 'arhnk', + 'arl2', + 'arma2p', + 'arma2ss', + 'armac', + 'armax', + 'armax1', + 'arobasestring2strings', + 'arsimul', + 'ascii2string', + 'asciimat', + 'asec', + 'asecd', + 'asech', + 'asind', + 'asinh', + 'asinhm', + 'asinm', + 'assert_checkalmostequal', + 'assert_checkequal', + 'assert_checkerror', + 'assert_checkfalse', + 'assert_checkfilesequal', + 'assert_checktrue', + 'assert_comparecomplex', + 'assert_computedigits', + 'assert_cond2reltol', + 'assert_cond2reqdigits', + 'assert_generror', + 'atand', + 'atanh', + 'atanhm', + 'atanm', + 'atomsAutoload', + 'atomsAutoloadAdd', + 'atomsAutoloadDel', + 'atomsAutoloadList', + 'atomsCategoryList', + 'atomsCheckModule', + 'atomsDepTreeShow', + 'atomsGetConfig', + 'atomsGetInstalled', + 'atomsGetInstalledPath', + 'atomsGetLoaded', + 'atomsGetLoadedPath', + 'atomsInstall', + 'atomsIsInstalled', + 'atomsIsLoaded', + 'atomsList', + 'atomsLoad', + 'atomsQuit', + 'atomsRemove', + 'atomsRepositoryAdd', + 'atomsRepositoryDel', + 'atomsRepositoryList', + 'atomsRestoreConfig', + 'atomsSaveConfig', + 'atomsSearch', + 'atomsSetConfig', + 'atomsShow', + 'atomsSystemInit', + 'atomsSystemUpdate', + 'atomsTest', + 'atomsUpdate', + 'atomsVersion', + 'augment', + 'auread', + 'auwrite', + 'balreal', + 'bench_run', + 'bilin', + 'bilt', + 'bin2dec', + 'binomial', + 'bitand', + 'bitcmp', + 'bitget', + 'bitor', + 'bitset', + 'bitxor', + 'black', + 'blanks', + 'bloc2exp', + 'bloc2ss', + 'block_parameter_error', + 'bode', + 'bode_asymp', + 'bstap', + 'buttmag', + 'bvodeS', + 'bytecode', + 'bytecodewalk', + 'cainv', + 'calendar', + 'calerf', + 'calfrq', + 'canon', + 'casc', + 'cat', + 'cat_code', + 'cb_m2sci_gui', + 'ccontrg', + 'cell', + 'cell2mat', + 'cellstr', + 'center', + 'cepstrum', + 'cfspec', + 'char', + 'chart', + 'cheb1mag', + 'cheb2mag', + 'check_gateways', + 'check_modules_xml', + 'check_versions', + 'chepol', + 'chfact', + 'chsolve', + 'classmarkov', + 'clean_help', + 'clock', + 'cls2dls', + 'cmb_lin', + 'cmndred', + 'cmoment', + 'coding_ga_binary', + 'coding_ga_identity', + 'coff', + 'coffg', + 'colcomp', + 'colcompr', + 'colinout', + 'colregul', + 'companion', + 'complex', + 'compute_initial_temp', + 'cond', + 'cond2sp', + 'condestsp', + 'configure_msifort', + 'configure_msvc', + 'conjgrad', + 'cont_frm', + 'cont_mat', + 'contrss', + 'conv', + 'convert_to_float', + 'convertindex', + 'convol', + 'convol2d', + 'copfac', + 'correl', + 'cosd', + 'cosh', + 'coshm', + 'cosm', + 'cotd', + 'cotg', + 'coth', + 'cothm', + 'cov', + 'covar', + 'createXConfiguration', + 'createfun', + 'createstruct', + 'cross', + 'crossover_ga_binary', + 'crossover_ga_default', + 'csc', + 'cscd', + 'csch', + 'csgn', + 'csim', + 'cspect', + 'ctr_gram', + 'czt', + 'dae', + 'daeoptions', + 'damp', + 'datafit', + 'date', + 'datenum', + 'datevec', + 'dbphi', + 'dcf', + 'ddp', + 'dec2bin', + 'dec2hex', + 'dec2oct', + 'del_help_chapter', + 'del_module_help_chapter', + 'demo_begin', + 'demo_choose', + 'demo_compiler', + 'demo_end', + 'demo_file_choice', + 'demo_folder_choice', + 'demo_function_choice', + 'demo_gui', + 'demo_run', + 'demo_viewCode', + 'denom', + 'derivat', + 'derivative', + 'des2ss', + 'des2tf', + 'detectmsifort64tools', + 'detectmsvc64tools', + 'determ', + 'detr', + 'detrend', + 'devtools_run_builder', + 'dhnorm', + 'diff', + 'diophant', + 'dir', + 'dirname', + 'dispfiles', + 'dllinfo', + 'dscr', + 'dsimul', + 'dt_ility', + 'dtsi', + 'edit', + 'edit_error', + 'editor', + 'eigenmarkov', + 'eigs', + 'ell1mag', + 'enlarge_shape', + 'entropy', + 'eomday', + 'epred', + 'eqfir', + 'eqiir', + 'equil', + 'equil1', + 'erfinv', + 'etime', + 'eval', + 'evans', + 'evstr', + 'example_run', + 'expression2code', + 'extract_help_examples', + 'factor', + 'factorial', + 'factors', + 'faurre', + 'ffilt', + 'fft2', + 'fftshift', + 'fieldnames', + 'filt_sinc', + 'filter', + 'findABCD', + 'findAC', + 'findBDK', + 'findR', + 'find_freq', + 'find_links', + 'find_scicos_version', + 'findm', + 'findmsifortcompiler', + 'findmsvccompiler', + 'findx0BD', + 'firstnonsingleton', + 'fix', + 'fixedpointgcd', + 'flipdim', + 'flts', + 'fminsearch', + 'formatBlackTip', + 'formatBodeMagTip', + 'formatBodePhaseTip', + 'formatGainplotTip', + 'formatHallModuleTip', + 'formatHallPhaseTip', + 'formatNicholsGainTip', + 'formatNicholsPhaseTip', + 'formatNyquistTip', + 'formatPhaseplotTip', + 'formatSgridDampingTip', + 'formatSgridFreqTip', + 'formatZgridDampingTip', + 'formatZgridFreqTip', + 'format_txt', + 'fourplan', + 'frep2tf', + 'freson', + 'frfit', + 'frmag', + 'fseek_origin', + 'fsfirlin', + 'fspec', + 'fspecg', + 'fstabst', + 'ftest', + 'ftuneq', + 'fullfile', + 'fullrf', + 'fullrfk', + 'fun2string', + 'g_margin', + 'gainplot', + 'gamitg', + 'gcare', + 'gcd', + 'gencompilationflags_unix', + 'generateBlockImage', + 'generateBlockImages', + 'generic_i_ce', + 'generic_i_h', + 'generic_i_hm', + 'generic_i_s', + 'generic_i_st', + 'genlib', + 'genmarkov', + 'geomean', + 'getDiagramVersion', + 'getModelicaPath', + 'getPreferencesValue', + 'get_file_path', + 'get_function_path', + 'get_param', + 'get_profile', + 'get_scicos_version', + 'getd', + 'getscilabkeywords', + 'getshell', + 'gettklib', + 'gfare', + 'gfrancis', + 'givens', + 'glever', + 'gmres', + 'group', + 'gschur', + 'gspec', + 'gtild', + 'h2norm', + 'h_cl', + 'h_inf', + 'h_inf_st', + 'h_norm', + 'hallchart', + 'halt', + 'hank', + 'hankelsv', + 'harmean', + 'haveacompiler', + 'head_comments', + 'help_from_sci', + 'help_skeleton', + 'hermit', + 'hex2dec', + 'hilb', + 'hilbert', + 'histc', + 'horner', + 'householder', + 'hrmt', + 'htrianr', + 'hypermat', + 'idct', + 'idst', + 'ifft', + 'ifftshift', + 'iir', + 'iirgroup', + 'iirlp', + 'iirmod', + 'ilib_build', + 'ilib_build_jar', + 'ilib_compile', + 'ilib_for_link', + 'ilib_gen_Make', + 'ilib_gen_Make_unix', + 'ilib_gen_cleaner', + 'ilib_gen_gateway', + 'ilib_gen_loader', + 'ilib_include_flag', + 'ilib_mex_build', + 'im_inv', + 'importScicosDiagram', + 'importScicosPal', + 'importXcosDiagram', + 'imrep2ss', + 'ind2sub', + 'inistate', + 'init_ga_default', + 'init_param', + 'initial_scicos_tables', + 'input', + 'instruction2code', + 'intc', + 'intdec', + 'integrate', + 'interp1', + 'interpln', + 'intersect', + 'intl', + 'intsplin', + 'inttrap', + 'inv_coeff', + 'invr', + 'invrs', + 'invsyslin', + 'iqr', + 'isLeapYear', + 'is_absolute_path', + 'is_param', + 'iscell', + 'iscellstr', + 'iscolumn', + 'isempty', + 'isfield', + 'isinf', + 'ismatrix', + 'isnan', + 'isrow', + 'isscalar', + 'issparse', + 'issquare', + 'isstruct', + 'isvector', + 'jmat', + 'justify', + 'kalm', + 'karmarkar', + 'kernel', + 'kpure', + 'krac2', + 'kroneck', + 'lattn', + 'lattp', + 'launchtest', + 'lcf', + 'lcm', + 'lcmdiag', + 'leastsq', + 'leqe', + 'leqr', + 'lev', + 'levin', + 'lex_sort', + 'lft', + 'lin', + 'lin2mu', + 'lincos', + 'lindquist', + 'linf', + 'linfn', + 'linsolve', + 'linspace', + 'list2vec', + 'list_param', + 'listfiles', + 'listfunctions', + 'listvarinfile', + 'lmisolver', + 'lmitool', + 'loadXcosLibs', + 'loadmatfile', + 'loadwave', + 'log10', + 'log2', + 'logm', + 'logspace', + 'lqe', + 'lqg', + 'lqg2stan', + 'lqg_ltr', + 'lqr', + 'ls', + 'lyap', + 'm2sci_gui', + 'm_circle', + 'macglov', + 'macrovar', + 'mad', + 'makecell', + 'manedit', + 'mapsound', + 'markp2ss', + 'matfile2sci', + 'mdelete', + 'mean', + 'meanf', + 'median', + 'members', + 'mese', + 'meshgrid', + 'mfft', + 'mfile2sci', + 'minreal', + 'minss', + 'mkdir', + 'modulo', + 'moment', + 'mrfit', + 'msd', + 'mstr2sci', + 'mtlb', + 'mtlb_0', + 'mtlb_a', + 'mtlb_all', + 'mtlb_any', + 'mtlb_axes', + 'mtlb_axis', + 'mtlb_beta', + 'mtlb_box', + 'mtlb_choices', + 'mtlb_close', + 'mtlb_colordef', + 'mtlb_cond', + 'mtlb_cov', + 'mtlb_cumprod', + 'mtlb_cumsum', + 'mtlb_dec2hex', + 'mtlb_delete', + 'mtlb_diag', + 'mtlb_diff', + 'mtlb_dir', + 'mtlb_double', + 'mtlb_e', + 'mtlb_echo', + 'mtlb_error', + 'mtlb_eval', + 'mtlb_exist', + 'mtlb_eye', + 'mtlb_false', + 'mtlb_fft', + 'mtlb_fftshift', + 'mtlb_filter', + 'mtlb_find', + 'mtlb_findstr', + 'mtlb_fliplr', + 'mtlb_fopen', + 'mtlb_format', + 'mtlb_fprintf', + 'mtlb_fread', + 'mtlb_fscanf', + 'mtlb_full', + 'mtlb_fwrite', + 'mtlb_get', + 'mtlb_grid', + 'mtlb_hold', + 'mtlb_i', + 'mtlb_ifft', + 'mtlb_image', + 'mtlb_imp', + 'mtlb_int16', + 'mtlb_int32', + 'mtlb_int8', + 'mtlb_is', + 'mtlb_isa', + 'mtlb_isfield', + 'mtlb_isletter', + 'mtlb_isspace', + 'mtlb_l', + 'mtlb_legendre', + 'mtlb_linspace', + 'mtlb_logic', + 'mtlb_logical', + 'mtlb_loglog', + 'mtlb_lower', + 'mtlb_max', + 'mtlb_mean', + 'mtlb_median', + 'mtlb_mesh', + 'mtlb_meshdom', + 'mtlb_min', + 'mtlb_more', + 'mtlb_num2str', + 'mtlb_ones', + 'mtlb_pcolor', + 'mtlb_plot', + 'mtlb_prod', + 'mtlb_qr', + 'mtlb_qz', + 'mtlb_rand', + 'mtlb_randn', + 'mtlb_rcond', + 'mtlb_realmax', + 'mtlb_realmin', + 'mtlb_s', + 'mtlb_semilogx', + 'mtlb_semilogy', + 'mtlb_setstr', + 'mtlb_size', + 'mtlb_sort', + 'mtlb_sortrows', + 'mtlb_sprintf', + 'mtlb_sscanf', + 'mtlb_std', + 'mtlb_strcmp', + 'mtlb_strcmpi', + 'mtlb_strfind', + 'mtlb_strrep', + 'mtlb_subplot', + 'mtlb_sum', + 'mtlb_t', + 'mtlb_toeplitz', + 'mtlb_tril', + 'mtlb_triu', + 'mtlb_true', + 'mtlb_type', + 'mtlb_uint16', + 'mtlb_uint32', + 'mtlb_uint8', + 'mtlb_upper', + 'mtlb_var', + 'mtlb_zeros', + 'mu2lin', + 'mutation_ga_binary', + 'mutation_ga_default', + 'mvcorrel', + 'mvvacov', + 'nancumsum', + 'nand2mean', + 'nanmax', + 'nanmean', + 'nanmeanf', + 'nanmedian', + 'nanmin', + 'nanreglin', + 'nanstdev', + 'nansum', + 'narsimul', + 'ndgrid', + 'ndims', + 'nehari', + 'neigh_func_csa', + 'neigh_func_default', + 'neigh_func_fsa', + 'neigh_func_vfsa', + 'neldermead_cget', + 'neldermead_configure', + 'neldermead_costf', + 'neldermead_defaultoutput', + 'neldermead_destroy', + 'neldermead_function', + 'neldermead_get', + 'neldermead_log', + 'neldermead_new', + 'neldermead_restart', + 'neldermead_search', + 'neldermead_updatesimp', + 'nextpow2', + 'nfreq', + 'nicholschart', + 'nlev', + 'nmplot_cget', + 'nmplot_configure', + 'nmplot_contour', + 'nmplot_destroy', + 'nmplot_function', + 'nmplot_get', + 'nmplot_historyplot', + 'nmplot_log', + 'nmplot_new', + 'nmplot_outputcmd', + 'nmplot_restart', + 'nmplot_search', + 'nmplot_simplexhistory', + 'noisegen', + 'nonreg_test_run', + 'now', + 'nthroot', + 'null', + 'num2cell', + 'numderivative', + 'numdiff', + 'numer', + 'nyquist', + 'nyquistfrequencybounds', + 'obs_gram', + 'obscont', + 'observer', + 'obsv_mat', + 'obsvss', + 'oct2dec', + 'odeoptions', + 'optim_ga', + 'optim_moga', + 'optim_nsga', + 'optim_nsga2', + 'optim_sa', + 'optimbase_cget', + 'optimbase_checkbounds', + 'optimbase_checkcostfun', + 'optimbase_checkx0', + 'optimbase_configure', + 'optimbase_destroy', + 'optimbase_function', + 'optimbase_get', + 'optimbase_hasbounds', + 'optimbase_hasconstraints', + 'optimbase_hasnlcons', + 'optimbase_histget', + 'optimbase_histset', + 'optimbase_incriter', + 'optimbase_isfeasible', + 'optimbase_isinbounds', + 'optimbase_isinnonlincons', + 'optimbase_log', + 'optimbase_logshutdown', + 'optimbase_logstartup', + 'optimbase_new', + 'optimbase_outputcmd', + 'optimbase_outstruct', + 'optimbase_proj2bnds', + 'optimbase_set', + 'optimbase_stoplog', + 'optimbase_terminate', + 'optimget', + 'optimplotfunccount', + 'optimplotfval', + 'optimplotx', + 'optimset', + 'optimsimplex_center', + 'optimsimplex_check', + 'optimsimplex_compsomefv', + 'optimsimplex_computefv', + 'optimsimplex_deltafv', + 'optimsimplex_deltafvmax', + 'optimsimplex_destroy', + 'optimsimplex_dirmat', + 'optimsimplex_fvmean', + 'optimsimplex_fvstdev', + 'optimsimplex_fvvariance', + 'optimsimplex_getall', + 'optimsimplex_getallfv', + 'optimsimplex_getallx', + 'optimsimplex_getfv', + 'optimsimplex_getn', + 'optimsimplex_getnbve', + 'optimsimplex_getve', + 'optimsimplex_getx', + 'optimsimplex_gradientfv', + 'optimsimplex_log', + 'optimsimplex_new', + 'optimsimplex_reflect', + 'optimsimplex_setall', + 'optimsimplex_setallfv', + 'optimsimplex_setallx', + 'optimsimplex_setfv', + 'optimsimplex_setn', + 'optimsimplex_setnbve', + 'optimsimplex_setve', + 'optimsimplex_setx', + 'optimsimplex_shrink', + 'optimsimplex_size', + 'optimsimplex_sort', + 'optimsimplex_xbar', + 'orth', + 'output_ga_default', + 'output_moga_default', + 'output_nsga2_default', + 'output_nsga_default', + 'p_margin', + 'pack', + 'pareto_filter', + 'parrot', + 'pbig', + 'pca', + 'pcg', + 'pdiv', + 'pen2ea', + 'pencan', + 'pencost', + 'penlaur', + 'perctl', + 'perl', + 'perms', + 'permute', + 'pertrans', + 'pfactors', + 'pfss', + 'phasemag', + 'phaseplot', + 'phc', + 'pinv', + 'playsnd', + 'plotprofile', + 'plzr', + 'pmodulo', + 'pol2des', + 'pol2str', + 'polar', + 'polfact', + 'prbs_a', + 'prettyprint', + 'primes', + 'princomp', + 'profile', + 'proj', + 'projsl', + 'projspec', + 'psmall', + 'pspect', + 'qmr', + 'qpsolve', + 'quart', + 'quaskro', + 'rafiter', + 'randpencil', + 'range', + 'rank', + 'readxls', + 'recompilefunction', + 'recons', + 'reglin', + 'regress', + 'remezb', + 'remove_param', + 'remove_profiling', + 'repfreq', + 'replace_Ix_by_Fx', + 'repmat', + 'reset_profiling', + 'resize_matrix', + 'returntoscilab', + 'rhs2code', + 'ric_desc', + 'riccati', + 'rmdir', + 'routh_t', + 'rowcomp', + 'rowcompr', + 'rowinout', + 'rowregul', + 'rowshuff', + 'rref', + 'sample', + 'samplef', + 'samwr', + 'savematfile', + 'savewave', + 'scanf', + 'sci2exp', + 'sciGUI_init', + 'sci_sparse', + 'scicos_getvalue', + 'scicos_simulate', + 'scicos_workspace_init', + 'scisptdemo', + 'scitest', + 'sdiff', + 'sec', + 'secd', + 'sech', + 'selection_ga_elitist', + 'selection_ga_random', + 'sensi', + 'setPreferencesValue', + 'set_param', + 'setdiff', + 'sgrid', + 'show_margins', + 'show_pca', + 'showprofile', + 'signm', + 'sinc', + 'sincd', + 'sind', + 'sinh', + 'sinhm', + 'sinm', + 'sm2des', + 'sm2ss', + 'smga', + 'smooth', + 'solve', + 'sound', + 'soundsec', + 'sp2adj', + 'spaninter', + 'spanplus', + 'spantwo', + 'specfact', + 'speye', + 'sprand', + 'spzeros', + 'sqroot', + 'sqrtm', + 'squarewave', + 'squeeze', + 'srfaur', + 'srkf', + 'ss2des', + 'ss2ss', + 'ss2tf', + 'sskf', + 'ssprint', + 'ssrand', + 'st_deviation', + 'st_i_generic', + 'st_ility', + 'stabil', + 'statgain', + 'stdev', + 'stdevf', + 'steadycos', + 'strange', + 'strcmpi', + 'struct', + 'sub2ind', + 'sva', + 'svplot', + 'sylm', + 'sylv', + 'sysconv', + 'sysdiag', + 'sysfact', + 'syslin', + 'syssize', + 'system', + 'systmat', + 'tabul', + 'tand', + 'tanh', + 'tanhm', + 'tanm', + 'tbx_build_blocks', + 'tbx_build_cleaner', + 'tbx_build_gateway', + 'tbx_build_gateway_clean', + 'tbx_build_gateway_loader', + 'tbx_build_help', + 'tbx_build_help_loader', + 'tbx_build_loader', + 'tbx_build_localization', + 'tbx_build_macros', + 'tbx_build_pal_loader', + 'tbx_build_src', + 'tbx_builder', + 'tbx_builder_gateway', + 'tbx_builder_gateway_lang', + 'tbx_builder_help', + 'tbx_builder_help_lang', + 'tbx_builder_macros', + 'tbx_builder_src', + 'tbx_builder_src_lang', + 'tbx_generate_pofile', + 'temp_law_csa', + 'temp_law_default', + 'temp_law_fsa', + 'temp_law_huang', + 'temp_law_vfsa', + 'test_clean', + 'test_on_columns', + 'test_run', + 'test_run_level', + 'testexamples', + 'tf2des', + 'tf2ss', + 'thrownan', + 'tic', + 'time_id', + 'toc', + 'toeplitz', + 'tokenpos', + 'toolboxes', + 'trace', + 'trans', + 'translatepaths', + 'tree2code', + 'trfmod', + 'trianfml', + 'trimmean', + 'trisolve', + 'trzeros', + 'typeof', + 'ui_observer', + 'union', + 'unique', + 'unit_test_run', + 'unix_g', + 'unix_s', + 'unix_w', + 'unix_x', + 'unobs', + 'unpack', + 'unwrap', + 'variance', + 'variancef', + 'vec2list', + 'vectorfind', + 'ver', + 'warnobsolete', + 'wavread', + 'wavwrite', + 'wcenter', + 'weekday', + 'wfir', + 'wfir_gui', + 'whereami', + 'who_user', + 'whos', + 'wiener', + 'wigner', + 'window', + 'winlist', + 'with_javasci', + 'with_macros_source', + 'with_modelica_compiler', + 'with_tk', + 'xcorr', + 'xcosBlockEval', + 'xcosBlockInterface', + 'xcosCodeGeneration', + 'xcosConfigureModelica', + 'xcosPal', + 'xcosPalAdd', + 'xcosPalAddBlock', + 'xcosPalExport', + 'xcosPalGenerateAllIcons', + 'xcosShowBlockWarning', + 'xcosValidateBlockSet', + 'xcosValidateCompareBlock', + 'xcos_compile', + 'xcos_debug_gui', + 'xcos_run', + 'xcos_simulate', + 'xcov', + 'xmltochm', + 'xmltoformat', + 'xmltohtml', + 'xmltojar', + 'xmltopdf', + 'xmltops', + 'xmltoweb', + 'yulewalk', + 'zeropen', + 'zgrid', + 'zpbutt', + 'zpch1', + 'zpch2', + 'zpell', +) + +variables_kw = ( + '$', + '%F', + '%T', + '%e', + '%eps', + '%f', + '%fftw', + '%gui', + '%i', + '%inf', + '%io', + '%modalWarning', + '%nan', + '%pi', + '%s', + '%t', + '%tk', + '%toolboxes', + '%toolboxes_dir', + '%z', + 'PWD', + 'SCI', + 'SCIHOME', + 'TMPDIR', + 'arnoldilib', + 'assertlib', + 'atomslib', + 'cacsdlib', + 'compatibility_functilib', + 'corelib', + 'data_structureslib', + 'demo_toolslib', + 'development_toolslib', + 'differential_equationlib', + 'dynamic_linklib', + 'elementary_functionslib', + 'enull', + 'evoid', + 'external_objectslib', + 'fd', + 'fileiolib', + 'functionslib', + 'genetic_algorithmslib', + 'helptoolslib', + 'home', + 'integerlib', + 'interpolationlib', + 'iolib', + 'jnull', + 'jvoid', + 'linear_algebralib', + 'm2scilib', + 'matiolib', + 'modules_managerlib', + 'neldermeadlib', + 'optimbaselib', + 'optimizationlib', + 'optimsimplexlib', + 'output_streamlib', + 'overloadinglib', + 'parameterslib', + 'polynomialslib', + 'preferenceslib', + 'randliblib', + 'scicos_autolib', + 'scicos_utilslib', + 'scinoteslib', + 'signal_processinglib', + 'simulated_annealinglib', + 'soundlib', + 'sparselib', + 'special_functionslib', + 'spreadsheetlib', + 'statisticslib', + 'stringlib', + 'tclscilib', + 'timelib', + 'umfpacklib', + 'xcoslib', +) + + +if __name__ == '__main__': # pragma: no cover + import subprocess + from pygments.util import format_lines, duplicates_removed + + mapping = {'variables': 'builtin'} + + def extract_completion(var_type): + s = subprocess.Popen(['scilab', '-nwni'], stdin=subprocess.PIPE, + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + output = s.communicate(f'''\ +fd = mopen("/dev/stderr", "wt"); +mputl(strcat(completion("", "{var_type}"), "||"), fd); +mclose(fd)\n''') + if '||' not in output[1]: + raise Exception(output[0]) + # Invalid DISPLAY causes this to be output: + text = output[1].strip() + if text.startswith('Error: unable to open display \n'): + text = text[len('Error: unable to open display \n'):] + return text.split('||') + + new_data = {} + seen = set() # only keep first type for a given word + for t in ('functions', 'commands', 'macros', 'variables'): + new_data[t] = duplicates_removed(extract_completion(t), seen) + seen.update(set(new_data[t])) + + + with open(__file__, encoding='utf-8') as f: + content = f.read() + + header = content[:content.find('# Autogenerated')] + footer = content[content.find("if __name__ == '__main__':"):] + + with open(__file__, 'w', encoding='utf-8') as f: + f.write(header) + f.write('# Autogenerated\n\n') + for k, v in sorted(new_data.items()): + f.write(format_lines(k + '_kw', v) + '\n\n') + f.write(footer) diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/_sourcemod_builtins.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/_sourcemod_builtins.py new file mode 100644 index 0000000000000000000000000000000000000000..c98478c6f9ebf32547010598a90d7dcb7565592d --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/_sourcemod_builtins.py @@ -0,0 +1,1151 @@ +""" + pygments.lexers._sourcemod_builtins + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + This file contains the names of SourceMod functions. + + Do not edit the FUNCTIONS list by hand. + + Run with `python -I` to regenerate. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +FUNCTIONS = ( + 'OnEntityCreated', + 'OnEntityDestroyed', + 'OnGetGameDescription', + 'OnLevelInit', + 'SDKHook', + 'SDKHookEx', + 'SDKUnhook', + 'SDKHooks_TakeDamage', + 'SDKHooks_DropWeapon', + 'TopMenuHandler', + 'CreateTopMenu', + 'LoadTopMenuConfig', + 'AddToTopMenu', + 'GetTopMenuInfoString', + 'GetTopMenuObjName', + 'RemoveFromTopMenu', + 'DisplayTopMenu', + 'DisplayTopMenuCategory', + 'FindTopMenuCategory', + 'SetTopMenuTitleCaching', + 'OnAdminMenuCreated', + 'OnAdminMenuReady', + 'GetAdminTopMenu', + 'AddTargetsToMenu', + 'AddTargetsToMenu2', + 'RedisplayAdminMenu', + 'TEHook', + 'AddTempEntHook', + 'RemoveTempEntHook', + 'TE_Start', + 'TE_IsValidProp', + 'TE_WriteNum', + 'TE_ReadNum', + 'TE_WriteFloat', + 'TE_ReadFloat', + 'TE_WriteVector', + 'TE_ReadVector', + 'TE_WriteAngles', + 'TE_WriteFloatArray', + 'TE_Send', + 'TE_WriteEncodedEnt', + 'TE_SendToAll', + 'TE_SendToClient', + 'CreateKeyValues', + 'KvSetString', + 'KvSetNum', + 'KvSetUInt64', + 'KvSetFloat', + 'KvSetColor', + 'KvSetVector', + 'KvGetString', + 'KvGetNum', + 'KvGetFloat', + 'KvGetColor', + 'KvGetUInt64', + 'KvGetVector', + 'KvJumpToKey', + 'KvJumpToKeySymbol', + 'KvGotoFirstSubKey', + 'KvGotoNextKey', + 'KvSavePosition', + 'KvDeleteKey', + 'KvDeleteThis', + 'KvGoBack', + 'KvRewind', + 'KvGetSectionName', + 'KvSetSectionName', + 'KvGetDataType', + 'KeyValuesToFile', + 'FileToKeyValues', + 'StringToKeyValues', + 'KvSetEscapeSequences', + 'KvNodesInStack', + 'KvCopySubkeys', + 'KvFindKeyById', + 'KvGetNameSymbol', + 'KvGetSectionSymbol', + 'TE_SetupSparks', + 'TE_SetupSmoke', + 'TE_SetupDust', + 'TE_SetupMuzzleFlash', + 'TE_SetupMetalSparks', + 'TE_SetupEnergySplash', + 'TE_SetupArmorRicochet', + 'TE_SetupGlowSprite', + 'TE_SetupExplosion', + 'TE_SetupBloodSprite', + 'TE_SetupBeamRingPoint', + 'TE_SetupBeamPoints', + 'TE_SetupBeamLaser', + 'TE_SetupBeamRing', + 'TE_SetupBeamFollow', + 'HookEvent', + 'HookEventEx', + 'UnhookEvent', + 'CreateEvent', + 'FireEvent', + 'CancelCreatedEvent', + 'GetEventBool', + 'SetEventBool', + 'GetEventInt', + 'SetEventInt', + 'GetEventFloat', + 'SetEventFloat', + 'GetEventString', + 'SetEventString', + 'GetEventName', + 'SetEventBroadcast', + 'GetUserMessageType', + 'GetUserMessageId', + 'GetUserMessageName', + 'StartMessage', + 'StartMessageEx', + 'EndMessage', + 'MsgHook', + 'MsgPostHook', + 'HookUserMessage', + 'UnhookUserMessage', + 'StartMessageAll', + 'StartMessageOne', + 'InactivateClient', + 'ReconnectClient', + 'GetMaxEntities', + 'GetEntityCount', + 'IsValidEntity', + 'IsValidEdict', + 'IsEntNetworkable', + 'CreateEdict', + 'RemoveEdict', + 'GetEdictFlags', + 'SetEdictFlags', + 'GetEdictClassname', + 'GetEntityNetClass', + 'ChangeEdictState', + 'GetEntData', + 'SetEntData', + 'GetEntDataFloat', + 'SetEntDataFloat', + 'GetEntDataEnt2', + 'SetEntDataEnt2', + 'GetEntDataVector', + 'SetEntDataVector', + 'GetEntDataString', + 'SetEntDataString', + 'FindSendPropOffs', + 'FindSendPropInfo', + 'FindDataMapOffs', + 'FindDataMapInfo', + 'GetEntSendPropOffs', + 'GetEntProp', + 'SetEntProp', + 'GetEntPropFloat', + 'SetEntPropFloat', + 'GetEntPropEnt', + 'SetEntPropEnt', + 'GetEntPropVector', + 'SetEntPropVector', + 'GetEntPropString', + 'SetEntPropString', + 'GetEntPropArraySize', + 'GetEntDataArray', + 'SetEntDataArray', + 'GetEntityAddress', + 'GetEntityClassname', + 'float', + 'FloatMul', + 'FloatDiv', + 'FloatAdd', + 'FloatSub', + 'FloatFraction', + 'RoundToZero', + 'RoundToCeil', + 'RoundToFloor', + 'RoundToNearest', + 'FloatCompare', + 'SquareRoot', + 'Pow', + 'Exponential', + 'Logarithm', + 'Sine', + 'Cosine', + 'Tangent', + 'FloatAbs', + 'ArcTangent', + 'ArcCosine', + 'ArcSine', + 'ArcTangent2', + 'RoundFloat', + 'operator%', + 'DegToRad', + 'RadToDeg', + 'GetURandomInt', + 'GetURandomFloat', + 'SetURandomSeed', + 'SetURandomSeedSimple', + 'RemovePlayerItem', + 'GivePlayerItem', + 'GetPlayerWeaponSlot', + 'IgniteEntity', + 'ExtinguishEntity', + 'TeleportEntity', + 'ForcePlayerSuicide', + 'SlapPlayer', + 'FindEntityByClassname', + 'GetClientEyeAngles', + 'CreateEntityByName', + 'DispatchSpawn', + 'DispatchKeyValue', + 'DispatchKeyValueFloat', + 'DispatchKeyValueVector', + 'GetClientAimTarget', + 'GetTeamCount', + 'GetTeamName', + 'GetTeamScore', + 'SetTeamScore', + 'GetTeamClientCount', + 'SetEntityModel', + 'GetPlayerDecalFile', + 'GetPlayerJingleFile', + 'GetServerNetStats', + 'EquipPlayerWeapon', + 'ActivateEntity', + 'SetClientInfo', + 'GivePlayerAmmo', + 'SetClientListeningFlags', + 'GetClientListeningFlags', + 'SetListenOverride', + 'GetListenOverride', + 'IsClientMuted', + 'TR_GetPointContents', + 'TR_GetPointContentsEnt', + 'TR_TraceRay', + 'TR_TraceHull', + 'TR_TraceRayFilter', + 'TR_TraceHullFilter', + 'TR_TraceRayEx', + 'TR_TraceHullEx', + 'TR_TraceRayFilterEx', + 'TR_TraceHullFilterEx', + 'TR_GetFraction', + 'TR_GetEndPosition', + 'TR_GetEntityIndex', + 'TR_DidHit', + 'TR_GetHitGroup', + 'TR_GetPlaneNormal', + 'TR_PointOutsideWorld', + 'SortIntegers', + 'SortFloats', + 'SortStrings', + 'SortFunc1D', + 'SortCustom1D', + 'SortCustom2D', + 'SortADTArray', + 'SortFuncADTArray', + 'SortADTArrayCustom', + 'CompileRegex', + 'MatchRegex', + 'GetRegexSubString', + 'SimpleRegexMatch', + 'TF2_GetPlayerClass', + 'TF2_SetPlayerClass', + 'TF2_RemoveWeaponSlot', + 'TF2_RemoveAllWeapons', + 'TF2_IsPlayerInCondition', + 'TF2_GetObjectType', + 'TF2_GetObjectMode', + 'NominateMap', + 'RemoveNominationByMap', + 'RemoveNominationByOwner', + 'GetExcludeMapList', + 'GetNominatedMapList', + 'CanMapChooserStartVote', + 'InitiateMapChooserVote', + 'HasEndOfMapVoteFinished', + 'EndOfMapVoteEnabled', + 'OnNominationRemoved', + 'OnMapVoteStarted', + 'CreateTimer', + 'KillTimer', + 'TriggerTimer', + 'GetTickedTime', + 'GetMapTimeLeft', + 'GetMapTimeLimit', + 'ExtendMapTimeLimit', + 'GetTickInterval', + 'OnMapTimeLeftChanged', + 'IsServerProcessing', + 'CreateDataTimer', + 'ByteCountToCells', + 'CreateArray', + 'ClearArray', + 'CloneArray', + 'ResizeArray', + 'GetArraySize', + 'PushArrayCell', + 'PushArrayString', + 'PushArrayArray', + 'GetArrayCell', + 'GetArrayString', + 'GetArrayArray', + 'SetArrayCell', + 'SetArrayString', + 'SetArrayArray', + 'ShiftArrayUp', + 'RemoveFromArray', + 'SwapArrayItems', + 'FindStringInArray', + 'FindValueInArray', + 'ProcessTargetString', + 'ReplyToTargetError', + 'MultiTargetFilter', + 'AddMultiTargetFilter', + 'RemoveMultiTargetFilter', + 'OnBanClient', + 'OnBanIdentity', + 'OnRemoveBan', + 'BanClient', + 'BanIdentity', + 'RemoveBan', + 'CreateTrie', + 'SetTrieValue', + 'SetTrieArray', + 'SetTrieString', + 'GetTrieValue', + 'GetTrieArray', + 'GetTrieString', + 'RemoveFromTrie', + 'ClearTrie', + 'GetTrieSize', + 'GetFunctionByName', + 'CreateGlobalForward', + 'CreateForward', + 'GetForwardFunctionCount', + 'AddToForward', + 'RemoveFromForward', + 'RemoveAllFromForward', + 'Call_StartForward', + 'Call_StartFunction', + 'Call_PushCell', + 'Call_PushCellRef', + 'Call_PushFloat', + 'Call_PushFloatRef', + 'Call_PushArray', + 'Call_PushArrayEx', + 'Call_PushString', + 'Call_PushStringEx', + 'Call_Finish', + 'Call_Cancel', + 'NativeCall', + 'CreateNative', + 'ThrowNativeError', + 'GetNativeStringLength', + 'GetNativeString', + 'SetNativeString', + 'GetNativeCell', + 'GetNativeCellRef', + 'SetNativeCellRef', + 'GetNativeArray', + 'SetNativeArray', + 'FormatNativeString', + 'RequestFrameCallback', + 'RequestFrame', + 'OnRebuildAdminCache', + 'DumpAdminCache', + 'AddCommandOverride', + 'GetCommandOverride', + 'UnsetCommandOverride', + 'CreateAdmGroup', + 'FindAdmGroup', + 'SetAdmGroupAddFlag', + 'GetAdmGroupAddFlag', + 'GetAdmGroupAddFlags', + 'SetAdmGroupImmuneFrom', + 'GetAdmGroupImmuneCount', + 'GetAdmGroupImmuneFrom', + 'AddAdmGroupCmdOverride', + 'GetAdmGroupCmdOverride', + 'RegisterAuthIdentType', + 'CreateAdmin', + 'GetAdminUsername', + 'BindAdminIdentity', + 'SetAdminFlag', + 'GetAdminFlag', + 'GetAdminFlags', + 'AdminInheritGroup', + 'GetAdminGroupCount', + 'GetAdminGroup', + 'SetAdminPassword', + 'GetAdminPassword', + 'FindAdminByIdentity', + 'RemoveAdmin', + 'FlagBitsToBitArray', + 'FlagBitArrayToBits', + 'FlagArrayToBits', + 'FlagBitsToArray', + 'FindFlagByName', + 'FindFlagByChar', + 'FindFlagChar', + 'ReadFlagString', + 'CanAdminTarget', + 'CreateAuthMethod', + 'SetAdmGroupImmunityLevel', + 'GetAdmGroupImmunityLevel', + 'SetAdminImmunityLevel', + 'GetAdminImmunityLevel', + 'FlagToBit', + 'BitToFlag', + 'ServerCommand', + 'ServerCommandEx', + 'InsertServerCommand', + 'ServerExecute', + 'ClientCommand', + 'FakeClientCommand', + 'FakeClientCommandEx', + 'PrintToServer', + 'PrintToConsole', + 'ReplyToCommand', + 'GetCmdReplySource', + 'SetCmdReplySource', + 'IsChatTrigger', + 'ShowActivity2', + 'ShowActivity', + 'ShowActivityEx', + 'FormatActivitySource', + 'SrvCmd', + 'RegServerCmd', + 'ConCmd', + 'RegConsoleCmd', + 'RegAdminCmd', + 'GetCmdArgs', + 'GetCmdArg', + 'GetCmdArgString', + 'CreateConVar', + 'FindConVar', + 'ConVarChanged', + 'HookConVarChange', + 'UnhookConVarChange', + 'GetConVarBool', + 'SetConVarBool', + 'GetConVarInt', + 'SetConVarInt', + 'GetConVarFloat', + 'SetConVarFloat', + 'GetConVarString', + 'SetConVarString', + 'ResetConVar', + 'GetConVarDefault', + 'GetConVarFlags', + 'SetConVarFlags', + 'GetConVarBounds', + 'SetConVarBounds', + 'GetConVarName', + 'QueryClientConVar', + 'GetCommandIterator', + 'ReadCommandIterator', + 'CheckCommandAccess', + 'CheckAccess', + 'IsValidConVarChar', + 'GetCommandFlags', + 'SetCommandFlags', + 'FindFirstConCommand', + 'FindNextConCommand', + 'SendConVarValue', + 'AddServerTag', + 'RemoveServerTag', + 'CommandListener', + 'AddCommandListener', + 'RemoveCommandListener', + 'CommandExists', + 'OnClientSayCommand', + 'OnClientSayCommand_Post', + 'TF2_IgnitePlayer', + 'TF2_RespawnPlayer', + 'TF2_RegeneratePlayer', + 'TF2_AddCondition', + 'TF2_RemoveCondition', + 'TF2_SetPlayerPowerPlay', + 'TF2_DisguisePlayer', + 'TF2_RemovePlayerDisguise', + 'TF2_StunPlayer', + 'TF2_MakeBleed', + 'TF2_GetClass', + 'TF2_CalcIsAttackCritical', + 'TF2_OnIsHolidayActive', + 'TF2_IsHolidayActive', + 'TF2_IsPlayerInDuel', + 'TF2_RemoveWearable', + 'TF2_OnConditionAdded', + 'TF2_OnConditionRemoved', + 'TF2_OnWaitingForPlayersStart', + 'TF2_OnWaitingForPlayersEnd', + 'TF2_OnPlayerTeleport', + 'SQL_Connect', + 'SQL_DefConnect', + 'SQL_ConnectCustom', + 'SQLite_UseDatabase', + 'SQL_CheckConfig', + 'SQL_GetDriver', + 'SQL_ReadDriver', + 'SQL_GetDriverIdent', + 'SQL_GetDriverProduct', + 'SQL_SetCharset', + 'SQL_GetAffectedRows', + 'SQL_GetInsertId', + 'SQL_GetError', + 'SQL_EscapeString', + 'SQL_QuoteString', + 'SQL_FastQuery', + 'SQL_Query', + 'SQL_PrepareQuery', + 'SQL_FetchMoreResults', + 'SQL_HasResultSet', + 'SQL_GetRowCount', + 'SQL_GetFieldCount', + 'SQL_FieldNumToName', + 'SQL_FieldNameToNum', + 'SQL_FetchRow', + 'SQL_MoreRows', + 'SQL_Rewind', + 'SQL_FetchString', + 'SQL_FetchFloat', + 'SQL_FetchInt', + 'SQL_IsFieldNull', + 'SQL_FetchSize', + 'SQL_BindParamInt', + 'SQL_BindParamFloat', + 'SQL_BindParamString', + 'SQL_Execute', + 'SQL_LockDatabase', + 'SQL_UnlockDatabase', + 'SQLTCallback', + 'SQL_IsSameConnection', + 'SQL_TConnect', + 'SQL_TQuery', + 'SQL_CreateTransaction', + 'SQL_AddQuery', + 'SQLTxnSuccess', + 'SQLTxnFailure', + 'SQL_ExecuteTransaction', + 'CloseHandle', + 'CloneHandle', + 'MenuHandler', + 'CreateMenu', + 'DisplayMenu', + 'DisplayMenuAtItem', + 'AddMenuItem', + 'InsertMenuItem', + 'RemoveMenuItem', + 'RemoveAllMenuItems', + 'GetMenuItem', + 'GetMenuSelectionPosition', + 'GetMenuItemCount', + 'SetMenuPagination', + 'GetMenuPagination', + 'GetMenuStyle', + 'SetMenuTitle', + 'GetMenuTitle', + 'CreatePanelFromMenu', + 'GetMenuExitButton', + 'SetMenuExitButton', + 'GetMenuExitBackButton', + 'SetMenuExitBackButton', + 'SetMenuNoVoteButton', + 'CancelMenu', + 'GetMenuOptionFlags', + 'SetMenuOptionFlags', + 'IsVoteInProgress', + 'CancelVote', + 'VoteMenu', + 'VoteMenuToAll', + 'VoteHandler', + 'SetVoteResultCallback', + 'CheckVoteDelay', + 'IsClientInVotePool', + 'RedrawClientVoteMenu', + 'GetMenuStyleHandle', + 'CreatePanel', + 'CreateMenuEx', + 'GetClientMenu', + 'CancelClientMenu', + 'GetMaxPageItems', + 'GetPanelStyle', + 'SetPanelTitle', + 'DrawPanelItem', + 'DrawPanelText', + 'CanPanelDrawFlags', + 'SetPanelKeys', + 'SendPanelToClient', + 'GetPanelTextRemaining', + 'GetPanelCurrentKey', + 'SetPanelCurrentKey', + 'RedrawMenuItem', + 'InternalShowMenu', + 'GetMenuVoteInfo', + 'IsNewVoteAllowed', + 'PrefetchSound', + 'EmitAmbientSound', + 'FadeClientVolume', + 'StopSound', + 'EmitSound', + 'EmitSentence', + 'GetDistGainFromSoundLevel', + 'AmbientSHook', + 'NormalSHook', + 'AddAmbientSoundHook', + 'AddNormalSoundHook', + 'RemoveAmbientSoundHook', + 'RemoveNormalSoundHook', + 'EmitSoundToClient', + 'EmitSoundToAll', + 'ATTN_TO_SNDLEVEL', + 'GetGameSoundParams', + 'EmitGameSound', + 'EmitAmbientGameSound', + 'EmitGameSoundToClient', + 'EmitGameSoundToAll', + 'PrecacheScriptSound', + 'strlen', + 'StrContains', + 'strcmp', + 'strncmp', + 'StrEqual', + 'strcopy', + 'Format', + 'FormatEx', + 'VFormat', + 'StringToInt', + 'StringToIntEx', + 'IntToString', + 'StringToFloat', + 'StringToFloatEx', + 'FloatToString', + 'BreakString', + 'TrimString', + 'SplitString', + 'ReplaceString', + 'ReplaceStringEx', + 'GetCharBytes', + 'IsCharAlpha', + 'IsCharNumeric', + 'IsCharSpace', + 'IsCharMB', + 'IsCharUpper', + 'IsCharLower', + 'StripQuotes', + 'CharToUpper', + 'CharToLower', + 'FindCharInString', + 'StrCat', + 'ExplodeString', + 'ImplodeStrings', + 'GetVectorLength', + 'GetVectorDistance', + 'GetVectorDotProduct', + 'GetVectorCrossProduct', + 'NormalizeVector', + 'GetAngleVectors', + 'GetVectorAngles', + 'GetVectorVectors', + 'AddVectors', + 'SubtractVectors', + 'ScaleVector', + 'NegateVector', + 'MakeVectorFromPoints', + 'BaseComm_IsClientGagged', + 'BaseComm_IsClientMuted', + 'BaseComm_SetClientGag', + 'BaseComm_SetClientMute', + 'FormatUserLogText', + 'FindPluginByFile', + 'FindTarget', + 'AcceptEntityInput', + 'SetVariantBool', + 'SetVariantString', + 'SetVariantInt', + 'SetVariantFloat', + 'SetVariantVector3D', + 'SetVariantPosVector3D', + 'SetVariantColor', + 'SetVariantEntity', + 'GameRules_GetProp', + 'GameRules_SetProp', + 'GameRules_GetPropFloat', + 'GameRules_SetPropFloat', + 'GameRules_GetPropEnt', + 'GameRules_SetPropEnt', + 'GameRules_GetPropVector', + 'GameRules_SetPropVector', + 'GameRules_GetPropString', + 'GameRules_SetPropString', + 'GameRules_GetRoundState', + 'OnClientConnect', + 'OnClientConnected', + 'OnClientPutInServer', + 'OnClientDisconnect', + 'OnClientDisconnect_Post', + 'OnClientCommand', + 'OnClientSettingsChanged', + 'OnClientAuthorized', + 'OnClientPreAdminCheck', + 'OnClientPostAdminFilter', + 'OnClientPostAdminCheck', + 'GetMaxClients', + 'GetMaxHumanPlayers', + 'GetClientCount', + 'GetClientName', + 'GetClientIP', + 'GetClientAuthString', + 'GetClientAuthId', + 'GetSteamAccountID', + 'GetClientUserId', + 'IsClientConnected', + 'IsClientInGame', + 'IsClientInKickQueue', + 'IsClientAuthorized', + 'IsFakeClient', + 'IsClientSourceTV', + 'IsClientReplay', + 'IsClientObserver', + 'IsPlayerAlive', + 'GetClientInfo', + 'GetClientTeam', + 'SetUserAdmin', + 'GetUserAdmin', + 'AddUserFlags', + 'RemoveUserFlags', + 'SetUserFlagBits', + 'GetUserFlagBits', + 'CanUserTarget', + 'RunAdminCacheChecks', + 'NotifyPostAdminCheck', + 'CreateFakeClient', + 'SetFakeClientConVar', + 'GetClientHealth', + 'GetClientModel', + 'GetClientWeapon', + 'GetClientMaxs', + 'GetClientMins', + 'GetClientAbsAngles', + 'GetClientAbsOrigin', + 'GetClientArmor', + 'GetClientDeaths', + 'GetClientFrags', + 'GetClientDataRate', + 'IsClientTimingOut', + 'GetClientTime', + 'GetClientLatency', + 'GetClientAvgLatency', + 'GetClientAvgLoss', + 'GetClientAvgChoke', + 'GetClientAvgData', + 'GetClientAvgPackets', + 'GetClientOfUserId', + 'KickClient', + 'KickClientEx', + 'ChangeClientTeam', + 'GetClientSerial', + 'GetClientFromSerial', + 'FindStringTable', + 'GetNumStringTables', + 'GetStringTableNumStrings', + 'GetStringTableMaxStrings', + 'GetStringTableName', + 'FindStringIndex', + 'ReadStringTable', + 'GetStringTableDataLength', + 'GetStringTableData', + 'SetStringTableData', + 'AddToStringTable', + 'LockStringTables', + 'AddFileToDownloadsTable', + 'GetEntityFlags', + 'SetEntityFlags', + 'GetEntityMoveType', + 'SetEntityMoveType', + 'GetEntityRenderMode', + 'SetEntityRenderMode', + 'GetEntityRenderFx', + 'SetEntityRenderFx', + 'SetEntityRenderColor', + 'GetEntityGravity', + 'SetEntityGravity', + 'SetEntityHealth', + 'GetClientButtons', + 'EntityOutput', + 'HookEntityOutput', + 'UnhookEntityOutput', + 'HookSingleEntityOutput', + 'UnhookSingleEntityOutput', + 'SMC_CreateParser', + 'SMC_ParseFile', + 'SMC_GetErrorString', + 'SMC_ParseStart', + 'SMC_SetParseStart', + 'SMC_ParseEnd', + 'SMC_SetParseEnd', + 'SMC_NewSection', + 'SMC_KeyValue', + 'SMC_EndSection', + 'SMC_SetReaders', + 'SMC_RawLine', + 'SMC_SetRawLine', + 'BfWriteBool', + 'BfWriteByte', + 'BfWriteChar', + 'BfWriteShort', + 'BfWriteWord', + 'BfWriteNum', + 'BfWriteFloat', + 'BfWriteString', + 'BfWriteEntity', + 'BfWriteAngle', + 'BfWriteCoord', + 'BfWriteVecCoord', + 'BfWriteVecNormal', + 'BfWriteAngles', + 'BfReadBool', + 'BfReadByte', + 'BfReadChar', + 'BfReadShort', + 'BfReadWord', + 'BfReadNum', + 'BfReadFloat', + 'BfReadString', + 'BfReadEntity', + 'BfReadAngle', + 'BfReadCoord', + 'BfReadVecCoord', + 'BfReadVecNormal', + 'BfReadAngles', + 'BfGetNumBytesLeft', + 'CreateProfiler', + 'StartProfiling', + 'StopProfiling', + 'GetProfilerTime', + 'OnPluginStart', + 'AskPluginLoad2', + 'OnPluginEnd', + 'OnPluginPauseChange', + 'OnGameFrame', + 'OnMapStart', + 'OnMapEnd', + 'OnConfigsExecuted', + 'OnAutoConfigsBuffered', + 'OnAllPluginsLoaded', + 'GetMyHandle', + 'GetPluginIterator', + 'MorePlugins', + 'ReadPlugin', + 'GetPluginStatus', + 'GetPluginFilename', + 'IsPluginDebugging', + 'GetPluginInfo', + 'FindPluginByNumber', + 'SetFailState', + 'ThrowError', + 'GetTime', + 'FormatTime', + 'LoadGameConfigFile', + 'GameConfGetOffset', + 'GameConfGetKeyValue', + 'GameConfGetAddress', + 'GetSysTickCount', + 'AutoExecConfig', + 'RegPluginLibrary', + 'LibraryExists', + 'GetExtensionFileStatus', + 'OnLibraryAdded', + 'OnLibraryRemoved', + 'ReadMapList', + 'SetMapListCompatBind', + 'OnClientFloodCheck', + 'OnClientFloodResult', + 'CanTestFeatures', + 'GetFeatureStatus', + 'RequireFeature', + 'LoadFromAddress', + 'StoreToAddress', + 'CreateStack', + 'PushStackCell', + 'PushStackString', + 'PushStackArray', + 'PopStackCell', + 'PopStackString', + 'PopStackArray', + 'IsStackEmpty', + 'PopStack', + 'OnPlayerRunCmd', + 'BuildPath', + 'OpenDirectory', + 'ReadDirEntry', + 'OpenFile', + 'DeleteFile', + 'ReadFileLine', + 'ReadFile', + 'ReadFileString', + 'WriteFile', + 'WriteFileString', + 'WriteFileLine', + 'ReadFileCell', + 'WriteFileCell', + 'IsEndOfFile', + 'FileSeek', + 'FilePosition', + 'FileExists', + 'RenameFile', + 'DirExists', + 'FileSize', + 'FlushFile', + 'RemoveDir', + 'CreateDirectory', + 'GetFileTime', + 'LogToOpenFile', + 'LogToOpenFileEx', + 'PbReadInt', + 'PbReadFloat', + 'PbReadBool', + 'PbReadString', + 'PbReadColor', + 'PbReadAngle', + 'PbReadVector', + 'PbReadVector2D', + 'PbGetRepeatedFieldCount', + 'PbSetInt', + 'PbSetFloat', + 'PbSetBool', + 'PbSetString', + 'PbSetColor', + 'PbSetAngle', + 'PbSetVector', + 'PbSetVector2D', + 'PbAddInt', + 'PbAddFloat', + 'PbAddBool', + 'PbAddString', + 'PbAddColor', + 'PbAddAngle', + 'PbAddVector', + 'PbAddVector2D', + 'PbRemoveRepeatedFieldValue', + 'PbReadMessage', + 'PbReadRepeatedMessage', + 'PbAddMessage', + 'SetNextMap', + 'GetNextMap', + 'ForceChangeLevel', + 'GetMapHistorySize', + 'GetMapHistory', + 'GeoipCode2', + 'GeoipCode3', + 'GeoipCountry', + 'MarkNativeAsOptional', + 'RegClientCookie', + 'FindClientCookie', + 'SetClientCookie', + 'GetClientCookie', + 'SetAuthIdCookie', + 'AreClientCookiesCached', + 'OnClientCookiesCached', + 'CookieMenuHandler', + 'SetCookiePrefabMenu', + 'SetCookieMenuItem', + 'ShowCookieMenu', + 'GetCookieIterator', + 'ReadCookieIterator', + 'GetCookieAccess', + 'GetClientCookieTime', + 'LoadTranslations', + 'SetGlobalTransTarget', + 'GetClientLanguage', + 'GetServerLanguage', + 'GetLanguageCount', + 'GetLanguageInfo', + 'SetClientLanguage', + 'GetLanguageByCode', + 'GetLanguageByName', + 'CS_OnBuyCommand', + 'CS_OnCSWeaponDrop', + 'CS_OnGetWeaponPrice', + 'CS_OnTerminateRound', + 'CS_RespawnPlayer', + 'CS_SwitchTeam', + 'CS_DropWeapon', + 'CS_TerminateRound', + 'CS_GetTranslatedWeaponAlias', + 'CS_GetWeaponPrice', + 'CS_GetClientClanTag', + 'CS_SetClientClanTag', + 'CS_GetTeamScore', + 'CS_SetTeamScore', + 'CS_GetMVPCount', + 'CS_SetMVPCount', + 'CS_GetClientContributionScore', + 'CS_SetClientContributionScore', + 'CS_GetClientAssists', + 'CS_SetClientAssists', + 'CS_AliasToWeaponID', + 'CS_WeaponIDToAlias', + 'CS_IsValidWeaponID', + 'CS_UpdateClientModel', + 'LogToGame', + 'SetRandomSeed', + 'GetRandomFloat', + 'GetRandomInt', + 'IsMapValid', + 'IsDedicatedServer', + 'GetEngineTime', + 'GetGameTime', + 'GetGameTickCount', + 'GetGameDescription', + 'GetGameFolderName', + 'GetCurrentMap', + 'PrecacheModel', + 'PrecacheSentenceFile', + 'PrecacheDecal', + 'PrecacheGeneric', + 'IsModelPrecached', + 'IsDecalPrecached', + 'IsGenericPrecached', + 'PrecacheSound', + 'IsSoundPrecached', + 'CreateDialog', + 'GetEngineVersion', + 'PrintToChat', + 'PrintToChatAll', + 'PrintCenterText', + 'PrintCenterTextAll', + 'PrintHintText', + 'PrintHintTextToAll', + 'ShowVGUIPanel', + 'CreateHudSynchronizer', + 'SetHudTextParams', + 'SetHudTextParamsEx', + 'ShowSyncHudText', + 'ClearSyncHud', + 'ShowHudText', + 'ShowMOTDPanel', + 'DisplayAskConnectBox', + 'EntIndexToEntRef', + 'EntRefToEntIndex', + 'MakeCompatEntRef', + 'SetClientViewEntity', + 'SetLightStyle', + 'GetClientEyePosition', + 'CreateDataPack', + 'WritePackCell', + 'WritePackFloat', + 'WritePackString', + 'ReadPackCell', + 'ReadPackFloat', + 'ReadPackString', + 'ResetPack', + 'GetPackPosition', + 'SetPackPosition', + 'IsPackReadable', + 'LogMessage', + 'LogToFile', + 'LogToFileEx', + 'LogAction', + 'LogError', + 'OnLogAction', + 'GameLogHook', + 'AddGameLogHook', + 'RemoveGameLogHook', + 'FindTeamByName', + 'StartPrepSDKCall', + 'PrepSDKCall_SetVirtual', + 'PrepSDKCall_SetSignature', + 'PrepSDKCall_SetAddress', + 'PrepSDKCall_SetFromConf', + 'PrepSDKCall_SetReturnInfo', + 'PrepSDKCall_AddParameter', + 'EndPrepSDKCall', + 'SDKCall', + 'GetPlayerResourceEntity', +) + + +if __name__ == '__main__': # pragma: no cover + import re + from urllib.request import FancyURLopener + + from pygments.util import format_lines + + class Opener(FancyURLopener): + version = 'Mozilla/5.0 (Pygments Sourcemod Builtins Update)' + + opener = Opener() + + def get_version(): + f = opener.open('http://docs.sourcemod.net/api/index.php') + r = re.compile(r'SourceMod v\.([\d\.]+(?:-\w+)?)') + for line in f: + m = r.search(line.decode()) + if m is not None: + return m.groups()[0] + raise ValueError('No version in api docs') + + def get_sm_functions(): + f = opener.open('http://docs.sourcemod.net/api/SMfuncs.js') + r = re.compile(r'SMfunctions\[\d+\] = Array \("(?:public )?([^,]+)",".+"\);') + functions = [] + for line in f: + m = r.match(line.decode()) + if m is not None: + functions.append(m.groups()[0]) + return functions + + def regenerate(filename, natives): + with open(filename, encoding='utf-8') as fp: + content = fp.read() + + header = content[:content.find('FUNCTIONS = (')] + footer = content[content.find("if __name__ == '__main__':")-1:] + + + with open(filename, 'w', encoding='utf-8') as fp: + fp.write(header) + fp.write(format_lines('FUNCTIONS', natives)) + fp.write('\n\n' + footer) + + def run(): + version = get_version() + print(f'> Downloading function index for SourceMod {version}') + functions = get_sm_functions() + print('> %d functions found:' % len(functions)) + + functionlist = [] + for full_function_name in functions: + print(f'>> {full_function_name}') + functionlist.append(full_function_name) + + regenerate(__file__, functionlist) + + + run() diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/_sql_builtins.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/_sql_builtins.py new file mode 100644 index 0000000000000000000000000000000000000000..8b90e53e985798088238be39a648580a70848e04 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/_sql_builtins.py @@ -0,0 +1,106 @@ +""" + pygments.lexers._sql_builtins + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Data files for the SQL lexer. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +KEYWORDS = ( + 'ABORT', 'ABS', 'ABSOLUTE', 'ACCESS', 'ADA', 'ADD', 'ADMIN', 'AFTER', + 'AGGREGATE', 'ALIAS', 'ALL', 'ALLOCATE', 'ALTER', 'ANALYSE', 'ANALYZE', + 'AND', 'ANY', 'ARE', 'AS', 'ASC', 'ASENSITIVE', 'ASSERTION', 'ASSIGNMENT', + 'ASYMMETRIC', 'AT', 'ATOMIC', 'AUTHORIZATION', 'AVG', 'BACKWARD', + 'BEFORE', 'BEGIN', 'BETWEEN', 'BITVAR', 'BIT_LENGTH', 'BOTH', 'BREADTH', + 'BY', 'C', 'CACHE', 'CALL', 'CALLED', 'CARDINALITY', 'CASCADE', + 'CASCADED', 'CASE', 'CAST', 'CATALOG', 'CATALOG_NAME', 'CHAIN', + 'CHARACTERISTICS', 'CHARACTER_LENGTH', 'CHARACTER_SET_CATALOG', + 'CHARACTER_SET_NAME', 'CHARACTER_SET_SCHEMA', 'CHAR_LENGTH', 'CHECK', + 'CHECKED', 'CHECKPOINT', 'CLASS', 'CLASS_ORIGIN', 'CLOB', 'CLOSE', + 'CLUSTER', 'COALESCE', 'COBOL', 'COLLATE', 'COLLATION', + 'COLLATION_CATALOG', 'COLLATION_NAME', 'COLLATION_SCHEMA', 'COLUMN', + 'COLUMN_NAME', 'COMMAND_FUNCTION', 'COMMAND_FUNCTION_CODE', 'COMMENT', + 'COMMIT', 'COMMITTED', 'COMPLETION', 'CONDITION_NUMBER', 'CONNECT', + 'CONNECTION', 'CONNECTION_NAME', 'CONSTRAINT', 'CONSTRAINTS', + 'CONSTRAINT_CATALOG', 'CONSTRAINT_NAME', 'CONSTRAINT_SCHEMA', + 'CONSTRUCTOR', 'CONTAINS', 'CONTINUE', 'CONVERSION', 'CONVERT', + 'COPY', 'CORRESPONDING', 'COUNT', 'CREATE', 'CREATEDB', 'CREATEUSER', + 'CROSS', 'CUBE', 'CURRENT', 'CURRENT_DATE', 'CURRENT_PATH', + 'CURRENT_ROLE', 'CURRENT_TIME', 'CURRENT_TIMESTAMP', 'CURRENT_USER', + 'CURSOR', 'CURSOR_NAME', 'CYCLE', 'DATA', 'DATABASE', + 'DATETIME_INTERVAL_CODE', 'DATETIME_INTERVAL_PRECISION', 'DAY', + 'DEALLOCATE', 'DECLARE', 'DEFAULT', 'DEFAULTS', 'DEFERRABLE', + 'DEFERRED', 'DEFINED', 'DEFINER', 'DELETE', 'DELIMITER', 'DELIMITERS', + 'DEREF', 'DESC', 'DESCRIBE', 'DESCRIPTOR', 'DESTROY', 'DESTRUCTOR', + 'DETERMINISTIC', 'DIAGNOSTICS', 'DICTIONARY', 'DISCONNECT', 'DISPATCH', + 'DISTINCT', 'DO', 'DOMAIN', 'DROP', 'DYNAMIC', 'DYNAMIC_FUNCTION', + 'DYNAMIC_FUNCTION_CODE', 'EACH', 'ELSE', 'ELSIF', 'ENCODING', + 'ENCRYPTED', 'END', 'END-EXEC', 'EQUALS', 'ESCAPE', 'EVERY', 'EXCEPTION', + 'EXCEPT', 'EXCLUDING', 'EXCLUSIVE', 'EXEC', 'EXECUTE', 'EXISTING', + 'EXISTS', 'EXPLAIN', 'EXTERNAL', 'EXTRACT', 'FALSE', 'FETCH', 'FINAL', + 'FIRST', 'FOR', 'FORCE', 'FOREIGN', 'FORTRAN', 'FORWARD', 'FOUND', 'FREE', + 'FREEZE', 'FROM', 'FULL', 'FUNCTION', 'G', 'GENERAL', 'GENERATED', 'GET', + 'GLOBAL', 'GO', 'GOTO', 'GRANT', 'GRANTED', 'GROUP', 'GROUPING', + 'HANDLER', 'HAVING', 'HIERARCHY', 'HOLD', 'HOST', 'IDENTITY', 'IF', + 'IGNORE', 'ILIKE', 'IMMEDIATE', 'IMMEDIATELY', 'IMMUTABLE', 'IMPLEMENTATION', 'IMPLICIT', + 'IN', 'INCLUDING', 'INCREMENT', 'INDEX', 'INDITCATOR', 'INFIX', + 'INHERITS', 'INITIALIZE', 'INITIALLY', 'INNER', 'INOUT', 'INPUT', + 'INSENSITIVE', 'INSERT', 'INSTANTIABLE', 'INSTEAD', 'INTERSECT', 'INTO', + 'INVOKER', 'IS', 'ISNULL', 'ISOLATION', 'ITERATE', 'JOIN', 'KEY', + 'KEY_MEMBER', 'KEY_TYPE', 'LANCOMPILER', 'LANGUAGE', 'LARGE', 'LAST', + 'LATERAL', 'LEADING', 'LEFT', 'LENGTH', 'LESS', 'LEVEL', 'LIKE', 'LIMIT', + 'LISTEN', 'LOAD', 'LOCAL', 'LOCALTIME', 'LOCALTIMESTAMP', 'LOCATION', + 'LOCATOR', 'LOCK', 'LOWER', 'MAP', 'MATCH', 'MAX', 'MAXVALUE', + 'MESSAGE_LENGTH', 'MESSAGE_OCTET_LENGTH', 'MESSAGE_TEXT', 'METHOD', 'MIN', + 'MINUTE', 'MINVALUE', 'MOD', 'MODE', 'MODIFIES', 'MODIFY', 'MONTH', + 'MORE', 'MOVE', 'MUMPS', 'NAMES', 'NATIONAL', 'NATURAL', 'NCHAR', 'NCLOB', + 'NEW', 'NEXT', 'NO', 'NOCREATEDB', 'NOCREATEUSER', 'NONE', 'NOT', + 'NOTHING', 'NOTIFY', 'NOTNULL', 'NULL', 'NULLABLE', 'NULLIF', 'OBJECT', + 'OCTET_LENGTH', 'OF', 'OFF', 'OFFSET', 'OIDS', 'OLD', 'ON', 'ONLY', + 'OPEN', 'OPERATION', 'OPERATOR', 'OPTION', 'OPTIONS', 'OR', 'ORDER', + 'ORDINALITY', 'OUT', 'OUTER', 'OUTPUT', 'OVERLAPS', 'OVERLAY', + 'OVERRIDING', 'OWNER', 'PAD', 'PARAMETER', 'PARAMETERS', 'PARAMETER_MODE', + 'PARAMETER_NAME', 'PARAMETER_ORDINAL_POSITION', + 'PARAMETER_SPECIFIC_CATALOG', 'PARAMETER_SPECIFIC_NAME', + 'PARAMETER_SPECIFIC_SCHEMA', 'PARTIAL', 'PASCAL', 'PENDANT', 'PERIOD', 'PLACING', + 'PLI', 'POSITION', 'POSTFIX', 'PRECEEDS', 'PRECISION', 'PREFIX', 'PREORDER', + 'PREPARE', 'PRESERVE', 'PRIMARY', 'PRIOR', 'PRIVILEGES', 'PROCEDURAL', + 'PROCEDURE', 'PUBLIC', 'READ', 'READS', 'RECHECK', 'RECURSIVE', 'REF', + 'REFERENCES', 'REFERENCING', 'REINDEX', 'RELATIVE', 'RENAME', + 'REPEATABLE', 'REPLACE', 'RESET', 'RESTART', 'RESTRICT', 'RESULT', + 'RETURN', 'RETURNED_LENGTH', 'RETURNED_OCTET_LENGTH', 'RETURNED_SQLSTATE', + 'RETURNS', 'REVOKE', 'RIGHT', 'ROLE', 'ROLLBACK', 'ROLLUP', 'ROUTINE', + 'ROUTINE_CATALOG', 'ROUTINE_NAME', 'ROUTINE_SCHEMA', 'ROW', 'ROWS', + 'ROW_COUNT', 'RULE', 'SAVE_POINT', 'SCALE', 'SCHEMA', 'SCHEMA_NAME', + 'SCOPE', 'SCROLL', 'SEARCH', 'SECOND', 'SECURITY', 'SELECT', 'SELF', + 'SENSITIVE', 'SERIALIZABLE', 'SERVER_NAME', 'SESSION', 'SESSION_USER', + 'SET', 'SETOF', 'SETS', 'SHARE', 'SHOW', 'SIMILAR', 'SIMPLE', 'SIZE', + 'SOME', 'SOURCE', 'SPACE', 'SPECIFIC', 'SPECIFICTYPE', 'SPECIFIC_NAME', + 'SQL', 'SQLCODE', 'SQLERROR', 'SQLEXCEPTION', 'SQLSTATE', 'SQLWARNINIG', + 'STABLE', 'START', 'STATE', 'STATEMENT', 'STATIC', 'STATISTICS', 'STDIN', + 'STDOUT', 'STORAGE', 'STRICT', 'STRUCTURE', 'STYPE', 'SUBCLASS_ORIGIN', + 'SUBLIST', 'SUBSTRING', 'SUCCEEDS', 'SUM', 'SYMMETRIC', 'SYSID', 'SYSTEM', + 'SYSTEM_USER', 'TABLE', 'TABLE_NAME', ' TEMP', 'TEMPLATE', 'TEMPORARY', + 'TERMINATE', 'THAN', 'THEN', 'TIME', 'TIMESTAMP', 'TIMEZONE_HOUR', + 'TIMEZONE_MINUTE', 'TO', 'TOAST', 'TRAILING', 'TRANSACTION', + 'TRANSACTIONS_COMMITTED', 'TRANSACTIONS_ROLLED_BACK', 'TRANSACTION_ACTIVE', + 'TRANSFORM', 'TRANSFORMS', 'TRANSLATE', 'TRANSLATION', 'TREAT', 'TRIGGER', + 'TRIGGER_CATALOG', 'TRIGGER_NAME', 'TRIGGER_SCHEMA', 'TRIM', 'TRUE', + 'TRUNCATE', 'TRUSTED', 'TYPE', 'UNCOMMITTED', 'UNDER', 'UNENCRYPTED', + 'UNION', 'UNIQUE', 'UNKNOWN', 'UNLISTEN', 'UNNAMED', 'UNNEST', 'UNTIL', + 'UPDATE', 'UPPER', 'USAGE', 'USER', 'USER_DEFINED_TYPE_CATALOG', + 'USER_DEFINED_TYPE_NAME', 'USER_DEFINED_TYPE_SCHEMA', 'USING', 'VACUUM', + 'VALID', 'VALIDATOR', 'VALUES', 'VARIABLE', 'VERBOSE', + 'VERSION', 'VERSIONS', 'VERSIONING', 'VIEW', + 'VOLATILE', 'WHEN', 'WHENEVER', 'WHERE', 'WITH', 'WITHOUT', 'WORK', + 'WRITE', 'YEAR', 'ZONE' +) + +DATATYPES = ( + 'ARRAY', 'BIGINT', 'BINARY', 'BIT', 'BLOB', 'BOOLEAN', 'CHAR', + 'CHARACTER', 'DATE', 'DEC', 'DECIMAL', 'FLOAT', 'INT', 'INTEGER', + 'INTERVAL', 'NUMBER', 'NUMERIC', 'REAL', 'SERIAL', 'SMALLINT', + 'VARCHAR', 'VARYING', 'INT8', 'SERIAL8', 'TEXT' +) diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/_stan_builtins.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/_stan_builtins.py new file mode 100644 index 0000000000000000000000000000000000000000..8db10c32a66f418134a4036a2e3e8d5502b21146 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/_stan_builtins.py @@ -0,0 +1,648 @@ +""" + pygments.lexers._stan_builtins + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + This file contains the names of functions for Stan used by + ``pygments.lexers.math.StanLexer. This is for Stan language version 2.29.0. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +KEYWORDS = ( + 'break', + 'continue', + 'else', + 'for', + 'if', + 'in', + 'print', + 'reject', + 'return', + 'while', +) + +TYPES = ( + 'cholesky_factor_corr', + 'cholesky_factor_cov', + 'corr_matrix', + 'cov_matrix', + 'int', + 'matrix', + 'ordered', + 'positive_ordered', + 'real', + 'row_vector', + 'simplex', + 'unit_vector', + 'vector', + 'void', + 'array', + 'complex' +) + +FUNCTIONS = ( + 'abs', + 'acos', + 'acosh', + 'add_diag', + 'algebra_solver', + 'algebra_solver_newton', + 'append_array', + 'append_col', + 'append_row', + 'arg', + 'asin', + 'asinh', + 'atan', + 'atan2', + 'atanh', + 'bernoulli_cdf', + 'bernoulli_lccdf', + 'bernoulli_lcdf', + 'bernoulli_logit_glm_lpmf', + 'bernoulli_logit_glm_lupmf', + 'bernoulli_logit_glm_rng', + 'bernoulli_logit_lpmf', + 'bernoulli_logit_lupmf', + 'bernoulli_logit_rng', + 'bernoulli_lpmf', + 'bernoulli_lupmf', + 'bernoulli_rng', + 'bessel_first_kind', + 'bessel_second_kind', + 'beta', + 'beta_binomial_cdf', + 'beta_binomial_lccdf', + 'beta_binomial_lcdf', + 'beta_binomial_lpmf', + 'beta_binomial_lupmf', + 'beta_binomial_rng', + 'beta_cdf', + 'beta_lccdf', + 'beta_lcdf', + 'beta_lpdf', + 'beta_lupdf', + 'beta_proportion_lccdf', + 'beta_proportion_lcdf', + 'beta_proportion_rng', + 'beta_rng', + 'binary_log_loss', + 'binomial_cdf', + 'binomial_coefficient_log', + 'binomial_lccdf', + 'binomial_lcdf', + 'binomial_logit_lpmf', + 'binomial_logit_lupmf', + 'binomial_lpmf', + 'binomial_lupmf', + 'binomial_rng', + 'block', + 'categorical_logit_glm_lpmf', + 'categorical_logit_glm_lupmf', + 'categorical_logit_lpmf', + 'categorical_logit_lupmf', + 'categorical_logit_rng', + 'categorical_lpmf', + 'categorical_lupmf', + 'categorical_rng', + 'cauchy_cdf', + 'cauchy_lccdf', + 'cauchy_lcdf', + 'cauchy_lpdf', + 'cauchy_lupdf', + 'cauchy_rng', + 'cbrt', + 'ceil', + 'chi_square_cdf', + 'chi_square_lccdf', + 'chi_square_lcdf', + 'chi_square_lpdf', + 'chi_square_lupdf', + 'chi_square_rng', + 'chol2inv', + 'cholesky_decompose', + 'choose', + 'col', + 'cols', + 'columns_dot_product', + 'columns_dot_self', + 'conj', + 'cos', + 'cosh', + 'cov_exp_quad', + 'crossprod', + 'csr_extract_u', + 'csr_extract_v', + 'csr_extract_w', + 'csr_matrix_times_vector', + 'csr_to_dense_matrix', + 'cumulative_sum', + 'dae', + 'dae_tol', + 'determinant', + 'diag_matrix', + 'diag_post_multiply', + 'diag_pre_multiply', + 'diagonal', + 'digamma', + 'dims', + 'dirichlet_lpdf', + 'dirichlet_lupdf', + 'dirichlet_rng', + 'discrete_range_cdf', + 'discrete_range_lccdf', + 'discrete_range_lcdf', + 'discrete_range_lpmf', + 'discrete_range_lupmf', + 'discrete_range_rng', + 'distance', + 'dot_product', + 'dot_self', + 'double_exponential_cdf', + 'double_exponential_lccdf', + 'double_exponential_lcdf', + 'double_exponential_lpdf', + 'double_exponential_lupdf', + 'double_exponential_rng', + 'e', + 'eigenvalues_sym', + 'eigenvectors_sym', + 'erf', + 'erfc', + 'exp', + 'exp2', + 'exp_mod_normal_cdf', + 'exp_mod_normal_lccdf', + 'exp_mod_normal_lcdf', + 'exp_mod_normal_lpdf', + 'exp_mod_normal_lupdf', + 'exp_mod_normal_rng', + 'expm1', + 'exponential_cdf', + 'exponential_lccdf', + 'exponential_lcdf', + 'exponential_lpdf', + 'exponential_lupdf', + 'exponential_rng', + 'fabs', + 'falling_factorial', + 'fdim', + 'floor', + 'fma', + 'fmax', + 'fmin', + 'fmod', + 'frechet_cdf', + 'frechet_lccdf', + 'frechet_lcdf', + 'frechet_lpdf', + 'frechet_lupdf', + 'frechet_rng', + 'gamma_cdf', + 'gamma_lccdf', + 'gamma_lcdf', + 'gamma_lpdf', + 'gamma_lupdf', + 'gamma_p', + 'gamma_q', + 'gamma_rng', + 'gaussian_dlm_obs_lpdf', + 'gaussian_dlm_obs_lupdf', + 'generalized_inverse', + 'get_imag', + 'get_lp', + 'get_real', + 'gumbel_cdf', + 'gumbel_lccdf', + 'gumbel_lcdf', + 'gumbel_lpdf', + 'gumbel_lupdf', + 'gumbel_rng', + 'head', + 'hmm_hidden_state_prob', + 'hmm_latent_rng', + 'hmm_marginal', + 'hypergeometric_lpmf', + 'hypergeometric_lupmf', + 'hypergeometric_rng', + 'hypot', + 'identity_matrix', + 'inc_beta', + 'int_step', + 'integrate_1d', + 'integrate_ode', + 'integrate_ode_adams', + 'integrate_ode_bdf', + 'integrate_ode_rk45', + 'inv', + 'inv_chi_square_cdf', + 'inv_chi_square_lccdf', + 'inv_chi_square_lcdf', + 'inv_chi_square_lpdf', + 'inv_chi_square_lupdf', + 'inv_chi_square_rng', + 'inv_cloglog', + 'inv_erfc', + 'inv_gamma_cdf', + 'inv_gamma_lccdf', + 'inv_gamma_lcdf', + 'inv_gamma_lpdf', + 'inv_gamma_lupdf', + 'inv_gamma_rng', + 'inv_logit', + 'inv_Phi', + 'inv_sqrt', + 'inv_square', + 'inv_wishart_lpdf', + 'inv_wishart_lupdf', + 'inv_wishart_rng', + 'inverse', + 'inverse_spd', + 'is_inf', + 'is_nan', + 'lambert_w0', + 'lambert_wm1', + 'lbeta', + 'lchoose', + 'ldexp', + 'lgamma', + 'linspaced_array', + 'linspaced_int_array', + 'linspaced_row_vector', + 'linspaced_vector', + 'lkj_corr_cholesky_lpdf', + 'lkj_corr_cholesky_lupdf', + 'lkj_corr_cholesky_rng', + 'lkj_corr_lpdf', + 'lkj_corr_lupdf', + 'lkj_corr_rng', + 'lmgamma', + 'lmultiply', + 'log', + 'log10', + 'log1m', + 'log1m_exp', + 'log1m_inv_logit', + 'log1p', + 'log1p_exp', + 'log2', + 'log_determinant', + 'log_diff_exp', + 'log_falling_factorial', + 'log_inv_logit', + 'log_inv_logit_diff', + 'log_mix', + 'log_modified_bessel_first_kind', + 'log_rising_factorial', + 'log_softmax', + 'log_sum_exp', + 'logistic_cdf', + 'logistic_lccdf', + 'logistic_lcdf', + 'logistic_lpdf', + 'logistic_lupdf', + 'logistic_rng', + 'logit', + 'loglogistic_cdf', + 'loglogistic_lpdf', + 'loglogistic_rng', + 'lognormal_cdf', + 'lognormal_lccdf', + 'lognormal_lcdf', + 'lognormal_lpdf', + 'lognormal_lupdf', + 'lognormal_rng', + 'machine_precision', + 'map_rect', + 'matrix_exp', + 'matrix_exp_multiply', + 'matrix_power', + 'max', + 'mdivide_left_spd', + 'mdivide_left_tri_low', + 'mdivide_right_spd', + 'mdivide_right_tri_low', + 'mean', + 'min', + 'modified_bessel_first_kind', + 'modified_bessel_second_kind', + 'multi_gp_cholesky_lpdf', + 'multi_gp_cholesky_lupdf', + 'multi_gp_lpdf', + 'multi_gp_lupdf', + 'multi_normal_cholesky_lpdf', + 'multi_normal_cholesky_lupdf', + 'multi_normal_cholesky_rng', + 'multi_normal_lpdf', + 'multi_normal_lupdf', + 'multi_normal_prec_lpdf', + 'multi_normal_prec_lupdf', + 'multi_normal_rng', + 'multi_student_t_lpdf', + 'multi_student_t_lupdf', + 'multi_student_t_rng', + 'multinomial_logit_lpmf', + 'multinomial_logit_lupmf', + 'multinomial_logit_rng', + 'multinomial_lpmf', + 'multinomial_lupmf', + 'multinomial_rng', + 'multiply_log', + 'multiply_lower_tri_self_transpose', + 'neg_binomial_2_cdf', + 'neg_binomial_2_lccdf', + 'neg_binomial_2_lcdf', + 'neg_binomial_2_log_glm_lpmf', + 'neg_binomial_2_log_glm_lupmf', + 'neg_binomial_2_log_lpmf', + 'neg_binomial_2_log_lupmf', + 'neg_binomial_2_log_rng', + 'neg_binomial_2_lpmf', + 'neg_binomial_2_lupmf', + 'neg_binomial_2_rng', + 'neg_binomial_cdf', + 'neg_binomial_lccdf', + 'neg_binomial_lcdf', + 'neg_binomial_lpmf', + 'neg_binomial_lupmf', + 'neg_binomial_rng', + 'negative_infinity', + 'norm', + 'normal_cdf', + 'normal_id_glm_lpdf', + 'normal_id_glm_lupdf', + 'normal_lccdf', + 'normal_lcdf', + 'normal_lpdf', + 'normal_lupdf', + 'normal_rng', + 'not_a_number', + 'num_elements', + 'ode_adams', + 'ode_adams_tol', + 'ode_adjoint_tol_ctl', + 'ode_bdf', + 'ode_bdf_tol', + 'ode_ckrk', + 'ode_ckrk_tol', + 'ode_rk45', + 'ode_rk45_tol', + 'one_hot_array', + 'one_hot_int_array', + 'one_hot_row_vector', + 'one_hot_vector', + 'ones_array', + 'ones_int_array', + 'ones_row_vector', + 'ones_vector', + 'ordered_logistic_glm_lpmf', + 'ordered_logistic_glm_lupmf', + 'ordered_logistic_lpmf', + 'ordered_logistic_lupmf', + 'ordered_logistic_rng', + 'ordered_probit_lpmf', + 'ordered_probit_lupmf', + 'ordered_probit_rng', + 'owens_t', + 'pareto_cdf', + 'pareto_lccdf', + 'pareto_lcdf', + 'pareto_lpdf', + 'pareto_lupdf', + 'pareto_rng', + 'pareto_type_2_cdf', + 'pareto_type_2_lccdf', + 'pareto_type_2_lcdf', + 'pareto_type_2_lpdf', + 'pareto_type_2_lupdf', + 'pareto_type_2_rng', + 'Phi', + 'Phi_approx', + 'pi', + 'poisson_cdf', + 'poisson_lccdf', + 'poisson_lcdf', + 'poisson_log_glm_lpmf', + 'poisson_log_glm_lupmf', + 'poisson_log_lpmf', + 'poisson_log_lupmf', + 'poisson_log_rng', + 'poisson_lpmf', + 'poisson_lupmf', + 'poisson_rng', + 'polar', + 'positive_infinity', + 'pow', + 'print', + 'prod', + 'proj', + 'qr_Q', + 'qr_R', + 'qr_thin_Q', + 'qr_thin_R', + 'quad_form', + 'quad_form_diag', + 'quad_form_sym', + 'quantile', + 'rank', + 'rayleigh_cdf', + 'rayleigh_lccdf', + 'rayleigh_lcdf', + 'rayleigh_lpdf', + 'rayleigh_lupdf', + 'rayleigh_rng', + 'reduce_sum', + 'reject', + 'rep_array', + 'rep_matrix', + 'rep_row_vector', + 'rep_vector', + 'reverse', + 'rising_factorial', + 'round', + 'row', + 'rows', + 'rows_dot_product', + 'rows_dot_self', + 'scale_matrix_exp_multiply', + 'scaled_inv_chi_square_cdf', + 'scaled_inv_chi_square_lccdf', + 'scaled_inv_chi_square_lcdf', + 'scaled_inv_chi_square_lpdf', + 'scaled_inv_chi_square_lupdf', + 'scaled_inv_chi_square_rng', + 'sd', + 'segment', + 'sin', + 'singular_values', + 'sinh', + 'size', + 'skew_double_exponential_cdf', + 'skew_double_exponential_lccdf', + 'skew_double_exponential_lcdf', + 'skew_double_exponential_lpdf', + 'skew_double_exponential_lupdf', + 'skew_double_exponential_rng', + 'skew_normal_cdf', + 'skew_normal_lccdf', + 'skew_normal_lcdf', + 'skew_normal_lpdf', + 'skew_normal_lupdf', + 'skew_normal_rng', + 'softmax', + 'sort_asc', + 'sort_desc', + 'sort_indices_asc', + 'sort_indices_desc', + 'sqrt', + 'sqrt2', + 'square', + 'squared_distance', + 'std_normal_cdf', + 'std_normal_lccdf', + 'std_normal_lcdf', + 'std_normal_lpdf', + 'std_normal_lupdf', + 'std_normal_rng', + 'step', + 'student_t_cdf', + 'student_t_lccdf', + 'student_t_lcdf', + 'student_t_lpdf', + 'student_t_lupdf', + 'student_t_rng', + 'sub_col', + 'sub_row', + 'sum', + 'svd_U', + 'svd_V', + 'symmetrize_from_lower_tri', + 'tail', + 'tan', + 'tanh', + 'target', + 'tcrossprod', + 'tgamma', + 'to_array_1d', + 'to_array_2d', + 'to_complex', + 'to_matrix', + 'to_row_vector', + 'to_vector', + 'trace', + 'trace_gen_quad_form', + 'trace_quad_form', + 'trigamma', + 'trunc', + 'uniform_cdf', + 'uniform_lccdf', + 'uniform_lcdf', + 'uniform_lpdf', + 'uniform_lupdf', + 'uniform_rng', + 'uniform_simplex', + 'variance', + 'von_mises_cdf', + 'von_mises_lccdf', + 'von_mises_lcdf', + 'von_mises_lpdf', + 'von_mises_lupdf', + 'von_mises_rng', + 'weibull_cdf', + 'weibull_lccdf', + 'weibull_lcdf', + 'weibull_lpdf', + 'weibull_lupdf', + 'weibull_rng', + 'wiener_lpdf', + 'wiener_lupdf', + 'wishart_lpdf', + 'wishart_lupdf', + 'wishart_rng', + 'zeros_array', + 'zeros_int_array', + 'zeros_row_vector' +) + +DISTRIBUTIONS = ( + 'bernoulli', + 'bernoulli_logit', + 'bernoulli_logit_glm', + 'beta', + 'beta_binomial', + 'binomial', + 'binomial_logit', + 'categorical', + 'categorical_logit', + 'categorical_logit_glm', + 'cauchy', + 'chi_square', + 'dirichlet', + 'discrete_range', + 'double_exponential', + 'exp_mod_normal', + 'exponential', + 'frechet', + 'gamma', + 'gaussian_dlm_obs', + 'gumbel', + 'hypergeometric', + 'inv_chi_square', + 'inv_gamma', + 'inv_wishart', + 'lkj_corr', + 'lkj_corr_cholesky', + 'logistic', + 'loglogistic', + 'lognormal', + 'multi_gp', + 'multi_gp_cholesky', + 'multi_normal', + 'multi_normal_cholesky', + 'multi_normal_prec', + 'multi_student_t', + 'multinomial', + 'multinomial_logit', + 'neg_binomial', + 'neg_binomial_2', + 'neg_binomial_2_log', + 'neg_binomial_2_log_glm', + 'normal', + 'normal_id_glm', + 'ordered_logistic', + 'ordered_logistic_glm', + 'ordered_probit', + 'pareto', + 'pareto_type_2', + 'poisson', + 'poisson_log', + 'poisson_log_glm', + 'rayleigh', + 'scaled_inv_chi_square', + 'skew_double_exponential', + 'skew_normal', + 'std_normal', + 'student_t', + 'uniform', + 'von_mises', + 'weibull', + 'wiener', + 'wishart', +) + +RESERVED = ( + 'repeat', + 'until', + 'then', + 'true', + 'false', + 'var', + 'struct', + 'typedef', + 'export', + 'auto', + 'extern', + 'var', + 'static', +) diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/_stata_builtins.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/_stata_builtins.py new file mode 100644 index 0000000000000000000000000000000000000000..6a36f0429c79ccd13d695e163740681f5587a525 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/_stata_builtins.py @@ -0,0 +1,457 @@ +""" + pygments.lexers._stata_builtins + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Builtins for Stata + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + + +builtins_special = ( + "if", "in", "using", "replace", "by", "gen", "generate" +) + +builtins_base = ( + "if", "else", "in", "foreach", "for", "forv", "forva", + "forval", "forvalu", "forvalue", "forvalues", "by", "bys", + "bysort", "quietly", "qui", "about", "ac", + "ac_7", "acprplot", "acprplot_7", "adjust", "ado", "adopath", + "adoupdate", "alpha", "ameans", "an", "ano", "anov", "anova", + "anova_estat", "anova_terms", "anovadef", "aorder", "ap", "app", + "appe", "appen", "append", "arch", "arch_dr", "arch_estat", + "arch_p", "archlm", "areg", "areg_p", "args", "arima", + "arima_dr", "arima_estat", "arima_p", "as", "asmprobit", + "asmprobit_estat", "asmprobit_lf", "asmprobit_mfx__dlg", + "asmprobit_p", "ass", "asse", "asser", "assert", "avplot", + "avplot_7", "avplots", "avplots_7", "bcskew0", "bgodfrey", + "binreg", "bip0_lf", "biplot", "bipp_lf", "bipr_lf", + "bipr_p", "biprobit", "bitest", "bitesti", "bitowt", "blogit", + "bmemsize", "boot", "bootsamp", "bootstrap", "bootstrap_8", + "boxco_l", "boxco_p", "boxcox", "boxcox_6", "boxcox_p", + "bprobit", "br", "break", "brier", "bro", "brow", "brows", + "browse", "brr", "brrstat", "bs", "bs_7", "bsampl_w", + "bsample", "bsample_7", "bsqreg", "bstat", "bstat_7", "bstat_8", + "bstrap", "bstrap_7", "ca", "ca_estat", "ca_p", "cabiplot", + "camat", "canon", "canon_8", "canon_8_p", "canon_estat", + "canon_p", "cap", "caprojection", "capt", "captu", "captur", + "capture", "cat", "cc", "cchart", "cchart_7", "cci", + "cd", "censobs_table", "centile", "cf", "char", "chdir", + "checkdlgfiles", "checkestimationsample", "checkhlpfiles", + "checksum", "chelp", "ci", "cii", "cl", "class", "classutil", + "clear", "cli", "clis", "clist", "clo", "clog", "clog_lf", + "clog_p", "clogi", "clogi_sw", "clogit", "clogit_lf", + "clogit_p", "clogitp", "clogl_sw", "cloglog", "clonevar", + "clslistarray", "cluster", "cluster_measures", "cluster_stop", + "cluster_tree", "cluster_tree_8", "clustermat", "cmdlog", + "cnr", "cnre", "cnreg", "cnreg_p", "cnreg_sw", "cnsreg", + "codebook", "collaps4", "collapse", "colormult_nb", + "colormult_nw", "compare", "compress", "conf", "confi", + "confir", "confirm", "conren", "cons", "const", "constr", + "constra", "constrai", "constrain", "constraint", "continue", + "contract", "copy", "copyright", "copysource", "cor", "corc", + "corr", "corr2data", "corr_anti", "corr_kmo", "corr_smc", + "corre", "correl", "correla", "correlat", "correlate", + "corrgram", "cou", "coun", "count", "cox", "cox_p", "cox_sw", + "coxbase", "coxhaz", "coxvar", "cprplot", "cprplot_7", + "crc", "cret", "cretu", "cretur", "creturn", "cross", "cs", + "cscript", "cscript_log", "csi", "ct", "ct_is", "ctset", + "ctst_5", "ctst_st", "cttost", "cumsp", "cumsp_7", "cumul", + "cusum", "cusum_7", "cutil", "d", "datasig", "datasign", + "datasigna", "datasignat", "datasignatu", "datasignatur", + "datasignature", "datetof", "db", "dbeta", "de", "dec", + "deco", "decod", "decode", "deff", "des", "desc", "descr", + "descri", "describ", "describe", "destring", "dfbeta", + "dfgls", "dfuller", "di", "di_g", "dir", "dirstats", "dis", + "discard", "disp", "disp_res", "disp_s", "displ", "displa", + "display", "distinct", "do", "doe", "doed", "doedi", + "doedit", "dotplot", "dotplot_7", "dprobit", "drawnorm", + "drop", "ds", "ds_util", "dstdize", "duplicates", "durbina", + "dwstat", "dydx", "e", "ed", "edi", "edit", "egen", + "eivreg", "emdef", "end", "en", "enc", "enco", "encod", "encode", + "eq", "erase", "ereg", "ereg_lf", "ereg_p", "ereg_sw", + "ereghet", "ereghet_glf", "ereghet_glf_sh", "ereghet_gp", + "ereghet_ilf", "ereghet_ilf_sh", "ereghet_ip", "eret", + "eretu", "eretur", "ereturn", "err", "erro", "error", "est", + "est_cfexist", "est_cfname", "est_clickable", "est_expand", + "est_hold", "est_table", "est_unhold", "est_unholdok", + "estat", "estat_default", "estat_summ", "estat_vce_only", + "esti", "estimates", "etodow", "etof", "etomdy", "ex", + "exi", "exit", "expand", "expandcl", "fac", "fact", "facto", + "factor", "factor_estat", "factor_p", "factor_pca_rotated", + "factor_rotate", "factormat", "fcast", "fcast_compute", + "fcast_graph", "fdades", "fdadesc", "fdadescr", "fdadescri", + "fdadescrib", "fdadescribe", "fdasav", "fdasave", "fdause", + "fh_st", "open", "read", "close", + "file", "filefilter", "fillin", "find_hlp_file", "findfile", + "findit", "findit_7", "fit", "fl", "fli", "flis", "flist", + "for5_0", "form", "forma", "format", "fpredict", "frac_154", + "frac_adj", "frac_chk", "frac_cox", "frac_ddp", "frac_dis", + "frac_dv", "frac_in", "frac_mun", "frac_pp", "frac_pq", + "frac_pv", "frac_wgt", "frac_xo", "fracgen", "fracplot", + "fracplot_7", "fracpoly", "fracpred", "fron_ex", "fron_hn", + "fron_p", "fron_tn", "fron_tn2", "frontier", "ftodate", "ftoe", + "ftomdy", "ftowdate", "g", "gamhet_glf", "gamhet_gp", + "gamhet_ilf", "gamhet_ip", "gamma", "gamma_d2", "gamma_p", + "gamma_sw", "gammahet", "gdi_hexagon", "gdi_spokes", "ge", + "gen", "gene", "gener", "genera", "generat", "generate", + "genrank", "genstd", "genvmean", "gettoken", "gl", "gladder", + "gladder_7", "glim_l01", "glim_l02", "glim_l03", "glim_l04", + "glim_l05", "glim_l06", "glim_l07", "glim_l08", "glim_l09", + "glim_l10", "glim_l11", "glim_l12", "glim_lf", "glim_mu", + "glim_nw1", "glim_nw2", "glim_nw3", "glim_p", "glim_v1", + "glim_v2", "glim_v3", "glim_v4", "glim_v5", "glim_v6", + "glim_v7", "glm", "glm_6", "glm_p", "glm_sw", "glmpred", "glo", + "glob", "globa", "global", "glogit", "glogit_8", "glogit_p", + "gmeans", "gnbre_lf", "gnbreg", "gnbreg_5", "gnbreg_p", + "gomp_lf", "gompe_sw", "gomper_p", "gompertz", "gompertzhet", + "gomphet_glf", "gomphet_glf_sh", "gomphet_gp", "gomphet_ilf", + "gomphet_ilf_sh", "gomphet_ip", "gphdot", "gphpen", + "gphprint", "gprefs", "gprobi_p", "gprobit", "gprobit_8", "gr", + "gr7", "gr_copy", "gr_current", "gr_db", "gr_describe", + "gr_dir", "gr_draw", "gr_draw_replay", "gr_drop", "gr_edit", + "gr_editviewopts", "gr_example", "gr_example2", "gr_export", + "gr_print", "gr_qscheme", "gr_query", "gr_read", "gr_rename", + "gr_replay", "gr_save", "gr_set", "gr_setscheme", "gr_table", + "gr_undo", "gr_use", "graph", "graph7", "grebar", "greigen", + "greigen_7", "greigen_8", "grmeanby", "grmeanby_7", + "gs_fileinfo", "gs_filetype", "gs_graphinfo", "gs_stat", + "gsort", "gwood", "h", "hadimvo", "hareg", "hausman", + "haver", "he", "heck_d2", "heckma_p", "heckman", "heckp_lf", + "heckpr_p", "heckprob", "hel", "help", "hereg", "hetpr_lf", + "hetpr_p", "hetprob", "hettest", "hexdump", "hilite", + "hist", "hist_7", "histogram", "hlogit", "hlu", "hmeans", + "hotel", "hotelling", "hprobit", "hreg", "hsearch", "icd9", + "icd9_ff", "icd9p", "iis", "impute", "imtest", "inbase", + "include", "inf", "infi", "infil", "infile", "infix", "inp", + "inpu", "input", "ins", "insheet", "insp", "inspe", + "inspec", "inspect", "integ", "inten", "intreg", "intreg_7", + "intreg_p", "intrg2_ll", "intrg_ll", "intrg_ll2", "ipolate", + "iqreg", "ir", "irf", "irf_create", "irfm", "iri", "is_svy", + "is_svysum", "isid", "istdize", "ivprob_1_lf", "ivprob_lf", + "ivprobit", "ivprobit_p", "ivreg", "ivreg_footnote", + "ivtob_1_lf", "ivtob_lf", "ivtobit", "ivtobit_p", "jackknife", + "jacknife", "jknife", "jknife_6", "jknife_8", "jkstat", + "joinby", "kalarma1", "kap", "kap_3", "kapmeier", "kappa", + "kapwgt", "kdensity", "kdensity_7", "keep", "ksm", "ksmirnov", + "ktau", "kwallis", "l", "la", "lab", "labe", "label", + "labelbook", "ladder", "levels", "levelsof", "leverage", + "lfit", "lfit_p", "li", "lincom", "line", "linktest", + "lis", "list", "lloghet_glf", "lloghet_glf_sh", "lloghet_gp", + "lloghet_ilf", "lloghet_ilf_sh", "lloghet_ip", "llogi_sw", + "llogis_p", "llogist", "llogistic", "llogistichet", + "lnorm_lf", "lnorm_sw", "lnorma_p", "lnormal", "lnormalhet", + "lnormhet_glf", "lnormhet_glf_sh", "lnormhet_gp", + "lnormhet_ilf", "lnormhet_ilf_sh", "lnormhet_ip", "lnskew0", + "loadingplot", "loc", "loca", "local", "log", "logi", + "logis_lf", "logistic", "logistic_p", "logit", "logit_estat", + "logit_p", "loglogs", "logrank", "loneway", "lookfor", + "lookup", "lowess", "lowess_7", "lpredict", "lrecomp", "lroc", + "lroc_7", "lrtest", "ls", "lsens", "lsens_7", "lsens_x", + "lstat", "ltable", "ltable_7", "ltriang", "lv", "lvr2plot", + "lvr2plot_7", "m", "ma", "mac", "macr", "macro", "makecns", + "man", "manova", "manova_estat", "manova_p", "manovatest", + "mantel", "mark", "markin", "markout", "marksample", "mat", + "mat_capp", "mat_order", "mat_put_rr", "mat_rapp", "mata", + "mata_clear", "mata_describe", "mata_drop", "mata_matdescribe", + "mata_matsave", "mata_matuse", "mata_memory", "mata_mlib", + "mata_mosave", "mata_rename", "mata_which", "matalabel", + "matcproc", "matlist", "matname", "matr", "matri", + "matrix", "matrix_input__dlg", "matstrik", "mcc", "mcci", + "md0_", "md1_", "md1debug_", "md2_", "md2debug_", "mds", + "mds_estat", "mds_p", "mdsconfig", "mdslong", "mdsmat", + "mdsshepard", "mdytoe", "mdytof", "me_derd", "mean", + "means", "median", "memory", "memsize", "meqparse", "mer", + "merg", "merge", "mfp", "mfx", "mhelp", "mhodds", "minbound", + "mixed_ll", "mixed_ll_reparm", "mkassert", "mkdir", + "mkmat", "mkspline", "ml", "ml_5", "ml_adjs", "ml_bhhhs", + "ml_c_d", "ml_check", "ml_clear", "ml_cnt", "ml_debug", + "ml_defd", "ml_e0", "ml_e0_bfgs", "ml_e0_cycle", "ml_e0_dfp", + "ml_e0i", "ml_e1", "ml_e1_bfgs", "ml_e1_bhhh", "ml_e1_cycle", + "ml_e1_dfp", "ml_e2", "ml_e2_cycle", "ml_ebfg0", "ml_ebfr0", + "ml_ebfr1", "ml_ebh0q", "ml_ebhh0", "ml_ebhr0", "ml_ebr0i", + "ml_ecr0i", "ml_edfp0", "ml_edfr0", "ml_edfr1", "ml_edr0i", + "ml_eds", "ml_eer0i", "ml_egr0i", "ml_elf", "ml_elf_bfgs", + "ml_elf_bhhh", "ml_elf_cycle", "ml_elf_dfp", "ml_elfi", + "ml_elfs", "ml_enr0i", "ml_enrr0", "ml_erdu0", "ml_erdu0_bfgs", + "ml_erdu0_bhhh", "ml_erdu0_bhhhq", "ml_erdu0_cycle", + "ml_erdu0_dfp", "ml_erdu0_nrbfgs", "ml_exde", "ml_footnote", + "ml_geqnr", "ml_grad0", "ml_graph", "ml_hbhhh", "ml_hd0", + "ml_hold", "ml_init", "ml_inv", "ml_log", "ml_max", + "ml_mlout", "ml_mlout_8", "ml_model", "ml_nb0", "ml_opt", + "ml_p", "ml_plot", "ml_query", "ml_rdgrd", "ml_repor", + "ml_s_e", "ml_score", "ml_searc", "ml_technique", "ml_unhold", + "mleval", "mlf_", "mlmatbysum", "mlmatsum", "mlog", "mlogi", + "mlogit", "mlogit_footnote", "mlogit_p", "mlopts", "mlsum", + "mlvecsum", "mnl0_", "mor", "more", "mov", "move", "mprobit", + "mprobit_lf", "mprobit_p", "mrdu0_", "mrdu1_", "mvdecode", + "mvencode", "mvreg", "mvreg_estat", "n", "nbreg", + "nbreg_al", "nbreg_lf", "nbreg_p", "nbreg_sw", "nestreg", "net", + "newey", "newey_7", "newey_p", "news", "nl", "nl_7", "nl_9", + "nl_9_p", "nl_p", "nl_p_7", "nlcom", "nlcom_p", "nlexp2", + "nlexp2_7", "nlexp2a", "nlexp2a_7", "nlexp3", "nlexp3_7", + "nlgom3", "nlgom3_7", "nlgom4", "nlgom4_7", "nlinit", "nllog3", + "nllog3_7", "nllog4", "nllog4_7", "nlog_rd", "nlogit", + "nlogit_p", "nlogitgen", "nlogittree", "nlpred", "no", + "nobreak", "noi", "nois", "noisi", "noisil", "noisily", "note", + "notes", "notes_dlg", "nptrend", "numlabel", "numlist", "odbc", + "old_ver", "olo", "olog", "ologi", "ologi_sw", "ologit", + "ologit_p", "ologitp", "on", "one", "onew", "onewa", "oneway", + "op_colnm", "op_comp", "op_diff", "op_inv", "op_str", "opr", + "opro", "oprob", "oprob_sw", "oprobi", "oprobi_p", "oprobit", + "oprobitp", "opts_exclusive", "order", "orthog", "orthpoly", + "ou", "out", "outf", "outfi", "outfil", "outfile", "outs", + "outsh", "outshe", "outshee", "outsheet", "ovtest", "pac", + "pac_7", "palette", "parse", "parse_dissim", "pause", "pca", + "pca_8", "pca_display", "pca_estat", "pca_p", "pca_rotate", + "pcamat", "pchart", "pchart_7", "pchi", "pchi_7", "pcorr", + "pctile", "pentium", "pergram", "pergram_7", "permute", + "permute_8", "personal", "peto_st", "pkcollapse", "pkcross", + "pkequiv", "pkexamine", "pkexamine_7", "pkshape", "pksumm", + "pksumm_7", "pl", "plo", "plot", "plugin", "pnorm", + "pnorm_7", "poisgof", "poiss_lf", "poiss_sw", "poisso_p", + "poisson", "poisson_estat", "post", "postclose", "postfile", + "postutil", "pperron", "pr", "prais", "prais_e", "prais_e2", + "prais_p", "predict", "predictnl", "preserve", "print", + "pro", "prob", "probi", "probit", "probit_estat", "probit_p", + "proc_time", "procoverlay", "procrustes", "procrustes_estat", + "procrustes_p", "profiler", "prog", "progr", "progra", + "program", "prop", "proportion", "prtest", "prtesti", "pwcorr", + "pwd", "q", "s", "qby", "qbys", "qchi", "qchi_7", "qladder", + "qladder_7", "qnorm", "qnorm_7", "qqplot", "qqplot_7", "qreg", + "qreg_c", "qreg_p", "qreg_sw", "qu", "quadchk", "quantile", + "quantile_7", "que", "quer", "query", "range", "ranksum", + "ratio", "rchart", "rchart_7", "rcof", "recast", "reclink", + "recode", "reg", "reg3", "reg3_p", "regdw", "regr", "regre", + "regre_p2", "regres", "regres_p", "regress", "regress_estat", + "regriv_p", "remap", "ren", "rena", "renam", "rename", + "renpfix", "repeat", "replace", "report", "reshape", + "restore", "ret", "retu", "retur", "return", "rm", "rmdir", + "robvar", "roccomp", "roccomp_7", "roccomp_8", "rocf_lf", + "rocfit", "rocfit_8", "rocgold", "rocplot", "rocplot_7", + "roctab", "roctab_7", "rolling", "rologit", "rologit_p", + "rot", "rota", "rotat", "rotate", "rotatemat", "rreg", + "rreg_p", "ru", "run", "runtest", "rvfplot", "rvfplot_7", + "rvpplot", "rvpplot_7", "sa", "safesum", "sample", + "sampsi", "sav", "save", "savedresults", "saveold", "sc", + "sca", "scal", "scala", "scalar", "scatter", "scm_mine", + "sco", "scob_lf", "scob_p", "scobi_sw", "scobit", "scor", + "score", "scoreplot", "scoreplot_help", "scree", "screeplot", + "screeplot_help", "sdtest", "sdtesti", "se", "search", + "separate", "seperate", "serrbar", "serrbar_7", "serset", "set", + "set_defaults", "sfrancia", "sh", "she", "shel", "shell", + "shewhart", "shewhart_7", "signestimationsample", "signrank", + "signtest", "simul", "simul_7", "simulate", "simulate_8", + "sktest", "sleep", "slogit", "slogit_d2", "slogit_p", "smooth", + "snapspan", "so", "sor", "sort", "spearman", "spikeplot", + "spikeplot_7", "spikeplt", "spline_x", "split", "sqreg", + "sqreg_p", "sret", "sretu", "sretur", "sreturn", "ssc", "st", + "st_ct", "st_hc", "st_hcd", "st_hcd_sh", "st_is", "st_issys", + "st_note", "st_promo", "st_set", "st_show", "st_smpl", + "st_subid", "stack", "statsby", "statsby_8", "stbase", "stci", + "stci_7", "stcox", "stcox_estat", "stcox_fr", "stcox_fr_ll", + "stcox_p", "stcox_sw", "stcoxkm", "stcoxkm_7", "stcstat", + "stcurv", "stcurve", "stcurve_7", "stdes", "stem", "stepwise", + "stereg", "stfill", "stgen", "stir", "stjoin", "stmc", "stmh", + "stphplot", "stphplot_7", "stphtest", "stphtest_7", + "stptime", "strate", "strate_7", "streg", "streg_sw", "streset", + "sts", "sts_7", "stset", "stsplit", "stsum", "sttocc", + "sttoct", "stvary", "stweib", "su", "suest", "suest_8", + "sum", "summ", "summa", "summar", "summari", "summariz", + "summarize", "sunflower", "sureg", "survcurv", "survsum", + "svar", "svar_p", "svmat", "svy", "svy_disp", "svy_dreg", + "svy_est", "svy_est_7", "svy_estat", "svy_get", "svy_gnbreg_p", + "svy_head", "svy_header", "svy_heckman_p", "svy_heckprob_p", + "svy_intreg_p", "svy_ivreg_p", "svy_logistic_p", "svy_logit_p", + "svy_mlogit_p", "svy_nbreg_p", "svy_ologit_p", "svy_oprobit_p", + "svy_poisson_p", "svy_probit_p", "svy_regress_p", "svy_sub", + "svy_sub_7", "svy_x", "svy_x_7", "svy_x_p", "svydes", + "svydes_8", "svygen", "svygnbreg", "svyheckman", "svyheckprob", + "svyintreg", "svyintreg_7", "svyintrg", "svyivreg", "svylc", + "svylog_p", "svylogit", "svymarkout", "svymarkout_8", + "svymean", "svymlog", "svymlogit", "svynbreg", "svyolog", + "svyologit", "svyoprob", "svyoprobit", "svyopts", + "svypois", "svypois_7", "svypoisson", "svyprobit", "svyprobt", + "svyprop", "svyprop_7", "svyratio", "svyreg", "svyreg_p", + "svyregress", "svyset", "svyset_7", "svyset_8", "svytab", + "svytab_7", "svytest", "svytotal", "sw", "sw_8", "swcnreg", + "swcox", "swereg", "swilk", "swlogis", "swlogit", + "swologit", "swoprbt", "swpois", "swprobit", "swqreg", + "swtobit", "swweib", "symmetry", "symmi", "symplot", + "symplot_7", "syntax", "sysdescribe", "sysdir", "sysuse", + "szroeter", "ta", "tab", "tab1", "tab2", "tab_or", "tabd", + "tabdi", "tabdis", "tabdisp", "tabi", "table", "tabodds", + "tabodds_7", "tabstat", "tabu", "tabul", "tabula", "tabulat", + "tabulate", "te", "tempfile", "tempname", "tempvar", "tes", + "test", "testnl", "testparm", "teststd", "tetrachoric", + "time_it", "timer", "tis", "tob", "tobi", "tobit", "tobit_p", + "tobit_sw", "token", "tokeni", "tokeniz", "tokenize", + "tostring", "total", "translate", "translator", "transmap", + "treat_ll", "treatr_p", "treatreg", "trim", "trnb_cons", + "trnb_mean", "trpoiss_d2", "trunc_ll", "truncr_p", "truncreg", + "tsappend", "tset", "tsfill", "tsline", "tsline_ex", + "tsreport", "tsrevar", "tsrline", "tsset", "tssmooth", + "tsunab", "ttest", "ttesti", "tut_chk", "tut_wait", "tutorial", + "tw", "tware_st", "two", "twoway", "twoway__fpfit_serset", + "twoway__function_gen", "twoway__histogram_gen", + "twoway__ipoint_serset", "twoway__ipoints_serset", + "twoway__kdensity_gen", "twoway__lfit_serset", + "twoway__normgen_gen", "twoway__pci_serset", + "twoway__qfit_serset", "twoway__scatteri_serset", + "twoway__sunflower_gen", "twoway_ksm_serset", "ty", "typ", + "type", "typeof", "u", "unab", "unabbrev", "unabcmd", + "update", "us", "use", "uselabel", "var", "var_mkcompanion", + "var_p", "varbasic", "varfcast", "vargranger", "varirf", + "varirf_add", "varirf_cgraph", "varirf_create", "varirf_ctable", + "varirf_describe", "varirf_dir", "varirf_drop", "varirf_erase", + "varirf_graph", "varirf_ograph", "varirf_rename", "varirf_set", + "varirf_table", "varlist", "varlmar", "varnorm", "varsoc", + "varstable", "varstable_w", "varstable_w2", "varwle", + "vce", "vec", "vec_fevd", "vec_mkphi", "vec_p", "vec_p_w", + "vecirf_create", "veclmar", "veclmar_w", "vecnorm", + "vecnorm_w", "vecrank", "vecstable", "verinst", "vers", + "versi", "versio", "version", "view", "viewsource", "vif", + "vwls", "wdatetof", "webdescribe", "webseek", "webuse", + "weib1_lf", "weib2_lf", "weib_lf", "weib_lf0", "weibhet_glf", + "weibhet_glf_sh", "weibhet_glfa", "weibhet_glfa_sh", + "weibhet_gp", "weibhet_ilf", "weibhet_ilf_sh", "weibhet_ilfa", + "weibhet_ilfa_sh", "weibhet_ip", "weibu_sw", "weibul_p", + "weibull", "weibull_c", "weibull_s", "weibullhet", + "wh", "whelp", "whi", "which", "whil", "while", "wilc_st", + "wilcoxon", "win", "wind", "windo", "window", "winexec", + "wntestb", "wntestb_7", "wntestq", "xchart", "xchart_7", + "xcorr", "xcorr_7", "xi", "xi_6", "xmlsav", "xmlsave", + "xmluse", "xpose", "xsh", "xshe", "xshel", "xshell", + "xt_iis", "xt_tis", "xtab_p", "xtabond", "xtbin_p", + "xtclog", "xtcloglog", "xtcloglog_8", "xtcloglog_d2", + "xtcloglog_pa_p", "xtcloglog_re_p", "xtcnt_p", "xtcorr", + "xtdata", "xtdes", "xtfront_p", "xtfrontier", "xtgee", + "xtgee_elink", "xtgee_estat", "xtgee_makeivar", "xtgee_p", + "xtgee_plink", "xtgls", "xtgls_p", "xthaus", "xthausman", + "xtht_p", "xthtaylor", "xtile", "xtint_p", "xtintreg", + "xtintreg_8", "xtintreg_d2", "xtintreg_p", "xtivp_1", + "xtivp_2", "xtivreg", "xtline", "xtline_ex", "xtlogit", + "xtlogit_8", "xtlogit_d2", "xtlogit_fe_p", "xtlogit_pa_p", + "xtlogit_re_p", "xtmixed", "xtmixed_estat", "xtmixed_p", + "xtnb_fe", "xtnb_lf", "xtnbreg", "xtnbreg_pa_p", + "xtnbreg_refe_p", "xtpcse", "xtpcse_p", "xtpois", "xtpoisson", + "xtpoisson_d2", "xtpoisson_pa_p", "xtpoisson_refe_p", "xtpred", + "xtprobit", "xtprobit_8", "xtprobit_d2", "xtprobit_re_p", + "xtps_fe", "xtps_lf", "xtps_ren", "xtps_ren_8", "xtrar_p", + "xtrc", "xtrc_p", "xtrchh", "xtrefe_p", "xtreg", "xtreg_be", + "xtreg_fe", "xtreg_ml", "xtreg_pa_p", "xtreg_re", + "xtregar", "xtrere_p", "xtset", "xtsf_ll", "xtsf_llti", + "xtsum", "xttab", "xttest0", "xttobit", "xttobit_8", + "xttobit_p", "xttrans", "yx", "yxview__barlike_draw", + "yxview_area_draw", "yxview_bar_draw", "yxview_dot_draw", + "yxview_dropline_draw", "yxview_function_draw", + "yxview_iarrow_draw", "yxview_ilabels_draw", + "yxview_normal_draw", "yxview_pcarrow_draw", + "yxview_pcbarrow_draw", "yxview_pccapsym_draw", + "yxview_pcscatter_draw", "yxview_pcspike_draw", + "yxview_rarea_draw", "yxview_rbar_draw", "yxview_rbarm_draw", + "yxview_rcap_draw", "yxview_rcapsym_draw", + "yxview_rconnected_draw", "yxview_rline_draw", + "yxview_rscatter_draw", "yxview_rspike_draw", + "yxview_spike_draw", "yxview_sunflower_draw", "zap_s", "zinb", + "zinb_llf", "zinb_plf", "zip", "zip_llf", "zip_p", "zip_plf", + "zt_ct_5", "zt_hc_5", "zt_hcd_5", "zt_is_5", "zt_iss_5", + "zt_sho_5", "zt_smp_5", "ztbase_5", "ztcox_5", "ztdes_5", + "ztereg_5", "ztfill_5", "ztgen_5", "ztir_5", "ztjoin_5", "ztnb", + "ztnb_p", "ztp", "ztp_p", "zts_5", "ztset_5", "ztspli_5", + "ztsum_5", "zttoct_5", "ztvary_5", "ztweib_5" +) + + + +builtins_functions = ( + "abbrev", "abs", "acos", "acosh", "asin", "asinh", "atan", + "atan2", "atanh", "autocode", "betaden", "binomial", + "binomialp", "binomialtail", "binormal", "bofd", + "byteorder", "c", "_caller", "cauchy", "cauchyden", + "cauchytail", "Cdhms", "ceil", "char", "chi2", "chi2den", + "chi2tail", "Chms", "chop", "cholesky", "clip", "Clock", + "clock", "cloglog", "Cmdyhms", "Cofc", "cofC", "Cofd", "cofd", + "coleqnumb", "collatorlocale", "collatorversion", + "colnfreeparms", "colnumb", "colsof", "comb", "cond", "corr", + "cos", "cosh", "daily", "date", "day", "det", "dgammapda", + "dgammapdada", "dgammapdadx", "dgammapdx", "dgammapdxdx", + "dhms", "diag", "diag0cnt", "digamma", "dofb", "dofC", "dofc", + "dofh", "dofm", "dofq", "dofw", "dofy", "dow", "doy", + "dunnettprob", "e", "el", "esample", "epsdouble", "epsfloat", + "exp", "expm1", "exponential", "exponentialden", + "exponentialtail", "F", "Fden", "fileexists", "fileread", + "filereaderror", "filewrite", "float", "floor", "fmtwidth", + "frval", "_frval", "Ftail", "gammaden", "gammap", "gammaptail", + "get", "hadamard", "halfyear", "halfyearly", "has_eprop", "hh", + "hhC", "hms", "hofd", "hours", "hypergeometric", + "hypergeometricp", "I", "ibeta", "ibetatail", "igaussian", + "igaussianden", "igaussiantail", "indexnot", "inlist", + "inrange", "int", "inv", "invbinomial", "invbinomialtail", + "invcauchy", "invcauchytail", "invchi2", "invchi2tail", + "invcloglog", "invdunnettprob", "invexponential", + "invexponentialtail", "invF", "invFtail", "invgammap", + "invgammaptail", "invibeta", "invibetatail", "invigaussian", + "invigaussiantail", "invlaplace", "invlaplacetail", + "invlogisticp", "invlogisticsp", "invlogisticmsp", + "invlogistictailp", "invlogistictailsp", "invlogistictailmsp", + "invlogit", "invnbinomial", "invnbinomialtail", "invnchi2", + "invnchi2tail", "invnF", "invnFtail", "invnibeta", + "invnormal", "invnt", "invnttail", "invpoisson", + "invpoissontail", "invsym", "invt", "invttail", "invtukeyprob", + "invweibullabp", "invweibullabgp", "invweibullphabp", + "invweibullphabgp", "invweibullphtailabp", + "invweibullphtailabgp", "invweibulltailabp", + "invweibulltailabgp", "irecode", "issymmetric", "J", "laplace", + "laplaceden", "laplacetail", "ln", "ln1m", "ln1p", "lncauchyden", + "lnfactorial", "lngamma", "lnigammaden", "lnigaussianden", + "lniwishartden", "lnlaplaceden", "lnmvnormalden", "lnnormal", + "lnnormalden", "lnnormaldenxs", "lnnormaldenxms", "lnwishartden", + "log", "log10", "log1m", "log1p", "logisticx", "logisticsx", + "logisticmsx", "logisticdenx", "logisticdensx", "logisticdenmsx", + "logistictailx", "logistictailsx", "logistictailmsx", "logit", + "matmissing", "matrix", "matuniform", "max", "maxbyte", + "maxdouble", "maxfloat", "maxint", "maxlong", "mdy", "mdyhms", + "mi", "min", "minbyte", "mindouble", "minfloat", "minint", + "minlong", "minutes", "missing", "mm", "mmC", "mod", "mofd", + "month", "monthly", "mreldif", "msofhours", "msofminutes", + "msofseconds", "nbetaden", "nbinomial", "nbinomialp", + "nbinomialtail", "nchi2", "nchi2den", "nchi2tail", "nF", + "nFden", "nFtail", "nibeta", "normal", "normalden", + "normaldenxs", "normaldenxms", "npnchi2", "npnF", "npnt", + "nt", "ntden", "nttail", "nullmat", "plural", "plurals1", + "poisson", "poissonp", "poissontail", "qofd", "quarter", + "quarterly", "r", "rbeta", "rbinomial", "rcauchy", "rchi2", + "recode", "real", "regexm", "regexr", "regexs", "reldif", + "replay", "return", "rexponential", "rgamma", "rhypergeometric", + "rigaussian", "rlaplace", "rlogistic", "rlogistics", + "rlogisticms", "rnbinomial", "rnormal", "rnormalm", "rnormalms", + "round", "roweqnumb", "rownfreeparms", "rownumb", "rowsof", + "rpoisson", "rt", "runiform", "runiformab", "runiformint", + "rweibullab", "rweibullabg", "rweibullphab", "rweibullphabg", + "s", "scalar", "seconds", "sign", "sin", "sinh", + "smallestdouble", "soundex", "soundex_nara", "sqrt", "ss", + "ssC", "strcat", "strdup", "string", "stringns", "stritrim", + "strlen", "strlower", "strltrim", "strmatch", "strofreal", + "strofrealns", "strpos", "strproper", "strreverse", "strrpos", + "strrtrim", "strtoname", "strtrim", "strupper", "subinstr", + "subinword", "substr", "sum", "sweep", "t", "tan", "tanh", + "tC", "tc", "td", "tden", "th", "tin", "tm", "tobytes", "tq", + "trace", "trigamma", "trunc", "ttail", "tukeyprob", "tw", + "twithin", "uchar", "udstrlen", "udsubstr", "uisdigit", + "uisletter", "ustrcompare", "ustrfix", "ustrfrom", + "ustrinvalidcnt", "ustrleft", "ustrlen", "ustrlower", + "ustrltrim", "ustrnormalize", "ustrpos", "ustrregexm", + "ustrregexra", "ustrregexrf", "ustrregexs", "ustrreverse", + "ustrright", "ustrrpos", "ustrrtrim", "ustrsortkey", + "ustrtitle", "ustrto", "ustrtohex", "ustrtoname", + "ustrtrim", "ustrunescape", "ustrupper", "ustrword", + "ustrwordcount", "usubinstr", "usubstr", "vec", "vecdiag", + "week", "weekly", "weibullabx", "weibullabgx", "weibulldenabx", + "weibulldenabgx", "weibullphabx", "weibullphabgx", + "weibullphdenabx", "weibullphdenabgx", "weibullphtailabx", + "weibullphtailabgx", "weibulltailabx", "weibulltailabgx", + "wofd", "word", "wordbreaklocale", "wordcount", + "year", "yearly", "yh", "ym", "yofd", "yq", "yw" +) diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/_tsql_builtins.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/_tsql_builtins.py new file mode 100644 index 0000000000000000000000000000000000000000..6fa1a1f1953222260e89ae561ef8cbabb38ee6e4 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/_tsql_builtins.py @@ -0,0 +1,1003 @@ +""" + pygments.lexers._tsql_builtins + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + These are manually translated lists from https://msdn.microsoft.com. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +# See https://msdn.microsoft.com/en-us/library/ms174986.aspx. +OPERATORS = ( + '!<', + '!=', + '!>', + '<', + '<=', + '<>', + '=', + '>', + '>=', + '+', + '+=', + '-', + '-=', + '*', + '*=', + '/', + '/=', + '%', + '%=', + '&', + '&=', + '|', + '|=', + '^', + '^=', + '~', + '::', +) + +OPERATOR_WORDS = ( + 'all', + 'and', + 'any', + 'between', + 'except', + 'exists', + 'in', + 'intersect', + 'like', + 'not', + 'or', + 'some', + 'union', +) + +_KEYWORDS_SERVER = ( + 'add', + 'all', + 'alter', + 'and', + 'any', + 'as', + 'asc', + 'authorization', + 'backup', + 'begin', + 'between', + 'break', + 'browse', + 'bulk', + 'by', + 'cascade', + 'case', + 'catch', + 'check', + 'checkpoint', + 'close', + 'clustered', + 'coalesce', + 'collate', + 'column', + 'commit', + 'compute', + 'constraint', + 'contains', + 'containstable', + 'continue', + 'convert', + 'create', + 'cross', + 'current', + 'current_date', + 'current_time', + 'current_timestamp', + 'current_user', + 'cursor', + 'database', + 'dbcc', + 'deallocate', + 'declare', + 'default', + 'delete', + 'deny', + 'desc', + 'disk', + 'distinct', + 'distributed', + 'double', + 'drop', + 'dump', + 'else', + 'end', + 'errlvl', + 'escape', + 'except', + 'exec', + 'execute', + 'exists', + 'exit', + 'external', + 'fetch', + 'file', + 'fillfactor', + 'for', + 'foreign', + 'freetext', + 'freetexttable', + 'from', + 'full', + 'function', + 'goto', + 'grant', + 'group', + 'having', + 'holdlock', + 'identity', + 'identity_insert', + 'identitycol', + 'if', + 'in', + 'index', + 'inner', + 'insert', + 'intersect', + 'into', + 'is', + 'join', + 'key', + 'kill', + 'left', + 'like', + 'lineno', + 'load', + 'merge', + 'national', + 'nocheck', + 'nonclustered', + 'not', + 'null', + 'nullif', + 'of', + 'off', + 'offsets', + 'on', + 'open', + 'opendatasource', + 'openquery', + 'openrowset', + 'openxml', + 'option', + 'or', + 'order', + 'outer', + 'over', + 'percent', + 'pivot', + 'plan', + 'precision', + 'primary', + 'print', + 'proc', + 'procedure', + 'public', + 'raiserror', + 'read', + 'readtext', + 'reconfigure', + 'references', + 'replication', + 'restore', + 'restrict', + 'return', + 'revert', + 'revoke', + 'right', + 'rollback', + 'rowcount', + 'rowguidcol', + 'rule', + 'save', + 'schema', + 'securityaudit', + 'select', + 'semantickeyphrasetable', + 'semanticsimilaritydetailstable', + 'semanticsimilaritytable', + 'session_user', + 'set', + 'setuser', + 'shutdown', + 'some', + 'statistics', + 'system_user', + 'table', + 'tablesample', + 'textsize', + 'then', + 'throw', + 'to', + 'top', + 'tran', + 'transaction', + 'trigger', + 'truncate', + 'try', + 'try_convert', + 'tsequal', + 'union', + 'unique', + 'unpivot', + 'update', + 'updatetext', + 'use', + 'user', + 'values', + 'varying', + 'view', + 'waitfor', + 'when', + 'where', + 'while', + 'with', + 'within', + 'writetext', +) + +_KEYWORDS_FUTURE = ( + 'absolute', + 'action', + 'admin', + 'after', + 'aggregate', + 'alias', + 'allocate', + 'are', + 'array', + 'asensitive', + 'assertion', + 'asymmetric', + 'at', + 'atomic', + 'before', + 'binary', + 'bit', + 'blob', + 'boolean', + 'both', + 'breadth', + 'call', + 'called', + 'cardinality', + 'cascaded', + 'cast', + 'catalog', + 'char', + 'character', + 'class', + 'clob', + 'collation', + 'collect', + 'completion', + 'condition', + 'connect', + 'connection', + 'constraints', + 'constructor', + 'corr', + 'corresponding', + 'covar_pop', + 'covar_samp', + 'cube', + 'cume_dist', + 'current_catalog', + 'current_default_transform_group', + 'current_path', + 'current_role', + 'current_schema', + 'current_transform_group_for_type', + 'cycle', + 'data', + 'date', + 'day', + 'dec', + 'decimal', + 'deferrable', + 'deferred', + 'depth', + 'deref', + 'describe', + 'descriptor', + 'destroy', + 'destructor', + 'deterministic', + 'diagnostics', + 'dictionary', + 'disconnect', + 'domain', + 'dynamic', + 'each', + 'element', + 'end-exec', + 'equals', + 'every', + 'exception', + 'false', + 'filter', + 'first', + 'float', + 'found', + 'free', + 'fulltexttable', + 'fusion', + 'general', + 'get', + 'global', + 'go', + 'grouping', + 'hold', + 'host', + 'hour', + 'ignore', + 'immediate', + 'indicator', + 'initialize', + 'initially', + 'inout', + 'input', + 'int', + 'integer', + 'intersection', + 'interval', + 'isolation', + 'iterate', + 'language', + 'large', + 'last', + 'lateral', + 'leading', + 'less', + 'level', + 'like_regex', + 'limit', + 'ln', + 'local', + 'localtime', + 'localtimestamp', + 'locator', + 'map', + 'match', + 'member', + 'method', + 'minute', + 'mod', + 'modifies', + 'modify', + 'module', + 'month', + 'multiset', + 'names', + 'natural', + 'nchar', + 'nclob', + 'new', + 'next', + 'no', + 'none', + 'normalize', + 'numeric', + 'object', + 'occurrences_regex', + 'old', + 'only', + 'operation', + 'ordinality', + 'out', + 'output', + 'overlay', + 'pad', + 'parameter', + 'parameters', + 'partial', + 'partition', + 'path', + 'percent_rank', + 'percentile_cont', + 'percentile_disc', + 'position_regex', + 'postfix', + 'prefix', + 'preorder', + 'prepare', + 'preserve', + 'prior', + 'privileges', + 'range', + 'reads', + 'real', + 'recursive', + 'ref', + 'referencing', + 'regr_avgx', + 'regr_avgy', + 'regr_count', + 'regr_intercept', + 'regr_r2', + 'regr_slope', + 'regr_sxx', + 'regr_sxy', + 'regr_syy', + 'relative', + 'release', + 'result', + 'returns', + 'role', + 'rollup', + 'routine', + 'row', + 'rows', + 'savepoint', + 'scope', + 'scroll', + 'search', + 'second', + 'section', + 'sensitive', + 'sequence', + 'session', + 'sets', + 'similar', + 'size', + 'smallint', + 'space', + 'specific', + 'specifictype', + 'sql', + 'sqlexception', + 'sqlstate', + 'sqlwarning', + 'start', + 'state', + 'statement', + 'static', + 'stddev_pop', + 'stddev_samp', + 'structure', + 'submultiset', + 'substring_regex', + 'symmetric', + 'system', + 'temporary', + 'terminate', + 'than', + 'time', + 'timestamp', + 'timezone_hour', + 'timezone_minute', + 'trailing', + 'translate_regex', + 'translation', + 'treat', + 'true', + 'uescape', + 'under', + 'unknown', + 'unnest', + 'usage', + 'using', + 'value', + 'var_pop', + 'var_samp', + 'varchar', + 'variable', + 'whenever', + 'width_bucket', + 'window', + 'within', + 'without', + 'work', + 'write', + 'xmlagg', + 'xmlattributes', + 'xmlbinary', + 'xmlcast', + 'xmlcomment', + 'xmlconcat', + 'xmldocument', + 'xmlelement', + 'xmlexists', + 'xmlforest', + 'xmliterate', + 'xmlnamespaces', + 'xmlparse', + 'xmlpi', + 'xmlquery', + 'xmlserialize', + 'xmltable', + 'xmltext', + 'xmlvalidate', + 'year', + 'zone', +) + +_KEYWORDS_ODBC = ( + 'absolute', + 'action', + 'ada', + 'add', + 'all', + 'allocate', + 'alter', + 'and', + 'any', + 'are', + 'as', + 'asc', + 'assertion', + 'at', + 'authorization', + 'avg', + 'begin', + 'between', + 'bit', + 'bit_length', + 'both', + 'by', + 'cascade', + 'cascaded', + 'case', + 'cast', + 'catalog', + 'char', + 'char_length', + 'character', + 'character_length', + 'check', + 'close', + 'coalesce', + 'collate', + 'collation', + 'column', + 'commit', + 'connect', + 'connection', + 'constraint', + 'constraints', + 'continue', + 'convert', + 'corresponding', + 'count', + 'create', + 'cross', + 'current', + 'current_date', + 'current_time', + 'current_timestamp', + 'current_user', + 'cursor', + 'date', + 'day', + 'deallocate', + 'dec', + 'decimal', + 'declare', + 'default', + 'deferrable', + 'deferred', + 'delete', + 'desc', + 'describe', + 'descriptor', + 'diagnostics', + 'disconnect', + 'distinct', + 'domain', + 'double', + 'drop', + 'else', + 'end', + 'end-exec', + 'escape', + 'except', + 'exception', + 'exec', + 'execute', + 'exists', + 'external', + 'extract', + 'false', + 'fetch', + 'first', + 'float', + 'for', + 'foreign', + 'fortran', + 'found', + 'from', + 'full', + 'get', + 'global', + 'go', + 'goto', + 'grant', + 'group', + 'having', + 'hour', + 'identity', + 'immediate', + 'in', + 'include', + 'index', + 'indicator', + 'initially', + 'inner', + 'input', + 'insensitive', + 'insert', + 'int', + 'integer', + 'intersect', + 'interval', + 'into', + 'is', + 'isolation', + 'join', + 'key', + 'language', + 'last', + 'leading', + 'left', + 'level', + 'like', + 'local', + 'lower', + 'match', + 'max', + 'min', + 'minute', + 'module', + 'month', + 'names', + 'national', + 'natural', + 'nchar', + 'next', + 'no', + 'none', + 'not', + 'null', + 'nullif', + 'numeric', + 'octet_length', + 'of', + 'on', + 'only', + 'open', + 'option', + 'or', + 'order', + 'outer', + 'output', + 'overlaps', + 'pad', + 'partial', + 'pascal', + 'position', + 'precision', + 'prepare', + 'preserve', + 'primary', + 'prior', + 'privileges', + 'procedure', + 'public', + 'read', + 'real', + 'references', + 'relative', + 'restrict', + 'revoke', + 'right', + 'rollback', + 'rows', + 'schema', + 'scroll', + 'second', + 'section', + 'select', + 'session', + 'session_user', + 'set', + 'size', + 'smallint', + 'some', + 'space', + 'sql', + 'sqlca', + 'sqlcode', + 'sqlerror', + 'sqlstate', + 'sqlwarning', + 'substring', + 'sum', + 'system_user', + 'table', + 'temporary', + 'then', + 'time', + 'timestamp', + 'timezone_hour', + 'timezone_minute', + 'to', + 'trailing', + 'transaction', + 'translate', + 'translation', + 'trim', + 'true', + 'union', + 'unique', + 'unknown', + 'update', + 'upper', + 'usage', + 'user', + 'using', + 'value', + 'values', + 'varchar', + 'varying', + 'view', + 'when', + 'whenever', + 'where', + 'with', + 'work', + 'write', + 'year', + 'zone', +) + +# See https://msdn.microsoft.com/en-us/library/ms189822.aspx. +KEYWORDS = sorted(set(_KEYWORDS_FUTURE + _KEYWORDS_ODBC + _KEYWORDS_SERVER)) + +# See https://msdn.microsoft.com/en-us/library/ms187752.aspx. +TYPES = ( + 'bigint', + 'binary', + 'bit', + 'char', + 'cursor', + 'date', + 'datetime', + 'datetime2', + 'datetimeoffset', + 'decimal', + 'float', + 'hierarchyid', + 'image', + 'int', + 'money', + 'nchar', + 'ntext', + 'numeric', + 'nvarchar', + 'real', + 'smalldatetime', + 'smallint', + 'smallmoney', + 'sql_variant', + 'table', + 'text', + 'time', + 'timestamp', + 'tinyint', + 'uniqueidentifier', + 'varbinary', + 'varchar', + 'xml', +) + +# See https://msdn.microsoft.com/en-us/library/ms174318.aspx. +FUNCTIONS = ( + '$partition', + 'abs', + 'acos', + 'app_name', + 'applock_mode', + 'applock_test', + 'ascii', + 'asin', + 'assemblyproperty', + 'atan', + 'atn2', + 'avg', + 'binary_checksum', + 'cast', + 'ceiling', + 'certencoded', + 'certprivatekey', + 'char', + 'charindex', + 'checksum', + 'checksum_agg', + 'choose', + 'col_length', + 'col_name', + 'columnproperty', + 'compress', + 'concat', + 'connectionproperty', + 'context_info', + 'convert', + 'cos', + 'cot', + 'count', + 'count_big', + 'current_request_id', + 'current_timestamp', + 'current_transaction_id', + 'current_user', + 'cursor_status', + 'database_principal_id', + 'databasepropertyex', + 'dateadd', + 'datediff', + 'datediff_big', + 'datefromparts', + 'datename', + 'datepart', + 'datetime2fromparts', + 'datetimefromparts', + 'datetimeoffsetfromparts', + 'day', + 'db_id', + 'db_name', + 'decompress', + 'degrees', + 'dense_rank', + 'difference', + 'eomonth', + 'error_line', + 'error_message', + 'error_number', + 'error_procedure', + 'error_severity', + 'error_state', + 'exp', + 'file_id', + 'file_idex', + 'file_name', + 'filegroup_id', + 'filegroup_name', + 'filegroupproperty', + 'fileproperty', + 'floor', + 'format', + 'formatmessage', + 'fulltextcatalogproperty', + 'fulltextserviceproperty', + 'get_filestream_transaction_context', + 'getansinull', + 'getdate', + 'getutcdate', + 'grouping', + 'grouping_id', + 'has_perms_by_name', + 'host_id', + 'host_name', + 'iif', + 'index_col', + 'indexkey_property', + 'indexproperty', + 'is_member', + 'is_rolemember', + 'is_srvrolemember', + 'isdate', + 'isjson', + 'isnull', + 'isnumeric', + 'json_modify', + 'json_query', + 'json_value', + 'left', + 'len', + 'log', + 'log10', + 'lower', + 'ltrim', + 'max', + 'min', + 'min_active_rowversion', + 'month', + 'nchar', + 'newid', + 'newsequentialid', + 'ntile', + 'object_definition', + 'object_id', + 'object_name', + 'object_schema_name', + 'objectproperty', + 'objectpropertyex', + 'opendatasource', + 'openjson', + 'openquery', + 'openrowset', + 'openxml', + 'original_db_name', + 'original_login', + 'parse', + 'parsename', + 'patindex', + 'permissions', + 'pi', + 'power', + 'pwdcompare', + 'pwdencrypt', + 'quotename', + 'radians', + 'rand', + 'rank', + 'replace', + 'replicate', + 'reverse', + 'right', + 'round', + 'row_number', + 'rowcount_big', + 'rtrim', + 'schema_id', + 'schema_name', + 'scope_identity', + 'serverproperty', + 'session_context', + 'session_user', + 'sign', + 'sin', + 'smalldatetimefromparts', + 'soundex', + 'sp_helplanguage', + 'space', + 'sqrt', + 'square', + 'stats_date', + 'stdev', + 'stdevp', + 'str', + 'string_escape', + 'string_split', + 'stuff', + 'substring', + 'sum', + 'suser_id', + 'suser_name', + 'suser_sid', + 'suser_sname', + 'switchoffset', + 'sysdatetime', + 'sysdatetimeoffset', + 'system_user', + 'sysutcdatetime', + 'tan', + 'textptr', + 'textvalid', + 'timefromparts', + 'todatetimeoffset', + 'try_cast', + 'try_convert', + 'try_parse', + 'type_id', + 'type_name', + 'typeproperty', + 'unicode', + 'upper', + 'user_id', + 'user_name', + 'var', + 'varp', + 'xact_state', + 'year', +) diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/_usd_builtins.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/_usd_builtins.py new file mode 100644 index 0000000000000000000000000000000000000000..b0530a209c7c3e993a150e0a16a983558975af27 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/_usd_builtins.py @@ -0,0 +1,112 @@ +""" + pygments.lexers._usd_builtins + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + A collection of known USD-related keywords, attributes, and types. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +COMMON_ATTRIBUTES = [ + "extent", + "xformOpOrder", +] + +KEYWORDS = [ + "class", + "clips", + "custom", + "customData", + "def", + "dictionary", + "inherits", + "over", + "payload", + "references", + "rel", + "subLayers", + "timeSamples", + "uniform", + "variantSet", + "variantSets", + "variants", +] + +OPERATORS = [ + "add", + "append", + "delete", + "prepend", + "reorder", +] + +SPECIAL_NAMES = [ + "active", + "apiSchemas", + "defaultPrim", + "elementSize", + "endTimeCode", + "hidden", + "instanceable", + "interpolation", + "kind", + "startTimeCode", + "upAxis", +] + +TYPES = [ + "asset", + "bool", + "color3d", + "color3f", + "color3h", + "color4d", + "color4f", + "color4h", + "double", + "double2", + "double3", + "double4", + "float", + "float2", + "float3", + "float4", + "frame4d", + "half", + "half2", + "half3", + "half4", + "int", + "int2", + "int3", + "int4", + "keyword", + "matrix2d", + "matrix3d", + "matrix4d", + "normal3d", + "normal3f", + "normal3h", + "point3d", + "point3f", + "point3h", + "quatd", + "quatf", + "quath", + "string", + "syn", + "token", + "uchar", + "uchar2", + "uchar3", + "uchar4", + "uint", + "uint2", + "uint3", + "uint4", + "usdaType", + "vector3d", + "vector3f", + "vector3h", +] diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/_vbscript_builtins.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/_vbscript_builtins.py new file mode 100644 index 0000000000000000000000000000000000000000..b1ae0ef02655a96109f031842d75a410d960950b --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/_vbscript_builtins.py @@ -0,0 +1,279 @@ +""" + pygments.lexers._vbscript_builtins + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + These are manually translated lists from + http://www.indusoft.com/pdf/VBScript%20Reference.pdf. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +KEYWORDS = [ + 'ByRef', + 'ByVal', + # dim: special rule + 'call', + 'case', + 'class', + # const: special rule + 'do', + 'each', + 'else', + 'elseif', + 'end', + 'erase', + 'execute', + 'function', + 'exit', + 'for', + 'function', + 'GetRef', + 'global', + 'if', + 'let', + 'loop', + 'next', + 'new', + # option: special rule + 'private', + 'public', + 'redim', + 'select', + 'set', + 'sub', + 'then', + 'wend', + 'while', + 'with', +] + +BUILTIN_FUNCTIONS = [ + 'Abs', + 'Array', + 'Asc', + 'Atn', + 'CBool', + 'CByte', + 'CCur', + 'CDate', + 'CDbl', + 'Chr', + 'CInt', + 'CLng', + 'Cos', + 'CreateObject', + 'CSng', + 'CStr', + 'Date', + 'DateAdd', + 'DateDiff', + 'DatePart', + 'DateSerial', + 'DateValue', + 'Day', + 'Eval', + 'Exp', + 'Filter', + 'Fix', + 'FormatCurrency', + 'FormatDateTime', + 'FormatNumber', + 'FormatPercent', + 'GetObject', + 'GetLocale', + 'Hex', + 'Hour', + 'InStr', + 'inStrRev', + 'Int', + 'IsArray', + 'IsDate', + 'IsEmpty', + 'IsNull', + 'IsNumeric', + 'IsObject', + 'Join', + 'LBound', + 'LCase', + 'Left', + 'Len', + 'LoadPicture', + 'Log', + 'LTrim', + 'Mid', + 'Minute', + 'Month', + 'MonthName', + 'MsgBox', + 'Now', + 'Oct', + 'Randomize', + 'RegExp', + 'Replace', + 'RGB', + 'Right', + 'Rnd', + 'Round', + 'RTrim', + 'ScriptEngine', + 'ScriptEngineBuildVersion', + 'ScriptEngineMajorVersion', + 'ScriptEngineMinorVersion', + 'Second', + 'SetLocale', + 'Sgn', + 'Space', + 'Split', + 'Sqr', + 'StrComp', + 'String', + 'StrReverse', + 'Tan', + 'Time', + 'Timer', + 'TimeSerial', + 'TimeValue', + 'Trim', + 'TypeName', + 'UBound', + 'UCase', + 'VarType', + 'Weekday', + 'WeekdayName', + 'Year', +] + +BUILTIN_VARIABLES = [ + 'Debug', + 'Dictionary', + 'Drive', + 'Drives', + 'Err', + 'File', + 'Files', + 'FileSystemObject', + 'Folder', + 'Folders', + 'Match', + 'Matches', + 'RegExp', + 'Submatches', + 'TextStream', +] + +OPERATORS = [ + '+', + '-', + '*', + '/', + '\\', + '^', + '|', + '<', + '<=', + '>', + '>=', + '=', + '<>', + '&', + '$', +] + +OPERATOR_WORDS = [ + 'mod', + 'and', + 'or', + 'xor', + 'eqv', + 'imp', + 'is', + 'not', +] + +BUILTIN_CONSTANTS = [ + 'False', + 'True', + 'vbAbort', + 'vbAbortRetryIgnore', + 'vbApplicationModal', + 'vbArray', + 'vbBinaryCompare', + 'vbBlack', + 'vbBlue', + 'vbBoole', + 'vbByte', + 'vbCancel', + 'vbCr', + 'vbCritical', + 'vbCrLf', + 'vbCurrency', + 'vbCyan', + 'vbDataObject', + 'vbDate', + 'vbDefaultButton1', + 'vbDefaultButton2', + 'vbDefaultButton3', + 'vbDefaultButton4', + 'vbDouble', + 'vbEmpty', + 'vbError', + 'vbExclamation', + 'vbFalse', + 'vbFirstFullWeek', + 'vbFirstJan1', + 'vbFormFeed', + 'vbFriday', + 'vbGeneralDate', + 'vbGreen', + 'vbIgnore', + 'vbInformation', + 'vbInteger', + 'vbLf', + 'vbLong', + 'vbLongDate', + 'vbLongTime', + 'vbMagenta', + 'vbMonday', + 'vbMsgBoxHelpButton', + 'vbMsgBoxRight', + 'vbMsgBoxRtlReading', + 'vbMsgBoxSetForeground', + 'vbNewLine', + 'vbNo', + 'vbNull', + 'vbNullChar', + 'vbNullString', + 'vbObject', + 'vbObjectError', + 'vbOK', + 'vbOKCancel', + 'vbOKOnly', + 'vbQuestion', + 'vbRed', + 'vbRetry', + 'vbRetryCancel', + 'vbSaturday', + 'vbShortDate', + 'vbShortTime', + 'vbSingle', + 'vbString', + 'vbSunday', + 'vbSystemModal', + 'vbTab', + 'vbTextCompare', + 'vbThursday', + 'vbTrue', + 'vbTuesday', + 'vbUseDefault', + 'vbUseSystem', + 'vbUseSystem', + 'vbVariant', + 'vbVerticalTab', + 'vbWednesday', + 'vbWhite', + 'vbYellow', + 'vbYes', + 'vbYesNo', + 'vbYesNoCancel', +] diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/_vim_builtins.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/_vim_builtins.py new file mode 100644 index 0000000000000000000000000000000000000000..abbbf993a354084011c0f66b90cc2f14e1d4d62f --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/lexers/_vim_builtins.py @@ -0,0 +1,1938 @@ +""" + pygments.lexers._vim_builtins + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + This file is autogenerated by scripts/get_vimkw.py + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +# Split up in multiple functions so it's importable by jython, which has a +# per-method size limit. + +def _getauto(): + var = ( + ('BufAdd','BufAdd'), + ('BufCreate','BufCreate'), + ('BufDelete','BufDelete'), + ('BufEnter','BufEnter'), + ('BufFilePost','BufFilePost'), + ('BufFilePre','BufFilePre'), + ('BufHidden','BufHidden'), + ('BufLeave','BufLeave'), + ('BufNew','BufNew'), + ('BufNewFile','BufNewFile'), + ('BufRead','BufRead'), + ('BufReadCmd','BufReadCmd'), + ('BufReadPost','BufReadPost'), + ('BufReadPre','BufReadPre'), + ('BufUnload','BufUnload'), + ('BufWinEnter','BufWinEnter'), + ('BufWinLeave','BufWinLeave'), + ('BufWipeout','BufWipeout'), + ('BufWrite','BufWrite'), + ('BufWriteCmd','BufWriteCmd'), + ('BufWritePost','BufWritePost'), + ('BufWritePre','BufWritePre'), + ('Cmd','Cmd'), + ('CmdwinEnter','CmdwinEnter'), + ('CmdwinLeave','CmdwinLeave'), + ('ColorScheme','ColorScheme'), + ('CompleteDone','CompleteDone'), + ('CursorHold','CursorHold'), + ('CursorHoldI','CursorHoldI'), + ('CursorMoved','CursorMoved'), + ('CursorMovedI','CursorMovedI'), + ('EncodingChanged','EncodingChanged'), + ('FileAppendCmd','FileAppendCmd'), + ('FileAppendPost','FileAppendPost'), + ('FileAppendPre','FileAppendPre'), + ('FileChangedRO','FileChangedRO'), + ('FileChangedShell','FileChangedShell'), + ('FileChangedShellPost','FileChangedShellPost'), + ('FileEncoding','FileEncoding'), + ('FileReadCmd','FileReadCmd'), + ('FileReadPost','FileReadPost'), + ('FileReadPre','FileReadPre'), + ('FileType','FileType'), + ('FileWriteCmd','FileWriteCmd'), + ('FileWritePost','FileWritePost'), + ('FileWritePre','FileWritePre'), + ('FilterReadPost','FilterReadPost'), + ('FilterReadPre','FilterReadPre'), + ('FilterWritePost','FilterWritePost'), + ('FilterWritePre','FilterWritePre'), + ('FocusGained','FocusGained'), + ('FocusLost','FocusLost'), + ('FuncUndefined','FuncUndefined'), + ('GUIEnter','GUIEnter'), + ('GUIFailed','GUIFailed'), + ('InsertChange','InsertChange'), + ('InsertCharPre','InsertCharPre'), + ('InsertEnter','InsertEnter'), + ('InsertLeave','InsertLeave'), + ('MenuPopup','MenuPopup'), + ('QuickFixCmdPost','QuickFixCmdPost'), + ('QuickFixCmdPre','QuickFixCmdPre'), + ('QuitPre','QuitPre'), + ('RemoteReply','RemoteReply'), + ('SessionLoadPost','SessionLoadPost'), + ('ShellCmdPost','ShellCmdPost'), + ('ShellFilterPost','ShellFilterPost'), + ('SourceCmd','SourceCmd'), + ('SourcePre','SourcePre'), + ('SpellFileMissing','SpellFileMissing'), + ('StdinReadPost','StdinReadPost'), + ('StdinReadPre','StdinReadPre'), + ('SwapExists','SwapExists'), + ('Syntax','Syntax'), + ('TabEnter','TabEnter'), + ('TabLeave','TabLeave'), + ('TermChanged','TermChanged'), + ('TermResponse','TermResponse'), + ('TextChanged','TextChanged'), + ('TextChangedI','TextChangedI'), + ('User','User'), + ('UserGettingBored','UserGettingBored'), + ('VimEnter','VimEnter'), + ('VimLeave','VimLeave'), + ('VimLeavePre','VimLeavePre'), + ('VimResized','VimResized'), + ('WinEnter','WinEnter'), + ('WinLeave','WinLeave'), + ('event','event'), + ) + return var +auto = _getauto() + +def _getcommand(): + var = ( + ('a','a'), + ('ab','ab'), + ('abc','abclear'), + ('abo','aboveleft'), + ('al','all'), + ('ar','ar'), + ('ar','args'), + ('arga','argadd'), + ('argd','argdelete'), + ('argdo','argdo'), + ('arge','argedit'), + ('argg','argglobal'), + ('argl','arglocal'), + ('argu','argument'), + ('as','ascii'), + ('au','au'), + ('b','buffer'), + ('bN','bNext'), + ('ba','ball'), + ('bad','badd'), + ('bd','bdelete'), + ('bel','belowright'), + ('bf','bfirst'), + ('bl','blast'), + ('bm','bmodified'), + ('bn','bnext'), + ('bo','botright'), + ('bp','bprevious'), + ('br','br'), + ('br','brewind'), + ('brea','break'), + ('breaka','breakadd'), + ('breakd','breakdel'), + ('breakl','breaklist'), + ('bro','browse'), + ('bu','bu'), + ('buf','buf'), + ('bufdo','bufdo'), + ('buffers','buffers'), + ('bun','bunload'), + ('bw','bwipeout'), + ('c','c'), + ('c','change'), + ('cN','cN'), + ('cN','cNext'), + ('cNf','cNf'), + ('cNf','cNfile'), + ('cabc','cabclear'), + ('cad','cad'), + ('cad','caddexpr'), + ('caddb','caddbuffer'), + ('caddf','caddfile'), + ('cal','call'), + ('cat','catch'), + ('cb','cbuffer'), + ('cc','cc'), + ('ccl','cclose'), + ('cd','cd'), + ('ce','center'), + ('cex','cexpr'), + ('cf','cfile'), + ('cfir','cfirst'), + ('cg','cgetfile'), + ('cgetb','cgetbuffer'), + ('cgete','cgetexpr'), + ('changes','changes'), + ('chd','chdir'), + ('che','checkpath'), + ('checkt','checktime'), + ('cl','cl'), + ('cl','clist'), + ('cla','clast'), + ('clo','close'), + ('cmapc','cmapclear'), + ('cn','cn'), + ('cn','cnext'), + ('cnew','cnewer'), + ('cnf','cnf'), + ('cnf','cnfile'), + ('co','copy'), + ('col','colder'), + ('colo','colorscheme'), + ('com','com'), + ('comc','comclear'), + ('comp','compiler'), + ('con','con'), + ('con','continue'), + ('conf','confirm'), + ('cope','copen'), + ('cp','cprevious'), + ('cpf','cpfile'), + ('cq','cquit'), + ('cr','crewind'), + ('cs','cs'), + ('cscope','cscope'), + ('cstag','cstag'), + ('cuna','cunabbrev'), + ('cw','cwindow'), + ('d','d'), + ('d','delete'), + ('de','de'), + ('debug','debug'), + ('debugg','debuggreedy'), + ('del','del'), + ('delc','delcommand'), + ('delel','delel'), + ('delep','delep'), + ('deletel','deletel'), + ('deletep','deletep'), + ('deletl','deletl'), + ('deletp','deletp'), + ('delf','delf'), + ('delf','delfunction'), + ('dell','dell'), + ('delm','delmarks'), + ('delp','delp'), + ('dep','dep'), + ('di','di'), + ('di','display'), + ('diffg','diffget'), + ('diffo','diffoff'), + ('diffp','diffpatch'), + ('diffpu','diffput'), + ('diffs','diffsplit'), + ('difft','diffthis'), + ('diffu','diffupdate'), + ('dig','dig'), + ('dig','digraphs'), + ('dir','dir'), + ('dj','djump'), + ('dl','dl'), + ('dli','dlist'), + ('do','do'), + ('doau','doau'), + ('dp','dp'), + ('dr','drop'), + ('ds','dsearch'), + ('dsp','dsplit'), + ('e','e'), + ('e','edit'), + ('ea','ea'), + ('earlier','earlier'), + ('ec','ec'), + ('echoe','echoerr'), + ('echom','echomsg'), + ('echon','echon'), + ('el','else'), + ('elsei','elseif'), + ('em','emenu'), + ('en','en'), + ('en','endif'), + ('endf','endf'), + ('endf','endfunction'), + ('endfo','endfor'), + ('endfun','endfun'), + ('endt','endtry'), + ('endw','endwhile'), + ('ene','enew'), + ('ex','ex'), + ('exi','exit'), + ('exu','exusage'), + ('f','f'), + ('f','file'), + ('files','files'), + ('filet','filet'), + ('filetype','filetype'), + ('fin','fin'), + ('fin','find'), + ('fina','finally'), + ('fini','finish'), + ('fir','first'), + ('fix','fixdel'), + ('fo','fold'), + ('foldc','foldclose'), + ('foldd','folddoopen'), + ('folddoc','folddoclosed'), + ('foldo','foldopen'), + ('for','for'), + ('fu','fu'), + ('fu','function'), + ('fun','fun'), + ('g','g'), + ('go','goto'), + ('gr','grep'), + ('grepa','grepadd'), + ('gui','gui'), + ('gvim','gvim'), + ('h','h'), + ('h','help'), + ('ha','hardcopy'), + ('helpf','helpfind'), + ('helpg','helpgrep'), + ('helpt','helptags'), + ('hi','hi'), + ('hid','hide'), + ('his','history'), + ('i','i'), + ('ia','ia'), + ('iabc','iabclear'), + ('if','if'), + ('ij','ijump'), + ('il','ilist'), + ('imapc','imapclear'), + ('in','in'), + ('intro','intro'), + ('is','isearch'), + ('isp','isplit'), + ('iuna','iunabbrev'), + ('j','join'), + ('ju','jumps'), + ('k','k'), + ('kee','keepmarks'), + ('keepa','keepa'), + ('keepalt','keepalt'), + ('keepj','keepjumps'), + ('keepp','keeppatterns'), + ('l','l'), + ('l','list'), + ('lN','lN'), + ('lN','lNext'), + ('lNf','lNf'), + ('lNf','lNfile'), + ('la','la'), + ('la','last'), + ('lad','lad'), + ('lad','laddexpr'), + ('laddb','laddbuffer'), + ('laddf','laddfile'), + ('lan','lan'), + ('lan','language'), + ('lat','lat'), + ('later','later'), + ('lb','lbuffer'), + ('lc','lcd'), + ('lch','lchdir'), + ('lcl','lclose'), + ('lcs','lcs'), + ('lcscope','lcscope'), + ('le','left'), + ('lefta','leftabove'), + ('lex','lexpr'), + ('lf','lfile'), + ('lfir','lfirst'), + ('lg','lgetfile'), + ('lgetb','lgetbuffer'), + ('lgete','lgetexpr'), + ('lgr','lgrep'), + ('lgrepa','lgrepadd'), + ('lh','lhelpgrep'), + ('ll','ll'), + ('lla','llast'), + ('lli','llist'), + ('lmak','lmake'), + ('lmapc','lmapclear'), + ('lne','lne'), + ('lne','lnext'), + ('lnew','lnewer'), + ('lnf','lnf'), + ('lnf','lnfile'), + ('lo','lo'), + ('lo','loadview'), + ('loadk','loadk'), + ('loadkeymap','loadkeymap'), + ('loc','lockmarks'), + ('lockv','lockvar'), + ('lol','lolder'), + ('lop','lopen'), + ('lp','lprevious'), + ('lpf','lpfile'), + ('lr','lrewind'), + ('ls','ls'), + ('lt','ltag'), + ('lua','lua'), + ('luado','luado'), + ('luafile','luafile'), + ('lv','lvimgrep'), + ('lvimgrepa','lvimgrepadd'), + ('lw','lwindow'), + ('m','move'), + ('ma','ma'), + ('ma','mark'), + ('mak','make'), + ('marks','marks'), + ('mat','match'), + ('menut','menut'), + ('menut','menutranslate'), + ('mes','mes'), + ('messages','messages'), + ('mk','mk'), + ('mk','mkexrc'), + ('mks','mksession'), + ('mksp','mkspell'), + ('mkv','mkv'), + ('mkv','mkvimrc'), + ('mkvie','mkview'), + ('mo','mo'), + ('mod','mode'), + ('mz','mz'), + ('mz','mzscheme'), + ('mzf','mzfile'), + ('n','n'), + ('n','next'), + ('nb','nbkey'), + ('nbc','nbclose'), + ('nbs','nbstart'), + ('ne','ne'), + ('new','new'), + ('nmapc','nmapclear'), + ('noa','noa'), + ('noautocmd','noautocmd'), + ('noh','nohlsearch'), + ('nu','number'), + ('o','o'), + ('o','open'), + ('ol','oldfiles'), + ('omapc','omapclear'), + ('on','only'), + ('opt','options'), + ('ownsyntax','ownsyntax'), + ('p','p'), + ('p','print'), + ('pc','pclose'), + ('pe','pe'), + ('pe','perl'), + ('ped','pedit'), + ('perld','perldo'), + ('po','pop'), + ('popu','popu'), + ('popu','popup'), + ('pp','ppop'), + ('pr','pr'), + ('pre','preserve'), + ('prev','previous'), + ('pro','pro'), + ('prof','profile'), + ('profd','profdel'), + ('promptf','promptfind'), + ('promptr','promptrepl'), + ('ps','psearch'), + ('ptN','ptN'), + ('ptN','ptNext'), + ('pta','ptag'), + ('ptf','ptfirst'), + ('ptj','ptjump'), + ('ptl','ptlast'), + ('ptn','ptn'), + ('ptn','ptnext'), + ('ptp','ptprevious'), + ('ptr','ptrewind'), + ('pts','ptselect'), + ('pu','put'), + ('pw','pwd'), + ('py','py'), + ('py','python'), + ('py3','py3'), + ('py3','py3'), + ('py3do','py3do'), + ('pydo','pydo'), + ('pyf','pyfile'), + ('python3','python3'), + ('q','q'), + ('q','quit'), + ('qa','qall'), + ('quita','quitall'), + ('r','r'), + ('r','read'), + ('re','re'), + ('rec','recover'), + ('red','red'), + ('red','redo'), + ('redi','redir'), + ('redr','redraw'), + ('redraws','redrawstatus'), + ('reg','registers'), + ('res','resize'), + ('ret','retab'), + ('retu','return'), + ('rew','rewind'), + ('ri','right'), + ('rightb','rightbelow'), + ('ru','ru'), + ('ru','runtime'), + ('rub','ruby'), + ('rubyd','rubydo'), + ('rubyf','rubyfile'), + ('rundo','rundo'), + ('rv','rviminfo'), + ('sN','sNext'), + ('sa','sargument'), + ('sal','sall'), + ('san','sandbox'), + ('sav','saveas'), + ('sb','sbuffer'), + ('sbN','sbNext'), + ('sba','sball'), + ('sbf','sbfirst'), + ('sbl','sblast'), + ('sbm','sbmodified'), + ('sbn','sbnext'), + ('sbp','sbprevious'), + ('sbr','sbrewind'), + ('scrip','scrip'), + ('scrip','scriptnames'), + ('scripte','scriptencoding'), + ('scs','scs'), + ('scscope','scscope'), + ('se','set'), + ('setf','setfiletype'), + ('setg','setglobal'), + ('setl','setlocal'), + ('sf','sfind'), + ('sfir','sfirst'), + ('sh','shell'), + ('si','si'), + ('sig','sig'), + ('sign','sign'), + ('sil','silent'), + ('sim','simalt'), + ('sl','sl'), + ('sl','sleep'), + ('sla','slast'), + ('sm','smagic'), + ('sm','smap'), + ('sme','sme'), + ('smenu','smenu'), + ('sn','snext'), + ('sni','sniff'), + ('sno','snomagic'), + ('snoreme','snoreme'), + ('snoremenu','snoremenu'), + ('so','so'), + ('so','source'), + ('sor','sort'), + ('sp','split'), + ('spe','spe'), + ('spe','spellgood'), + ('spelld','spelldump'), + ('spelli','spellinfo'), + ('spellr','spellrepall'), + ('spellu','spellundo'), + ('spellw','spellwrong'), + ('spr','sprevious'), + ('sre','srewind'), + ('st','st'), + ('st','stop'), + ('sta','stag'), + ('star','star'), + ('star','startinsert'), + ('start','start'), + ('startg','startgreplace'), + ('startr','startreplace'), + ('stj','stjump'), + ('stopi','stopinsert'), + ('sts','stselect'), + ('sun','sunhide'), + ('sunme','sunme'), + ('sunmenu','sunmenu'), + ('sus','suspend'), + ('sv','sview'), + ('sw','swapname'), + ('sy','sy'), + ('syn','syn'), + ('sync','sync'), + ('syncbind','syncbind'), + ('syntime','syntime'), + ('t','t'), + ('tN','tN'), + ('tN','tNext'), + ('ta','ta'), + ('ta','tag'), + ('tab','tab'), + ('tabN','tabN'), + ('tabN','tabNext'), + ('tabc','tabclose'), + ('tabd','tabdo'), + ('tabe','tabedit'), + ('tabf','tabfind'), + ('tabfir','tabfirst'), + ('tabl','tablast'), + ('tabm','tabmove'), + ('tabn','tabnext'), + ('tabnew','tabnew'), + ('tabo','tabonly'), + ('tabp','tabprevious'), + ('tabr','tabrewind'), + ('tabs','tabs'), + ('tags','tags'), + ('tc','tcl'), + ('tcld','tcldo'), + ('tclf','tclfile'), + ('te','tearoff'), + ('tf','tfirst'), + ('th','throw'), + ('tj','tjump'), + ('tl','tlast'), + ('tm','tm'), + ('tm','tmenu'), + ('tn','tn'), + ('tn','tnext'), + ('to','topleft'), + ('tp','tprevious'), + ('tr','tr'), + ('tr','trewind'), + ('try','try'), + ('ts','tselect'), + ('tu','tu'), + ('tu','tunmenu'), + ('u','u'), + ('u','undo'), + ('un','un'), + ('una','unabbreviate'), + ('undoj','undojoin'), + ('undol','undolist'), + ('unh','unhide'), + ('unl','unl'), + ('unlo','unlockvar'), + ('uns','unsilent'), + ('up','update'), + ('v','v'), + ('ve','ve'), + ('ve','version'), + ('verb','verbose'), + ('vert','vertical'), + ('vi','vi'), + ('vi','visual'), + ('vie','view'), + ('vim','vimgrep'), + ('vimgrepa','vimgrepadd'), + ('viu','viusage'), + ('vmapc','vmapclear'), + ('vne','vnew'), + ('vs','vsplit'), + ('w','w'), + ('w','write'), + ('wN','wNext'), + ('wa','wall'), + ('wh','while'), + ('win','win'), + ('win','winsize'), + ('winc','wincmd'), + ('windo','windo'), + ('winp','winpos'), + ('wn','wnext'), + ('wp','wprevious'), + ('wq','wq'), + ('wqa','wqall'), + ('ws','wsverb'), + ('wundo','wundo'), + ('wv','wviminfo'), + ('x','x'), + ('x','xit'), + ('xa','xall'), + ('xmapc','xmapclear'), + ('xme','xme'), + ('xmenu','xmenu'), + ('xnoreme','xnoreme'), + ('xnoremenu','xnoremenu'), + ('xunme','xunme'), + ('xunmenu','xunmenu'), + ('xwininfo','xwininfo'), + ('y','yank'), + ) + return var +command = _getcommand() + +def _getoption(): + var = ( + ('acd','acd'), + ('ai','ai'), + ('akm','akm'), + ('al','al'), + ('aleph','aleph'), + ('allowrevins','allowrevins'), + ('altkeymap','altkeymap'), + ('ambiwidth','ambiwidth'), + ('ambw','ambw'), + ('anti','anti'), + ('antialias','antialias'), + ('ar','ar'), + ('arab','arab'), + ('arabic','arabic'), + ('arabicshape','arabicshape'), + ('ari','ari'), + ('arshape','arshape'), + ('autochdir','autochdir'), + ('autoindent','autoindent'), + ('autoread','autoread'), + ('autowrite','autowrite'), + ('autowriteall','autowriteall'), + ('aw','aw'), + ('awa','awa'), + ('background','background'), + ('backspace','backspace'), + ('backup','backup'), + ('backupcopy','backupcopy'), + ('backupdir','backupdir'), + ('backupext','backupext'), + ('backupskip','backupskip'), + ('balloondelay','balloondelay'), + ('ballooneval','ballooneval'), + ('balloonexpr','balloonexpr'), + ('bdir','bdir'), + ('bdlay','bdlay'), + ('beval','beval'), + ('bex','bex'), + ('bexpr','bexpr'), + ('bg','bg'), + ('bh','bh'), + ('bin','bin'), + ('binary','binary'), + ('biosk','biosk'), + ('bioskey','bioskey'), + ('bk','bk'), + ('bkc','bkc'), + ('bl','bl'), + ('bomb','bomb'), + ('breakat','breakat'), + ('brk','brk'), + ('browsedir','browsedir'), + ('bs','bs'), + ('bsdir','bsdir'), + ('bsk','bsk'), + ('bt','bt'), + ('bufhidden','bufhidden'), + ('buflisted','buflisted'), + ('buftype','buftype'), + ('casemap','casemap'), + ('cb','cb'), + ('cc','cc'), + ('ccv','ccv'), + ('cd','cd'), + ('cdpath','cdpath'), + ('cedit','cedit'), + ('cf','cf'), + ('cfu','cfu'), + ('ch','ch'), + ('charconvert','charconvert'), + ('ci','ci'), + ('cin','cin'), + ('cindent','cindent'), + ('cink','cink'), + ('cinkeys','cinkeys'), + ('cino','cino'), + ('cinoptions','cinoptions'), + ('cinw','cinw'), + ('cinwords','cinwords'), + ('clipboard','clipboard'), + ('cmdheight','cmdheight'), + ('cmdwinheight','cmdwinheight'), + ('cmp','cmp'), + ('cms','cms'), + ('co','co'), + ('cocu','cocu'), + ('cole','cole'), + ('colorcolumn','colorcolumn'), + ('columns','columns'), + ('com','com'), + ('comments','comments'), + ('commentstring','commentstring'), + ('compatible','compatible'), + ('complete','complete'), + ('completefunc','completefunc'), + ('completeopt','completeopt'), + ('concealcursor','concealcursor'), + ('conceallevel','conceallevel'), + ('confirm','confirm'), + ('consk','consk'), + ('conskey','conskey'), + ('copyindent','copyindent'), + ('cot','cot'), + ('cp','cp'), + ('cpo','cpo'), + ('cpoptions','cpoptions'), + ('cpt','cpt'), + ('crb','crb'), + ('cryptmethod','cryptmethod'), + ('cscopepathcomp','cscopepathcomp'), + ('cscopeprg','cscopeprg'), + ('cscopequickfix','cscopequickfix'), + ('cscoperelative','cscoperelative'), + ('cscopetag','cscopetag'), + ('cscopetagorder','cscopetagorder'), + ('cscopeverbose','cscopeverbose'), + ('cspc','cspc'), + ('csprg','csprg'), + ('csqf','csqf'), + ('csre','csre'), + ('cst','cst'), + ('csto','csto'), + ('csverb','csverb'), + ('cuc','cuc'), + ('cul','cul'), + ('cursorbind','cursorbind'), + ('cursorcolumn','cursorcolumn'), + ('cursorline','cursorline'), + ('cwh','cwh'), + ('debug','debug'), + ('deco','deco'), + ('def','def'), + ('define','define'), + ('delcombine','delcombine'), + ('dex','dex'), + ('dg','dg'), + ('dict','dict'), + ('dictionary','dictionary'), + ('diff','diff'), + ('diffexpr','diffexpr'), + ('diffopt','diffopt'), + ('digraph','digraph'), + ('dip','dip'), + ('dir','dir'), + ('directory','directory'), + ('display','display'), + ('dy','dy'), + ('ea','ea'), + ('ead','ead'), + ('eadirection','eadirection'), + ('eb','eb'), + ('ed','ed'), + ('edcompatible','edcompatible'), + ('ef','ef'), + ('efm','efm'), + ('ei','ei'), + ('ek','ek'), + ('enc','enc'), + ('encoding','encoding'), + ('endofline','endofline'), + ('eol','eol'), + ('ep','ep'), + ('equalalways','equalalways'), + ('equalprg','equalprg'), + ('errorbells','errorbells'), + ('errorfile','errorfile'), + ('errorformat','errorformat'), + ('esckeys','esckeys'), + ('et','et'), + ('eventignore','eventignore'), + ('ex','ex'), + ('expandtab','expandtab'), + ('exrc','exrc'), + ('fcl','fcl'), + ('fcs','fcs'), + ('fdc','fdc'), + ('fde','fde'), + ('fdi','fdi'), + ('fdl','fdl'), + ('fdls','fdls'), + ('fdm','fdm'), + ('fdn','fdn'), + ('fdo','fdo'), + ('fdt','fdt'), + ('fen','fen'), + ('fenc','fenc'), + ('fencs','fencs'), + ('fex','fex'), + ('ff','ff'), + ('ffs','ffs'), + ('fic','fic'), + ('fileencoding','fileencoding'), + ('fileencodings','fileencodings'), + ('fileformat','fileformat'), + ('fileformats','fileformats'), + ('fileignorecase','fileignorecase'), + ('filetype','filetype'), + ('fillchars','fillchars'), + ('fk','fk'), + ('fkmap','fkmap'), + ('flp','flp'), + ('fml','fml'), + ('fmr','fmr'), + ('fo','fo'), + ('foldclose','foldclose'), + ('foldcolumn','foldcolumn'), + ('foldenable','foldenable'), + ('foldexpr','foldexpr'), + ('foldignore','foldignore'), + ('foldlevel','foldlevel'), + ('foldlevelstart','foldlevelstart'), + ('foldmarker','foldmarker'), + ('foldmethod','foldmethod'), + ('foldminlines','foldminlines'), + ('foldnestmax','foldnestmax'), + ('foldopen','foldopen'), + ('foldtext','foldtext'), + ('formatexpr','formatexpr'), + ('formatlistpat','formatlistpat'), + ('formatoptions','formatoptions'), + ('formatprg','formatprg'), + ('fp','fp'), + ('fs','fs'), + ('fsync','fsync'), + ('ft','ft'), + ('gcr','gcr'), + ('gd','gd'), + ('gdefault','gdefault'), + ('gfm','gfm'), + ('gfn','gfn'), + ('gfs','gfs'), + ('gfw','gfw'), + ('ghr','ghr'), + ('go','go'), + ('gp','gp'), + ('grepformat','grepformat'), + ('grepprg','grepprg'), + ('gtl','gtl'), + ('gtt','gtt'), + ('guicursor','guicursor'), + ('guifont','guifont'), + ('guifontset','guifontset'), + ('guifontwide','guifontwide'), + ('guiheadroom','guiheadroom'), + ('guioptions','guioptions'), + ('guipty','guipty'), + ('guitablabel','guitablabel'), + ('guitabtooltip','guitabtooltip'), + ('helpfile','helpfile'), + ('helpheight','helpheight'), + ('helplang','helplang'), + ('hf','hf'), + ('hh','hh'), + ('hi','hi'), + ('hid','hid'), + ('hidden','hidden'), + ('highlight','highlight'), + ('history','history'), + ('hk','hk'), + ('hkmap','hkmap'), + ('hkmapp','hkmapp'), + ('hkp','hkp'), + ('hl','hl'), + ('hlg','hlg'), + ('hls','hls'), + ('hlsearch','hlsearch'), + ('ic','ic'), + ('icon','icon'), + ('iconstring','iconstring'), + ('ignorecase','ignorecase'), + ('im','im'), + ('imactivatefunc','imactivatefunc'), + ('imactivatekey','imactivatekey'), + ('imaf','imaf'), + ('imak','imak'), + ('imc','imc'), + ('imcmdline','imcmdline'), + ('imd','imd'), + ('imdisable','imdisable'), + ('imi','imi'), + ('iminsert','iminsert'), + ('ims','ims'), + ('imsearch','imsearch'), + ('imsf','imsf'), + ('imstatusfunc','imstatusfunc'), + ('inc','inc'), + ('include','include'), + ('includeexpr','includeexpr'), + ('incsearch','incsearch'), + ('inde','inde'), + ('indentexpr','indentexpr'), + ('indentkeys','indentkeys'), + ('indk','indk'), + ('inex','inex'), + ('inf','inf'), + ('infercase','infercase'), + ('inoremap','inoremap'), + ('insertmode','insertmode'), + ('invacd','invacd'), + ('invai','invai'), + ('invakm','invakm'), + ('invallowrevins','invallowrevins'), + ('invaltkeymap','invaltkeymap'), + ('invanti','invanti'), + ('invantialias','invantialias'), + ('invar','invar'), + ('invarab','invarab'), + ('invarabic','invarabic'), + ('invarabicshape','invarabicshape'), + ('invari','invari'), + ('invarshape','invarshape'), + ('invautochdir','invautochdir'), + ('invautoindent','invautoindent'), + ('invautoread','invautoread'), + ('invautowrite','invautowrite'), + ('invautowriteall','invautowriteall'), + ('invaw','invaw'), + ('invawa','invawa'), + ('invbackup','invbackup'), + ('invballooneval','invballooneval'), + ('invbeval','invbeval'), + ('invbin','invbin'), + ('invbinary','invbinary'), + ('invbiosk','invbiosk'), + ('invbioskey','invbioskey'), + ('invbk','invbk'), + ('invbl','invbl'), + ('invbomb','invbomb'), + ('invbuflisted','invbuflisted'), + ('invcf','invcf'), + ('invci','invci'), + ('invcin','invcin'), + ('invcindent','invcindent'), + ('invcompatible','invcompatible'), + ('invconfirm','invconfirm'), + ('invconsk','invconsk'), + ('invconskey','invconskey'), + ('invcopyindent','invcopyindent'), + ('invcp','invcp'), + ('invcrb','invcrb'), + ('invcscoperelative','invcscoperelative'), + ('invcscopetag','invcscopetag'), + ('invcscopeverbose','invcscopeverbose'), + ('invcsre','invcsre'), + ('invcst','invcst'), + ('invcsverb','invcsverb'), + ('invcuc','invcuc'), + ('invcul','invcul'), + ('invcursorbind','invcursorbind'), + ('invcursorcolumn','invcursorcolumn'), + ('invcursorline','invcursorline'), + ('invdeco','invdeco'), + ('invdelcombine','invdelcombine'), + ('invdg','invdg'), + ('invdiff','invdiff'), + ('invdigraph','invdigraph'), + ('invea','invea'), + ('inveb','inveb'), + ('inved','inved'), + ('invedcompatible','invedcompatible'), + ('invek','invek'), + ('invendofline','invendofline'), + ('inveol','inveol'), + ('invequalalways','invequalalways'), + ('inverrorbells','inverrorbells'), + ('invesckeys','invesckeys'), + ('invet','invet'), + ('invex','invex'), + ('invexpandtab','invexpandtab'), + ('invexrc','invexrc'), + ('invfen','invfen'), + ('invfic','invfic'), + ('invfileignorecase','invfileignorecase'), + ('invfk','invfk'), + ('invfkmap','invfkmap'), + ('invfoldenable','invfoldenable'), + ('invgd','invgd'), + ('invgdefault','invgdefault'), + ('invguipty','invguipty'), + ('invhid','invhid'), + ('invhidden','invhidden'), + ('invhk','invhk'), + ('invhkmap','invhkmap'), + ('invhkmapp','invhkmapp'), + ('invhkp','invhkp'), + ('invhls','invhls'), + ('invhlsearch','invhlsearch'), + ('invic','invic'), + ('invicon','invicon'), + ('invignorecase','invignorecase'), + ('invim','invim'), + ('invimc','invimc'), + ('invimcmdline','invimcmdline'), + ('invimd','invimd'), + ('invimdisable','invimdisable'), + ('invincsearch','invincsearch'), + ('invinf','invinf'), + ('invinfercase','invinfercase'), + ('invinsertmode','invinsertmode'), + ('invis','invis'), + ('invjoinspaces','invjoinspaces'), + ('invjs','invjs'), + ('invlazyredraw','invlazyredraw'), + ('invlbr','invlbr'), + ('invlinebreak','invlinebreak'), + ('invlisp','invlisp'), + ('invlist','invlist'), + ('invloadplugins','invloadplugins'), + ('invlpl','invlpl'), + ('invlz','invlz'), + ('invma','invma'), + ('invmacatsui','invmacatsui'), + ('invmagic','invmagic'), + ('invmh','invmh'), + ('invml','invml'), + ('invmod','invmod'), + ('invmodeline','invmodeline'), + ('invmodifiable','invmodifiable'), + ('invmodified','invmodified'), + ('invmore','invmore'), + ('invmousef','invmousef'), + ('invmousefocus','invmousefocus'), + ('invmousehide','invmousehide'), + ('invnu','invnu'), + ('invnumber','invnumber'), + ('invodev','invodev'), + ('invopendevice','invopendevice'), + ('invpaste','invpaste'), + ('invpi','invpi'), + ('invpreserveindent','invpreserveindent'), + ('invpreviewwindow','invpreviewwindow'), + ('invprompt','invprompt'), + ('invpvw','invpvw'), + ('invreadonly','invreadonly'), + ('invrelativenumber','invrelativenumber'), + ('invremap','invremap'), + ('invrestorescreen','invrestorescreen'), + ('invrevins','invrevins'), + ('invri','invri'), + ('invrightleft','invrightleft'), + ('invrl','invrl'), + ('invrnu','invrnu'), + ('invro','invro'), + ('invrs','invrs'), + ('invru','invru'), + ('invruler','invruler'), + ('invsb','invsb'), + ('invsc','invsc'), + ('invscb','invscb'), + ('invscrollbind','invscrollbind'), + ('invscs','invscs'), + ('invsecure','invsecure'), + ('invsft','invsft'), + ('invshellslash','invshellslash'), + ('invshelltemp','invshelltemp'), + ('invshiftround','invshiftround'), + ('invshortname','invshortname'), + ('invshowcmd','invshowcmd'), + ('invshowfulltag','invshowfulltag'), + ('invshowmatch','invshowmatch'), + ('invshowmode','invshowmode'), + ('invsi','invsi'), + ('invsm','invsm'), + ('invsmartcase','invsmartcase'), + ('invsmartindent','invsmartindent'), + ('invsmarttab','invsmarttab'), + ('invsmd','invsmd'), + ('invsn','invsn'), + ('invsol','invsol'), + ('invspell','invspell'), + ('invsplitbelow','invsplitbelow'), + ('invsplitright','invsplitright'), + ('invspr','invspr'), + ('invsr','invsr'), + ('invssl','invssl'), + ('invsta','invsta'), + ('invstartofline','invstartofline'), + ('invstmp','invstmp'), + ('invswapfile','invswapfile'), + ('invswf','invswf'), + ('invta','invta'), + ('invtagbsearch','invtagbsearch'), + ('invtagrelative','invtagrelative'), + ('invtagstack','invtagstack'), + ('invtbi','invtbi'), + ('invtbidi','invtbidi'), + ('invtbs','invtbs'), + ('invtermbidi','invtermbidi'), + ('invterse','invterse'), + ('invtextauto','invtextauto'), + ('invtextmode','invtextmode'), + ('invtf','invtf'), + ('invtgst','invtgst'), + ('invtildeop','invtildeop'), + ('invtimeout','invtimeout'), + ('invtitle','invtitle'), + ('invto','invto'), + ('invtop','invtop'), + ('invtr','invtr'), + ('invttimeout','invttimeout'), + ('invttybuiltin','invttybuiltin'), + ('invttyfast','invttyfast'), + ('invtx','invtx'), + ('invudf','invudf'), + ('invundofile','invundofile'), + ('invvb','invvb'), + ('invvisualbell','invvisualbell'), + ('invwa','invwa'), + ('invwarn','invwarn'), + ('invwb','invwb'), + ('invweirdinvert','invweirdinvert'), + ('invwfh','invwfh'), + ('invwfw','invwfw'), + ('invwic','invwic'), + ('invwildignorecase','invwildignorecase'), + ('invwildmenu','invwildmenu'), + ('invwinfixheight','invwinfixheight'), + ('invwinfixwidth','invwinfixwidth'), + ('invwiv','invwiv'), + ('invwmnu','invwmnu'), + ('invwrap','invwrap'), + ('invwrapscan','invwrapscan'), + ('invwrite','invwrite'), + ('invwriteany','invwriteany'), + ('invwritebackup','invwritebackup'), + ('invws','invws'), + ('is','is'), + ('isf','isf'), + ('isfname','isfname'), + ('isi','isi'), + ('isident','isident'), + ('isk','isk'), + ('iskeyword','iskeyword'), + ('isp','isp'), + ('isprint','isprint'), + ('joinspaces','joinspaces'), + ('js','js'), + ('key','key'), + ('keymap','keymap'), + ('keymodel','keymodel'), + ('keywordprg','keywordprg'), + ('km','km'), + ('kmp','kmp'), + ('kp','kp'), + ('langmap','langmap'), + ('langmenu','langmenu'), + ('laststatus','laststatus'), + ('lazyredraw','lazyredraw'), + ('lbr','lbr'), + ('lcs','lcs'), + ('linebreak','linebreak'), + ('lines','lines'), + ('linespace','linespace'), + ('lisp','lisp'), + ('lispwords','lispwords'), + ('list','list'), + ('listchars','listchars'), + ('lm','lm'), + ('lmap','lmap'), + ('loadplugins','loadplugins'), + ('lpl','lpl'), + ('ls','ls'), + ('lsp','lsp'), + ('lw','lw'), + ('lz','lz'), + ('ma','ma'), + ('macatsui','macatsui'), + ('magic','magic'), + ('makeef','makeef'), + ('makeprg','makeprg'), + ('mat','mat'), + ('matchpairs','matchpairs'), + ('matchtime','matchtime'), + ('maxcombine','maxcombine'), + ('maxfuncdepth','maxfuncdepth'), + ('maxmapdepth','maxmapdepth'), + ('maxmem','maxmem'), + ('maxmempattern','maxmempattern'), + ('maxmemtot','maxmemtot'), + ('mco','mco'), + ('mef','mef'), + ('menuitems','menuitems'), + ('mfd','mfd'), + ('mh','mh'), + ('mis','mis'), + ('mkspellmem','mkspellmem'), + ('ml','ml'), + ('mls','mls'), + ('mm','mm'), + ('mmd','mmd'), + ('mmp','mmp'), + ('mmt','mmt'), + ('mod','mod'), + ('modeline','modeline'), + ('modelines','modelines'), + ('modifiable','modifiable'), + ('modified','modified'), + ('more','more'), + ('mouse','mouse'), + ('mousef','mousef'), + ('mousefocus','mousefocus'), + ('mousehide','mousehide'), + ('mousem','mousem'), + ('mousemodel','mousemodel'), + ('mouses','mouses'), + ('mouseshape','mouseshape'), + ('mouset','mouset'), + ('mousetime','mousetime'), + ('mp','mp'), + ('mps','mps'), + ('msm','msm'), + ('mzq','mzq'), + ('mzquantum','mzquantum'), + ('nf','nf'), + ('nnoremap','nnoremap'), + ('noacd','noacd'), + ('noai','noai'), + ('noakm','noakm'), + ('noallowrevins','noallowrevins'), + ('noaltkeymap','noaltkeymap'), + ('noanti','noanti'), + ('noantialias','noantialias'), + ('noar','noar'), + ('noarab','noarab'), + ('noarabic','noarabic'), + ('noarabicshape','noarabicshape'), + ('noari','noari'), + ('noarshape','noarshape'), + ('noautochdir','noautochdir'), + ('noautoindent','noautoindent'), + ('noautoread','noautoread'), + ('noautowrite','noautowrite'), + ('noautowriteall','noautowriteall'), + ('noaw','noaw'), + ('noawa','noawa'), + ('nobackup','nobackup'), + ('noballooneval','noballooneval'), + ('nobeval','nobeval'), + ('nobin','nobin'), + ('nobinary','nobinary'), + ('nobiosk','nobiosk'), + ('nobioskey','nobioskey'), + ('nobk','nobk'), + ('nobl','nobl'), + ('nobomb','nobomb'), + ('nobuflisted','nobuflisted'), + ('nocf','nocf'), + ('noci','noci'), + ('nocin','nocin'), + ('nocindent','nocindent'), + ('nocompatible','nocompatible'), + ('noconfirm','noconfirm'), + ('noconsk','noconsk'), + ('noconskey','noconskey'), + ('nocopyindent','nocopyindent'), + ('nocp','nocp'), + ('nocrb','nocrb'), + ('nocscoperelative','nocscoperelative'), + ('nocscopetag','nocscopetag'), + ('nocscopeverbose','nocscopeverbose'), + ('nocsre','nocsre'), + ('nocst','nocst'), + ('nocsverb','nocsverb'), + ('nocuc','nocuc'), + ('nocul','nocul'), + ('nocursorbind','nocursorbind'), + ('nocursorcolumn','nocursorcolumn'), + ('nocursorline','nocursorline'), + ('nodeco','nodeco'), + ('nodelcombine','nodelcombine'), + ('nodg','nodg'), + ('nodiff','nodiff'), + ('nodigraph','nodigraph'), + ('noea','noea'), + ('noeb','noeb'), + ('noed','noed'), + ('noedcompatible','noedcompatible'), + ('noek','noek'), + ('noendofline','noendofline'), + ('noeol','noeol'), + ('noequalalways','noequalalways'), + ('noerrorbells','noerrorbells'), + ('noesckeys','noesckeys'), + ('noet','noet'), + ('noex','noex'), + ('noexpandtab','noexpandtab'), + ('noexrc','noexrc'), + ('nofen','nofen'), + ('nofic','nofic'), + ('nofileignorecase','nofileignorecase'), + ('nofk','nofk'), + ('nofkmap','nofkmap'), + ('nofoldenable','nofoldenable'), + ('nogd','nogd'), + ('nogdefault','nogdefault'), + ('noguipty','noguipty'), + ('nohid','nohid'), + ('nohidden','nohidden'), + ('nohk','nohk'), + ('nohkmap','nohkmap'), + ('nohkmapp','nohkmapp'), + ('nohkp','nohkp'), + ('nohls','nohls'), + ('nohlsearch','nohlsearch'), + ('noic','noic'), + ('noicon','noicon'), + ('noignorecase','noignorecase'), + ('noim','noim'), + ('noimc','noimc'), + ('noimcmdline','noimcmdline'), + ('noimd','noimd'), + ('noimdisable','noimdisable'), + ('noincsearch','noincsearch'), + ('noinf','noinf'), + ('noinfercase','noinfercase'), + ('noinsertmode','noinsertmode'), + ('nois','nois'), + ('nojoinspaces','nojoinspaces'), + ('nojs','nojs'), + ('nolazyredraw','nolazyredraw'), + ('nolbr','nolbr'), + ('nolinebreak','nolinebreak'), + ('nolisp','nolisp'), + ('nolist','nolist'), + ('noloadplugins','noloadplugins'), + ('nolpl','nolpl'), + ('nolz','nolz'), + ('noma','noma'), + ('nomacatsui','nomacatsui'), + ('nomagic','nomagic'), + ('nomh','nomh'), + ('noml','noml'), + ('nomod','nomod'), + ('nomodeline','nomodeline'), + ('nomodifiable','nomodifiable'), + ('nomodified','nomodified'), + ('nomore','nomore'), + ('nomousef','nomousef'), + ('nomousefocus','nomousefocus'), + ('nomousehide','nomousehide'), + ('nonu','nonu'), + ('nonumber','nonumber'), + ('noodev','noodev'), + ('noopendevice','noopendevice'), + ('nopaste','nopaste'), + ('nopi','nopi'), + ('nopreserveindent','nopreserveindent'), + ('nopreviewwindow','nopreviewwindow'), + ('noprompt','noprompt'), + ('nopvw','nopvw'), + ('noreadonly','noreadonly'), + ('norelativenumber','norelativenumber'), + ('noremap','noremap'), + ('norestorescreen','norestorescreen'), + ('norevins','norevins'), + ('nori','nori'), + ('norightleft','norightleft'), + ('norl','norl'), + ('nornu','nornu'), + ('noro','noro'), + ('nors','nors'), + ('noru','noru'), + ('noruler','noruler'), + ('nosb','nosb'), + ('nosc','nosc'), + ('noscb','noscb'), + ('noscrollbind','noscrollbind'), + ('noscs','noscs'), + ('nosecure','nosecure'), + ('nosft','nosft'), + ('noshellslash','noshellslash'), + ('noshelltemp','noshelltemp'), + ('noshiftround','noshiftround'), + ('noshortname','noshortname'), + ('noshowcmd','noshowcmd'), + ('noshowfulltag','noshowfulltag'), + ('noshowmatch','noshowmatch'), + ('noshowmode','noshowmode'), + ('nosi','nosi'), + ('nosm','nosm'), + ('nosmartcase','nosmartcase'), + ('nosmartindent','nosmartindent'), + ('nosmarttab','nosmarttab'), + ('nosmd','nosmd'), + ('nosn','nosn'), + ('nosol','nosol'), + ('nospell','nospell'), + ('nosplitbelow','nosplitbelow'), + ('nosplitright','nosplitright'), + ('nospr','nospr'), + ('nosr','nosr'), + ('nossl','nossl'), + ('nosta','nosta'), + ('nostartofline','nostartofline'), + ('nostmp','nostmp'), + ('noswapfile','noswapfile'), + ('noswf','noswf'), + ('nota','nota'), + ('notagbsearch','notagbsearch'), + ('notagrelative','notagrelative'), + ('notagstack','notagstack'), + ('notbi','notbi'), + ('notbidi','notbidi'), + ('notbs','notbs'), + ('notermbidi','notermbidi'), + ('noterse','noterse'), + ('notextauto','notextauto'), + ('notextmode','notextmode'), + ('notf','notf'), + ('notgst','notgst'), + ('notildeop','notildeop'), + ('notimeout','notimeout'), + ('notitle','notitle'), + ('noto','noto'), + ('notop','notop'), + ('notr','notr'), + ('nottimeout','nottimeout'), + ('nottybuiltin','nottybuiltin'), + ('nottyfast','nottyfast'), + ('notx','notx'), + ('noudf','noudf'), + ('noundofile','noundofile'), + ('novb','novb'), + ('novisualbell','novisualbell'), + ('nowa','nowa'), + ('nowarn','nowarn'), + ('nowb','nowb'), + ('noweirdinvert','noweirdinvert'), + ('nowfh','nowfh'), + ('nowfw','nowfw'), + ('nowic','nowic'), + ('nowildignorecase','nowildignorecase'), + ('nowildmenu','nowildmenu'), + ('nowinfixheight','nowinfixheight'), + ('nowinfixwidth','nowinfixwidth'), + ('nowiv','nowiv'), + ('nowmnu','nowmnu'), + ('nowrap','nowrap'), + ('nowrapscan','nowrapscan'), + ('nowrite','nowrite'), + ('nowriteany','nowriteany'), + ('nowritebackup','nowritebackup'), + ('nows','nows'), + ('nrformats','nrformats'), + ('nu','nu'), + ('number','number'), + ('numberwidth','numberwidth'), + ('nuw','nuw'), + ('odev','odev'), + ('oft','oft'), + ('ofu','ofu'), + ('omnifunc','omnifunc'), + ('opendevice','opendevice'), + ('operatorfunc','operatorfunc'), + ('opfunc','opfunc'), + ('osfiletype','osfiletype'), + ('pa','pa'), + ('para','para'), + ('paragraphs','paragraphs'), + ('paste','paste'), + ('pastetoggle','pastetoggle'), + ('patchexpr','patchexpr'), + ('patchmode','patchmode'), + ('path','path'), + ('pdev','pdev'), + ('penc','penc'), + ('pex','pex'), + ('pexpr','pexpr'), + ('pfn','pfn'), + ('ph','ph'), + ('pheader','pheader'), + ('pi','pi'), + ('pm','pm'), + ('pmbcs','pmbcs'), + ('pmbfn','pmbfn'), + ('popt','popt'), + ('preserveindent','preserveindent'), + ('previewheight','previewheight'), + ('previewwindow','previewwindow'), + ('printdevice','printdevice'), + ('printencoding','printencoding'), + ('printexpr','printexpr'), + ('printfont','printfont'), + ('printheader','printheader'), + ('printmbcharset','printmbcharset'), + ('printmbfont','printmbfont'), + ('printoptions','printoptions'), + ('prompt','prompt'), + ('pt','pt'), + ('pumheight','pumheight'), + ('pvh','pvh'), + ('pvw','pvw'), + ('qe','qe'), + ('quoteescape','quoteescape'), + ('rdt','rdt'), + ('re','re'), + ('readonly','readonly'), + ('redrawtime','redrawtime'), + ('regexpengine','regexpengine'), + ('relativenumber','relativenumber'), + ('remap','remap'), + ('report','report'), + ('restorescreen','restorescreen'), + ('revins','revins'), + ('ri','ri'), + ('rightleft','rightleft'), + ('rightleftcmd','rightleftcmd'), + ('rl','rl'), + ('rlc','rlc'), + ('rnu','rnu'), + ('ro','ro'), + ('rs','rs'), + ('rtp','rtp'), + ('ru','ru'), + ('ruf','ruf'), + ('ruler','ruler'), + ('rulerformat','rulerformat'), + ('runtimepath','runtimepath'), + ('sb','sb'), + ('sbo','sbo'), + ('sbr','sbr'), + ('sc','sc'), + ('scb','scb'), + ('scr','scr'), + ('scroll','scroll'), + ('scrollbind','scrollbind'), + ('scrolljump','scrolljump'), + ('scrolloff','scrolloff'), + ('scrollopt','scrollopt'), + ('scs','scs'), + ('sect','sect'), + ('sections','sections'), + ('secure','secure'), + ('sel','sel'), + ('selection','selection'), + ('selectmode','selectmode'), + ('sessionoptions','sessionoptions'), + ('sft','sft'), + ('sh','sh'), + ('shcf','shcf'), + ('shell','shell'), + ('shellcmdflag','shellcmdflag'), + ('shellpipe','shellpipe'), + ('shellquote','shellquote'), + ('shellredir','shellredir'), + ('shellslash','shellslash'), + ('shelltemp','shelltemp'), + ('shelltype','shelltype'), + ('shellxescape','shellxescape'), + ('shellxquote','shellxquote'), + ('shiftround','shiftround'), + ('shiftwidth','shiftwidth'), + ('shm','shm'), + ('shortmess','shortmess'), + ('shortname','shortname'), + ('showbreak','showbreak'), + ('showcmd','showcmd'), + ('showfulltag','showfulltag'), + ('showmatch','showmatch'), + ('showmode','showmode'), + ('showtabline','showtabline'), + ('shq','shq'), + ('si','si'), + ('sidescroll','sidescroll'), + ('sidescrolloff','sidescrolloff'), + ('siso','siso'), + ('sj','sj'), + ('slm','slm'), + ('sm','sm'), + ('smartcase','smartcase'), + ('smartindent','smartindent'), + ('smarttab','smarttab'), + ('smc','smc'), + ('smd','smd'), + ('sn','sn'), + ('so','so'), + ('softtabstop','softtabstop'), + ('sol','sol'), + ('sp','sp'), + ('spc','spc'), + ('spell','spell'), + ('spellcapcheck','spellcapcheck'), + ('spellfile','spellfile'), + ('spelllang','spelllang'), + ('spellsuggest','spellsuggest'), + ('spf','spf'), + ('spl','spl'), + ('splitbelow','splitbelow'), + ('splitright','splitright'), + ('spr','spr'), + ('sps','sps'), + ('sr','sr'), + ('srr','srr'), + ('ss','ss'), + ('ssl','ssl'), + ('ssop','ssop'), + ('st','st'), + ('sta','sta'), + ('stal','stal'), + ('startofline','startofline'), + ('statusline','statusline'), + ('stl','stl'), + ('stmp','stmp'), + ('sts','sts'), + ('su','su'), + ('sua','sua'), + ('suffixes','suffixes'), + ('suffixesadd','suffixesadd'), + ('sw','sw'), + ('swapfile','swapfile'), + ('swapsync','swapsync'), + ('swb','swb'), + ('swf','swf'), + ('switchbuf','switchbuf'), + ('sws','sws'), + ('sxe','sxe'), + ('sxq','sxq'), + ('syn','syn'), + ('synmaxcol','synmaxcol'), + ('syntax','syntax'), + ('t_AB','t_AB'), + ('t_AF','t_AF'), + ('t_AL','t_AL'), + ('t_CS','t_CS'), + ('t_CV','t_CV'), + ('t_Ce','t_Ce'), + ('t_Co','t_Co'), + ('t_Cs','t_Cs'), + ('t_DL','t_DL'), + ('t_EI','t_EI'), + ('t_F1','t_F1'), + ('t_F2','t_F2'), + ('t_F3','t_F3'), + ('t_F4','t_F4'), + ('t_F5','t_F5'), + ('t_F6','t_F6'), + ('t_F7','t_F7'), + ('t_F8','t_F8'), + ('t_F9','t_F9'), + ('t_IE','t_IE'), + ('t_IS','t_IS'), + ('t_K1','t_K1'), + ('t_K3','t_K3'), + ('t_K4','t_K4'), + ('t_K5','t_K5'), + ('t_K6','t_K6'), + ('t_K7','t_K7'), + ('t_K8','t_K8'), + ('t_K9','t_K9'), + ('t_KA','t_KA'), + ('t_KB','t_KB'), + ('t_KC','t_KC'), + ('t_KD','t_KD'), + ('t_KE','t_KE'), + ('t_KF','t_KF'), + ('t_KG','t_KG'), + ('t_KH','t_KH'), + ('t_KI','t_KI'), + ('t_KJ','t_KJ'), + ('t_KK','t_KK'), + ('t_KL','t_KL'), + ('t_RI','t_RI'), + ('t_RV','t_RV'), + ('t_SI','t_SI'), + ('t_Sb','t_Sb'), + ('t_Sf','t_Sf'), + ('t_WP','t_WP'), + ('t_WS','t_WS'), + ('t_ZH','t_ZH'), + ('t_ZR','t_ZR'), + ('t_al','t_al'), + ('t_bc','t_bc'), + ('t_cd','t_cd'), + ('t_ce','t_ce'), + ('t_cl','t_cl'), + ('t_cm','t_cm'), + ('t_cs','t_cs'), + ('t_da','t_da'), + ('t_db','t_db'), + ('t_dl','t_dl'), + ('t_fs','t_fs'), + ('t_k1','t_k1'), + ('t_k2','t_k2'), + ('t_k3','t_k3'), + ('t_k4','t_k4'), + ('t_k5','t_k5'), + ('t_k6','t_k6'), + ('t_k7','t_k7'), + ('t_k8','t_k8'), + ('t_k9','t_k9'), + ('t_kB','t_kB'), + ('t_kD','t_kD'), + ('t_kI','t_kI'), + ('t_kN','t_kN'), + ('t_kP','t_kP'), + ('t_kb','t_kb'), + ('t_kd','t_kd'), + ('t_ke','t_ke'), + ('t_kh','t_kh'), + ('t_kl','t_kl'), + ('t_kr','t_kr'), + ('t_ks','t_ks'), + ('t_ku','t_ku'), + ('t_le','t_le'), + ('t_mb','t_mb'), + ('t_md','t_md'), + ('t_me','t_me'), + ('t_mr','t_mr'), + ('t_ms','t_ms'), + ('t_nd','t_nd'), + ('t_op','t_op'), + ('t_se','t_se'), + ('t_so','t_so'), + ('t_sr','t_sr'), + ('t_te','t_te'), + ('t_ti','t_ti'), + ('t_ts','t_ts'), + ('t_u7','t_u7'), + ('t_ue','t_ue'), + ('t_us','t_us'), + ('t_ut','t_ut'), + ('t_vb','t_vb'), + ('t_ve','t_ve'), + ('t_vi','t_vi'), + ('t_vs','t_vs'), + ('t_xs','t_xs'), + ('ta','ta'), + ('tabline','tabline'), + ('tabpagemax','tabpagemax'), + ('tabstop','tabstop'), + ('tag','tag'), + ('tagbsearch','tagbsearch'), + ('taglength','taglength'), + ('tagrelative','tagrelative'), + ('tags','tags'), + ('tagstack','tagstack'), + ('tal','tal'), + ('tb','tb'), + ('tbi','tbi'), + ('tbidi','tbidi'), + ('tbis','tbis'), + ('tbs','tbs'), + ('tenc','tenc'), + ('term','term'), + ('termbidi','termbidi'), + ('termencoding','termencoding'), + ('terse','terse'), + ('textauto','textauto'), + ('textmode','textmode'), + ('textwidth','textwidth'), + ('tf','tf'), + ('tgst','tgst'), + ('thesaurus','thesaurus'), + ('tildeop','tildeop'), + ('timeout','timeout'), + ('timeoutlen','timeoutlen'), + ('title','title'), + ('titlelen','titlelen'), + ('titleold','titleold'), + ('titlestring','titlestring'), + ('tl','tl'), + ('tm','tm'), + ('to','to'), + ('toolbar','toolbar'), + ('toolbariconsize','toolbariconsize'), + ('top','top'), + ('tpm','tpm'), + ('tr','tr'), + ('ts','ts'), + ('tsl','tsl'), + ('tsr','tsr'), + ('ttimeout','ttimeout'), + ('ttimeoutlen','ttimeoutlen'), + ('ttm','ttm'), + ('tty','tty'), + ('ttybuiltin','ttybuiltin'), + ('ttyfast','ttyfast'), + ('ttym','ttym'), + ('ttymouse','ttymouse'), + ('ttyscroll','ttyscroll'), + ('ttytype','ttytype'), + ('tw','tw'), + ('tx','tx'), + ('uc','uc'), + ('udf','udf'), + ('udir','udir'), + ('ul','ul'), + ('undodir','undodir'), + ('undofile','undofile'), + ('undolevels','undolevels'), + ('undoreload','undoreload'), + ('updatecount','updatecount'), + ('updatetime','updatetime'), + ('ur','ur'), + ('ut','ut'), + ('vb','vb'), + ('vbs','vbs'), + ('vdir','vdir'), + ('ve','ve'), + ('verbose','verbose'), + ('verbosefile','verbosefile'), + ('vfile','vfile'), + ('vi','vi'), + ('viewdir','viewdir'), + ('viewoptions','viewoptions'), + ('viminfo','viminfo'), + ('virtualedit','virtualedit'), + ('visualbell','visualbell'), + ('vnoremap','vnoremap'), + ('vop','vop'), + ('wa','wa'), + ('wak','wak'), + ('warn','warn'), + ('wb','wb'), + ('wc','wc'), + ('wcm','wcm'), + ('wd','wd'), + ('weirdinvert','weirdinvert'), + ('wfh','wfh'), + ('wfw','wfw'), + ('wh','wh'), + ('whichwrap','whichwrap'), + ('wi','wi'), + ('wic','wic'), + ('wig','wig'), + ('wildchar','wildchar'), + ('wildcharm','wildcharm'), + ('wildignore','wildignore'), + ('wildignorecase','wildignorecase'), + ('wildmenu','wildmenu'), + ('wildmode','wildmode'), + ('wildoptions','wildoptions'), + ('wim','wim'), + ('winaltkeys','winaltkeys'), + ('window','window'), + ('winfixheight','winfixheight'), + ('winfixwidth','winfixwidth'), + ('winheight','winheight'), + ('winminheight','winminheight'), + ('winminwidth','winminwidth'), + ('winwidth','winwidth'), + ('wiv','wiv'), + ('wiw','wiw'), + ('wm','wm'), + ('wmh','wmh'), + ('wmnu','wmnu'), + ('wmw','wmw'), + ('wop','wop'), + ('wrap','wrap'), + ('wrapmargin','wrapmargin'), + ('wrapscan','wrapscan'), + ('write','write'), + ('writeany','writeany'), + ('writebackup','writebackup'), + ('writedelay','writedelay'), + ('ws','ws'), + ('ww','ww'), + ) + return var +option = _getoption() + diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__init__.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5d45d8b237ddffb31fe12931a3b35c7e52c13561 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__init__.py @@ -0,0 +1,61 @@ +""" + pygments.styles + ~~~~~~~~~~~~~~~ + + Contains built-in styles. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.plugin import find_plugin_styles +from pygments.util import ClassNotFound +from pygments.styles._mapping import STYLES + +#: A dictionary of built-in styles, mapping style names to +#: ``'submodule::classname'`` strings. +#: This list is deprecated. Use `pygments.styles.STYLES` instead +STYLE_MAP = {v[1]: v[0].split('.')[-1] + '::' + k for k, v in STYLES.items()} + +#: Internal reverse mapping to make `get_style_by_name` more efficient +_STYLE_NAME_TO_MODULE_MAP = {v[1]: (v[0], k) for k, v in STYLES.items()} + + +def get_style_by_name(name): + """ + Return a style class by its short name. The names of the builtin styles + are listed in :data:`pygments.styles.STYLE_MAP`. + + Will raise :exc:`pygments.util.ClassNotFound` if no style of that name is + found. + """ + if name in _STYLE_NAME_TO_MODULE_MAP: + mod, cls = _STYLE_NAME_TO_MODULE_MAP[name] + builtin = "yes" + else: + for found_name, style in find_plugin_styles(): + if name == found_name: + return style + # perhaps it got dropped into our styles package + builtin = "" + mod = 'pygments.styles.' + name + cls = name.title() + "Style" + + try: + mod = __import__(mod, None, None, [cls]) + except ImportError: + raise ClassNotFound(f"Could not find style module {mod!r}" + + (builtin and ", though it should be builtin") + + ".") + try: + return getattr(mod, cls) + except AttributeError: + raise ClassNotFound(f"Could not find style class {cls!r} in style module.") + + +def get_all_styles(): + """Return a generator for all styles by name, both builtin and plugin.""" + for v in STYLES.values(): + yield v[1] + for name, _ in find_plugin_styles(): + yield name diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/__init__.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e1a9f17d48f188152acb26ca1da086148fe3cf0e Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/__init__.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/_mapping.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/_mapping.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2abb98a9fd32514f398d4cd0eab791e24a4e5f89 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/_mapping.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/abap.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/abap.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a264544641bcff6bb4f3f3cfde9bbdd55f93eadc Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/abap.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/algol.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/algol.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3c22d4afb046be4845ce7a6b64ddf284f310c680 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/algol.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/algol_nu.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/algol_nu.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a09c6aa12892e38be6c12397531c31fd543b35a2 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/algol_nu.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/arduino.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/arduino.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2e76e2fff3de66e5b58a9318b7f63b4f1b38af7c Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/arduino.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/autumn.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/autumn.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..17e4b4fea4752fb490c945ec24cc4190b0531f4d Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/autumn.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/borland.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/borland.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9f11d8b9416029d8b34622d8090fedac96d84a24 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/borland.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/bw.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/bw.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..047b0a307874ef3ffbb6ffb840ed035a68fea22e Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/bw.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/coffee.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/coffee.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f8bd9d0dd976f39c884b2930a2dace7259650447 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/coffee.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/colorful.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/colorful.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..69c853c10d5035c22d6499236b2d870fec15afb5 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/colorful.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/default.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/default.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e002e0554a23ac2db20a5f76286f5637fc86e225 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/default.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/dracula.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/dracula.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1fcdba3e2b0011b06816d99b50c1c0aeaa5f1b41 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/dracula.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/emacs.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/emacs.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..096c3c9f08931a834d829c90c264495692f84e17 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/emacs.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/friendly.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/friendly.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b2e2f5244530c957bd5f64de7049e6418ee66bb6 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/friendly.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/friendly_grayscale.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/friendly_grayscale.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..023cc63727921fc89aa045d8963512afe7a89147 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/friendly_grayscale.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/fruity.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/fruity.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bb8fd268e4be64f335cb23c86d598e67bb7ab631 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/fruity.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/gh_dark.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/gh_dark.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d114caa6a6fb5ce7225fb8acfdc19619e156608e Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/gh_dark.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/gruvbox.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/gruvbox.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b0f61bfc74ac802b87a49a3dabcd881a10516a21 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/gruvbox.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/igor.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/igor.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..44d07ae38363fa4e711590b8ae39d6bd71706b3f Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/igor.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/inkpot.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/inkpot.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3d99dfcff7a4707b0af79ecba763ae3ab80ff0eb Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/inkpot.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/lightbulb.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/lightbulb.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3c92018be69c1071401f311d2470062220768b8d Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/lightbulb.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/lilypond.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/lilypond.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c669f3f0215f22217543f0e07d54cda266129546 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/lilypond.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/lovelace.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/lovelace.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b664dafb6a7345d15e28e8d75a252f556ccc368a Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/lovelace.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/manni.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/manni.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8d808ad1c8806c6781c521d185096ecb16e52a05 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/manni.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/material.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/material.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8cb706e606460e575c506bae61eb21d66a30cd9d Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/material.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/monokai.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/monokai.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3e6713524d2b0b8964d4a978349bd5cdeb2bc403 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/monokai.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/murphy.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/murphy.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a17846686256b16f580c8585b4b19463d799e040 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/murphy.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/native.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/native.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e5a48a1aea8ba9a6bcab6b42fc424f610f13e95d Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/native.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/nord.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/nord.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6181c14d93fc0fe24384d3ac1ef9162f115a75c4 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/nord.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/onedark.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/onedark.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..11030e6ce5a1e2ba596640332b860fc9f4065703 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/onedark.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/paraiso_dark.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/paraiso_dark.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..81025144a23def607e0730e3dac478ee9452bbd5 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/paraiso_dark.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/paraiso_light.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/paraiso_light.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4d29e34a8e022570a82d1d8d5a144576d102014a Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/paraiso_light.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/pastie.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/pastie.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e2db06411447a933ffba6cb191e5c024fb04bf52 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/pastie.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/perldoc.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/perldoc.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ff418f7238c60de7b3a4f6793c9fed887edb3e27 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/perldoc.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/rainbow_dash.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/rainbow_dash.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..33ee4b0e4f94bf101252e2556b161cd0de7160a8 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/rainbow_dash.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/rrt.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/rrt.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1e0dde95e0bc1cce4ef08e8d638cc9c0db12db5a Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/rrt.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/sas.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/sas.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ceee1f982b530f56bf356465b82cd41e42d6c188 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/sas.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/solarized.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/solarized.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c7af4a21b8cb9148d2c2b2f7bbe73aa5999b5d23 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/solarized.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/staroffice.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/staroffice.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3a729b5050d30c376be20d8c6bca3ba9e12ba7b2 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/staroffice.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/stata_dark.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/stata_dark.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..523801baa5ef5f9c7a589193909b33ebdbd3b533 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/stata_dark.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/stata_light.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/stata_light.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..45c4de2753b381694b2a36f8464541e78530fd51 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/stata_light.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/tango.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/tango.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1ba3df24b7999a1c50e02c7fae14eb7404627ef8 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/tango.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/trac.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/trac.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..55b9fa43b382afc1b28518b446b93a254cf84aa7 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/trac.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/vim.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/vim.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4dc88528fc20870ef56abae9a23303bbdcc9d17c Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/vim.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/vs.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/vs.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..87c3167dd050e278944208ab8b0150fda094c89c Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/vs.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/xcode.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/xcode.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..944644460c7ed49a9d0fa7fae7a7c562caf1ed8b Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/xcode.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/zenburn.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/zenburn.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..70ac4c02aa9858caf0eeff3fe7d8d1f5c26bf447 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/__pycache__/zenburn.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/_mapping.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/_mapping.py new file mode 100644 index 0000000000000000000000000000000000000000..49a7fae92dc4d9ed6bcdb735f346b79c476f49ad --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/_mapping.py @@ -0,0 +1,54 @@ +# Automatically generated by scripts/gen_mapfiles.py. +# DO NOT EDIT BY HAND; run `tox -e mapfiles` instead. + +STYLES = { + 'AbapStyle': ('pygments.styles.abap', 'abap', ()), + 'AlgolStyle': ('pygments.styles.algol', 'algol', ()), + 'Algol_NuStyle': ('pygments.styles.algol_nu', 'algol_nu', ()), + 'ArduinoStyle': ('pygments.styles.arduino', 'arduino', ()), + 'AutumnStyle': ('pygments.styles.autumn', 'autumn', ()), + 'BlackWhiteStyle': ('pygments.styles.bw', 'bw', ()), + 'BorlandStyle': ('pygments.styles.borland', 'borland', ()), + 'CoffeeStyle': ('pygments.styles.coffee', 'coffee', ()), + 'ColorfulStyle': ('pygments.styles.colorful', 'colorful', ()), + 'DefaultStyle': ('pygments.styles.default', 'default', ()), + 'DraculaStyle': ('pygments.styles.dracula', 'dracula', ()), + 'EmacsStyle': ('pygments.styles.emacs', 'emacs', ()), + 'FriendlyGrayscaleStyle': ('pygments.styles.friendly_grayscale', 'friendly_grayscale', ()), + 'FriendlyStyle': ('pygments.styles.friendly', 'friendly', ()), + 'FruityStyle': ('pygments.styles.fruity', 'fruity', ()), + 'GhDarkStyle': ('pygments.styles.gh_dark', 'github-dark', ()), + 'GruvboxDarkStyle': ('pygments.styles.gruvbox', 'gruvbox-dark', ()), + 'GruvboxLightStyle': ('pygments.styles.gruvbox', 'gruvbox-light', ()), + 'IgorStyle': ('pygments.styles.igor', 'igor', ()), + 'InkPotStyle': ('pygments.styles.inkpot', 'inkpot', ()), + 'LightbulbStyle': ('pygments.styles.lightbulb', 'lightbulb', ()), + 'LilyPondStyle': ('pygments.styles.lilypond', 'lilypond', ()), + 'LovelaceStyle': ('pygments.styles.lovelace', 'lovelace', ()), + 'ManniStyle': ('pygments.styles.manni', 'manni', ()), + 'MaterialStyle': ('pygments.styles.material', 'material', ()), + 'MonokaiStyle': ('pygments.styles.monokai', 'monokai', ()), + 'MurphyStyle': ('pygments.styles.murphy', 'murphy', ()), + 'NativeStyle': ('pygments.styles.native', 'native', ()), + 'NordDarkerStyle': ('pygments.styles.nord', 'nord-darker', ()), + 'NordStyle': ('pygments.styles.nord', 'nord', ()), + 'OneDarkStyle': ('pygments.styles.onedark', 'one-dark', ()), + 'ParaisoDarkStyle': ('pygments.styles.paraiso_dark', 'paraiso-dark', ()), + 'ParaisoLightStyle': ('pygments.styles.paraiso_light', 'paraiso-light', ()), + 'PastieStyle': ('pygments.styles.pastie', 'pastie', ()), + 'PerldocStyle': ('pygments.styles.perldoc', 'perldoc', ()), + 'RainbowDashStyle': ('pygments.styles.rainbow_dash', 'rainbow_dash', ()), + 'RrtStyle': ('pygments.styles.rrt', 'rrt', ()), + 'SasStyle': ('pygments.styles.sas', 'sas', ()), + 'SolarizedDarkStyle': ('pygments.styles.solarized', 'solarized-dark', ()), + 'SolarizedLightStyle': ('pygments.styles.solarized', 'solarized-light', ()), + 'StarofficeStyle': ('pygments.styles.staroffice', 'staroffice', ()), + 'StataDarkStyle': ('pygments.styles.stata_dark', 'stata-dark', ()), + 'StataLightStyle': ('pygments.styles.stata_light', 'stata-light', ()), + 'TangoStyle': ('pygments.styles.tango', 'tango', ()), + 'TracStyle': ('pygments.styles.trac', 'trac', ()), + 'VimStyle': ('pygments.styles.vim', 'vim', ()), + 'VisualStudioStyle': ('pygments.styles.vs', 'vs', ()), + 'XcodeStyle': ('pygments.styles.xcode', 'xcode', ()), + 'ZenburnStyle': ('pygments.styles.zenburn', 'zenburn', ()), +} diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/abap.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/abap.py new file mode 100644 index 0000000000000000000000000000000000000000..584a4e6496349beaf4a3d42ac34e97945d38f649 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/abap.py @@ -0,0 +1,32 @@ +""" + pygments.styles.abap + ~~~~~~~~~~~~~~~~~~~~ + + ABAP workbench like style. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, \ + Number, Operator + + +__all__ = ['AbapStyle'] + + +class AbapStyle(Style): + name = 'abap' + + styles = { + Comment: 'italic #888', + Comment.Special: '#888', + Keyword: '#00f', + Operator.Word: '#00f', + Name: '#000', + Number: '#3af', + String: '#5a2', + + Error: '#F00', + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/algol.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/algol.py new file mode 100644 index 0000000000000000000000000000000000000000..86cafce232ce285b4998dc1323fc5e67f0443ff0 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/algol.py @@ -0,0 +1,65 @@ +""" + pygments.styles.algol + ~~~~~~~~~~~~~~~~~~~~~ + + Algol publication style. + + This style renders source code for publication of algorithms in + scientific papers and academic texts, where its format is frequently used. + + It is based on the style of the revised Algol-60 language report[1]. + + o No colours, only black, white and shades of grey are used. + o Keywords are rendered in lowercase underline boldface. + o Builtins are rendered in lowercase boldface italic. + o Docstrings and pragmas are rendered in dark grey boldface. + o Library identifiers are rendered in dark grey boldface italic. + o Comments are rendered in grey italic. + + To render keywords without underlining, refer to the `Algol_Nu` style. + + For lowercase conversion of keywords and builtins in languages where + these are not or might not be lowercase, a supporting lexer is required. + The Algol and Modula-2 lexers automatically convert to lowercase whenever + this style is selected. + + [1] `Revised Report on the Algorithmic Language Algol-60 ` + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, Operator + + +__all__ = ['AlgolStyle'] + + +class AlgolStyle(Style): + name = 'algol' + + background_color = "#ffffff" + + styles = { + Comment: "italic #888", + Comment.Preproc: "bold noitalic #888", + Comment.Special: "bold noitalic #888", + + Keyword: "underline bold", + Keyword.Declaration: "italic", + + Name.Builtin: "bold italic", + Name.Builtin.Pseudo: "bold italic", + Name.Namespace: "bold italic #666", + Name.Class: "bold italic #666", + Name.Function: "bold italic #666", + Name.Variable: "bold italic #666", + Name.Constant: "bold italic #666", + + Operator.Word: "bold", + + String: "italic #666", + + Error: "border:#FF0000" + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/algol_nu.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/algol_nu.py new file mode 100644 index 0000000000000000000000000000000000000000..d28da8f1bc17b70979bb9c8fce8b0bd254605624 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/algol_nu.py @@ -0,0 +1,65 @@ +""" + pygments.styles.algol_nu + ~~~~~~~~~~~~~~~~~~~~~~~~ + + Algol publication style without underlining of keywords. + + This style renders source code for publication of algorithms in + scientific papers and academic texts, where its format is frequently used. + + It is based on the style of the revised Algol-60 language report[1]. + + o No colours, only black, white and shades of grey are used. + o Keywords are rendered in lowercase boldface. + o Builtins are rendered in lowercase boldface italic. + o Docstrings and pragmas are rendered in dark grey boldface. + o Library identifiers are rendered in dark grey boldface italic. + o Comments are rendered in grey italic. + + To render keywords with underlining, refer to the `Algol` style. + + For lowercase conversion of keywords and builtins in languages where + these are not or might not be lowercase, a supporting lexer is required. + The Algol and Modula-2 lexers automatically convert to lowercase whenever + this style is selected. + + [1] `Revised Report on the Algorithmic Language Algol-60 ` + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, Operator + + +__all__ = ['Algol_NuStyle'] + + +class Algol_NuStyle(Style): + name = 'algol_nu' + + background_color = "#ffffff" + + styles = { + Comment: "italic #888", + Comment.Preproc: "bold noitalic #888", + Comment.Special: "bold noitalic #888", + + Keyword: "bold", + Keyword.Declaration: "italic", + + Name.Builtin: "bold italic", + Name.Builtin.Pseudo: "bold italic", + Name.Namespace: "bold italic #666", + Name.Class: "bold italic #666", + Name.Function: "bold italic #666", + Name.Variable: "bold italic #666", + Name.Constant: "bold italic #666", + + Operator.Word: "bold", + + String: "italic #666", + + Error: "border:#FF0000" + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/arduino.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/arduino.py new file mode 100644 index 0000000000000000000000000000000000000000..dcb3252174877f7f1ef469e74ab434a3fab6a5ac --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/arduino.py @@ -0,0 +1,100 @@ +""" + pygments.styles.arduino + ~~~~~~~~~~~~~~~~~~~~~~~ + + Arduino® Syntax highlighting style. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, \ + Number, Operator, Generic, Whitespace + + +__all__ = ['ArduinoStyle'] + + +class ArduinoStyle(Style): + """ + The Arduino® language style. This style is designed to highlight the + Arduino source code, so expect the best results with it. + """ + name = 'arduino' + + background_color = "#ffffff" + + styles = { + Whitespace: "", # class: 'w' + Error: "#a61717", # class: 'err' + + Comment: "#95a5a6", # class: 'c' + Comment.Multiline: "", # class: 'cm' + Comment.Preproc: "#728E00", # class: 'cp' + Comment.Single: "", # class: 'c1' + Comment.Special: "", # class: 'cs' + + Keyword: "#728E00", # class: 'k' + Keyword.Constant: "#00979D", # class: 'kc' + Keyword.Declaration: "", # class: 'kd' + Keyword.Namespace: "", # class: 'kn' + Keyword.Pseudo: "#00979D", # class: 'kp' + Keyword.Reserved: "#00979D", # class: 'kr' + Keyword.Type: "#00979D", # class: 'kt' + + Operator: "#728E00", # class: 'o' + Operator.Word: "", # class: 'ow' + + Name: "#434f54", # class: 'n' + Name.Attribute: "", # class: 'na' + Name.Builtin: "#728E00", # class: 'nb' + Name.Builtin.Pseudo: "", # class: 'bp' + Name.Class: "", # class: 'nc' + Name.Constant: "", # class: 'no' + Name.Decorator: "", # class: 'nd' + Name.Entity: "", # class: 'ni' + Name.Exception: "", # class: 'ne' + Name.Function: "#D35400", # class: 'nf' + Name.Property: "", # class: 'py' + Name.Label: "", # class: 'nl' + Name.Namespace: "", # class: 'nn' + Name.Other: "#728E00", # class: 'nx' + Name.Tag: "", # class: 'nt' + Name.Variable: "", # class: 'nv' + Name.Variable.Class: "", # class: 'vc' + Name.Variable.Global: "", # class: 'vg' + Name.Variable.Instance: "", # class: 'vi' + + Number: "#8A7B52", # class: 'm' + Number.Float: "", # class: 'mf' + Number.Hex: "", # class: 'mh' + Number.Integer: "", # class: 'mi' + Number.Integer.Long: "", # class: 'il' + Number.Oct: "", # class: 'mo' + + String: "#7F8C8D", # class: 's' + String.Backtick: "", # class: 'sb' + String.Char: "", # class: 'sc' + String.Doc: "", # class: 'sd' + String.Double: "", # class: 's2' + String.Escape: "", # class: 'se' + String.Heredoc: "", # class: 'sh' + String.Interpol: "", # class: 'si' + String.Other: "", # class: 'sx' + String.Regex: "", # class: 'sr' + String.Single: "", # class: 's1' + String.Symbol: "", # class: 'ss' + + Generic: "", # class: 'g' + Generic.Deleted: "", # class: 'gd', + Generic.Emph: "", # class: 'ge' + Generic.Error: "", # class: 'gr' + Generic.Heading: "", # class: 'gh' + Generic.Inserted: "", # class: 'gi' + Generic.Output: "", # class: 'go' + Generic.Prompt: "", # class: 'gp' + Generic.Strong: "", # class: 'gs' + Generic.Subheading: "", # class: 'gu' + Generic.Traceback: "", # class: 'gt' + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/autumn.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/autumn.py new file mode 100644 index 0000000000000000000000000000000000000000..8229ad175292c0cbd9e21358507683c660e894db --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/autumn.py @@ -0,0 +1,67 @@ +""" + pygments.styles.autumn + ~~~~~~~~~~~~~~~~~~~~~~ + + A colorful style, inspired by the terminal highlighting style. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, \ + Number, Operator, Generic, Whitespace + + +__all__ = ['AutumnStyle'] + + +class AutumnStyle(Style): + """ + A colorful style, inspired by the terminal highlighting style. + """ + name = 'autumn' + + styles = { + Whitespace: '#bbbbbb', + + Comment: 'italic #aaaaaa', + Comment.Preproc: 'noitalic #4c8317', + Comment.Special: 'italic #0000aa', + + Keyword: '#0000aa', + Keyword.Type: '#00aaaa', + + Operator.Word: '#0000aa', + + Name.Builtin: '#00aaaa', + Name.Function: '#00aa00', + Name.Class: 'underline #00aa00', + Name.Namespace: 'underline #00aaaa', + Name.Variable: '#aa0000', + Name.Constant: '#aa0000', + Name.Entity: 'bold #800', + Name.Attribute: '#1e90ff', + Name.Tag: 'bold #1e90ff', + Name.Decorator: '#888888', + + String: '#aa5500', + String.Symbol: '#0000aa', + String.Regex: '#009999', + + Number: '#009999', + + Generic.Heading: 'bold #000080', + Generic.Subheading: 'bold #800080', + Generic.Deleted: '#aa0000', + Generic.Inserted: '#00aa00', + Generic.Error: '#aa0000', + Generic.Emph: 'italic', + Generic.Strong: 'bold', + Generic.EmphStrong: 'bold italic', + Generic.Prompt: '#555555', + Generic.Output: '#888888', + Generic.Traceback: '#aa0000', + + Error: '#F00 bg:#FAA' + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/borland.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/borland.py new file mode 100644 index 0000000000000000000000000000000000000000..bfceaea0f5df9acbbaf2572c103e7b9abfe1d71c --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/borland.py @@ -0,0 +1,53 @@ +""" + pygments.styles.borland + ~~~~~~~~~~~~~~~~~~~~~~~ + + Style similar to the style used in the Borland IDEs. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, \ + Number, Operator, Generic, Whitespace + + +__all__ = ['BorlandStyle'] + + +class BorlandStyle(Style): + """ + Style similar to the style used in the borland IDEs. + """ + name = 'borland' + + styles = { + Whitespace: '#bbbbbb', + + Comment: 'italic #008800', + Comment.Preproc: 'noitalic #008080', + Comment.Special: 'noitalic bold', + + String: '#0000FF', + String.Char: '#800080', + Number: '#0000FF', + Keyword: 'bold #000080', + Operator.Word: 'bold', + Name.Tag: 'bold #000080', + Name.Attribute: '#FF0000', + + Generic.Heading: '#999999', + Generic.Subheading: '#aaaaaa', + Generic.Deleted: 'bg:#ffdddd #000000', + Generic.Inserted: 'bg:#ddffdd #000000', + Generic.Error: '#aa0000', + Generic.Emph: 'italic', + Generic.Strong: 'bold', + Generic.EmphStrong: 'bold italic', + Generic.Prompt: '#555555', + Generic.Output: '#888888', + Generic.Traceback: '#aa0000', + + Error: 'bg:#e3d2d2 #a61717' + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/bw.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/bw.py new file mode 100644 index 0000000000000000000000000000000000000000..30cd78763709b6da719425c428c66c9673de6791 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/bw.py @@ -0,0 +1,52 @@ +""" + pygments.styles.bw + ~~~~~~~~~~~~~~~~~~ + + Simple black/white only style. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, \ + Operator, Generic + + +__all__ = ['BlackWhiteStyle'] + + +class BlackWhiteStyle(Style): + name = 'bw' + + background_color = "#ffffff" + + styles = { + Comment: "italic", + Comment.Preproc: "noitalic", + + Keyword: "bold", + Keyword.Pseudo: "nobold", + Keyword.Type: "nobold", + + Operator.Word: "bold", + + Name.Class: "bold", + Name.Namespace: "bold", + Name.Exception: "bold", + Name.Entity: "bold", + Name.Tag: "bold", + + String: "italic", + String.Interpol: "bold", + String.Escape: "bold", + + Generic.Heading: "bold", + Generic.Subheading: "bold", + Generic.Emph: "italic", + Generic.Strong: "bold", + Generic.EmphStrong: "bold italic", + Generic.Prompt: "bold", + + Error: "border:#FF0000" + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/coffee.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/coffee.py new file mode 100644 index 0000000000000000000000000000000000000000..66f504d87eecbeb31fff5b3a8b725d2b986afe02 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/coffee.py @@ -0,0 +1,80 @@ +""" + pygments.styles.coffee + ~~~~~~~~~~~~~~~~~~~~~~ + + A warm and cozy theme based off gruvbox + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import (Comment, Error, Generic, Keyword, Literal, Name, + Number, Operator, Punctuation, String, Token) + +__all__ = ["CoffeeStyle"] + + +class CoffeeStyle(Style): + """ + A warm and cozy theme based off gruvbox + """ + + name = "coffee" + + background_color = "#262220" + highlight_color = "#ddd0c0" + + line_number_color = "#4e4e4e" + line_number_special_color = "#8f9494" + + styles = { + Comment: "#70757A", + Comment.Hashbang: "#8f9f9f", + Comment.Preproc: "#fdd0c0", + Comment.PreprocFile: "#c9b98f", + Comment.Special: "#af5f5f", + Error: "#af5f5f", + Generic.Deleted: "#bb6868", + Generic.Emph: "italic", + Generic.Error: "#af5f5f", + Generic.Inserted: "#849155", + Generic.Output: "#ddd0c0", + Generic.Strong: "bold", + Generic.Traceback: "#af5f5f", + Keyword: "#919191", + Keyword.Constant: "#875f5f", + Keyword.Declaration: "#875f5f", + Keyword.Namespace: "#875f5f", + Keyword.Reserved: "#b46276", + Keyword.Type: "#af875f", + Literal: "#af875f", + Name: "#ddd0c0", + Name.Attribute: "#ddd0c0", + Name.Builtin: "#ddd0c0", + Name.Builtin.Pseudo: "#87afaf", + Name.Class: "#875f5f", + Name.Constant: "#af8787", + Name.Decorator: "#fdd0c0", + Name.Entity: "#ddd0c0", + Name.Exception: "#877575", + Name.Function: "#fdd0c0", + Name.Function.Magic: "#fdd0c0", + Name.Other: "#ddd0c0", + Name.Property: "#dfaf87", + Name.Tag: "#87afaf", + Name.Variable: "#ddd0c0", + Number: "#87afaf", + Operator: "#878787", + Operator.Word: "#878787", + Punctuation: "#ddd0c0", + String: "#c9b98f", + String.Affix: "#dfaf87", + String.Doc: "#878787", + String.Escape: "#af5f5f", + String.Interpol: "#af5f5f", + String.Other: "#fdd0c0", + String.Regex: "#af5f5f", + String.Symbol: "#af5f5f", + Token: "#ddd0c0", + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/colorful.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/colorful.py new file mode 100644 index 0000000000000000000000000000000000000000..012d943ac332479b9052fb983b1b8683736b4dae --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/colorful.py @@ -0,0 +1,83 @@ +""" + pygments.styles.colorful + ~~~~~~~~~~~~~~~~~~~~~~~~ + + A colorful style, inspired by CodeRay. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, \ + Number, Operator, Generic, Whitespace + + +__all__ = ['ColorfulStyle'] + + +class ColorfulStyle(Style): + """ + A colorful style, inspired by CodeRay. + """ + name = 'colorful' + + styles = { + Whitespace: "#bbbbbb", + + Comment: "#888", + Comment.Preproc: "#579", + Comment.Special: "bold #cc0000", + + Keyword: "bold #080", + Keyword.Pseudo: "#038", + Keyword.Type: "#339", + + Operator: "#333", + Operator.Word: "bold #000", + + Name.Builtin: "#007020", + Name.Function: "bold #06B", + Name.Class: "bold #B06", + Name.Namespace: "bold #0e84b5", + Name.Exception: "bold #F00", + Name.Variable: "#963", + Name.Variable.Instance: "#33B", + Name.Variable.Class: "#369", + Name.Variable.Global: "bold #d70", + Name.Constant: "bold #036", + Name.Label: "bold #970", + Name.Entity: "bold #800", + Name.Attribute: "#00C", + Name.Tag: "#070", + Name.Decorator: "bold #555", + + String: "bg:#fff0f0", + String.Char: "#04D bg:", + String.Doc: "#D42 bg:", + String.Interpol: "bg:#eee", + String.Escape: "bold #666", + String.Regex: "bg:#fff0ff #000", + String.Symbol: "#A60 bg:", + String.Other: "#D20", + + Number: "bold #60E", + Number.Integer: "bold #00D", + Number.Float: "bold #60E", + Number.Hex: "bold #058", + Number.Oct: "bold #40E", + + Generic.Heading: "bold #000080", + Generic.Subheading: "bold #800080", + Generic.Deleted: "#A00000", + Generic.Inserted: "#00A000", + Generic.Error: "#FF0000", + Generic.Emph: "italic", + Generic.Strong: "bold", + Generic.EmphStrong: "bold italic", + Generic.Prompt: "bold #c65d09", + Generic.Output: "#888", + Generic.Traceback: "#04D", + + Error: "#F00 bg:#FAA" + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/default.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/default.py new file mode 100644 index 0000000000000000000000000000000000000000..30f882e967914d8ed7291726e203eeae848eb56f --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/default.py @@ -0,0 +1,76 @@ +""" + pygments.styles.default + ~~~~~~~~~~~~~~~~~~~~~~~ + + The default highlighting style. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, \ + Number, Operator, Generic, Whitespace + + +__all__ = ['DefaultStyle'] + + +class DefaultStyle(Style): + """ + The default style (inspired by Emacs 22). + """ + name = 'default' + + background_color = "#f8f8f8" + + styles = { + Whitespace: "#bbbbbb", + Comment: "italic #3D7B7B", + Comment.Preproc: "noitalic #9C6500", + + #Keyword: "bold #AA22FF", + Keyword: "bold #008000", + Keyword.Pseudo: "nobold", + Keyword.Type: "nobold #B00040", + + Operator: "#666666", + Operator.Word: "bold #AA22FF", + + Name.Builtin: "#008000", + Name.Function: "#0000FF", + Name.Class: "bold #0000FF", + Name.Namespace: "bold #0000FF", + Name.Exception: "bold #CB3F38", + Name.Variable: "#19177C", + Name.Constant: "#880000", + Name.Label: "#767600", + Name.Entity: "bold #717171", + Name.Attribute: "#687822", + Name.Tag: "bold #008000", + Name.Decorator: "#AA22FF", + + String: "#BA2121", + String.Doc: "italic", + String.Interpol: "bold #A45A77", + String.Escape: "bold #AA5D1F", + String.Regex: "#A45A77", + #String.Symbol: "#B8860B", + String.Symbol: "#19177C", + String.Other: "#008000", + Number: "#666666", + + Generic.Heading: "bold #000080", + Generic.Subheading: "bold #800080", + Generic.Deleted: "#A00000", + Generic.Inserted: "#008400", + Generic.Error: "#E40000", + Generic.Emph: "italic", + Generic.Strong: "bold", + Generic.EmphStrong: "bold italic", + Generic.Prompt: "bold #000080", + Generic.Output: "#717171", + Generic.Traceback: "#04D", + + Error: "border:#FF0000" + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/dracula.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/dracula.py new file mode 100644 index 0000000000000000000000000000000000000000..805e6630ab6380d9f8e6fcfec96ae8e79faaff53 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/dracula.py @@ -0,0 +1,90 @@ +""" + pygments.styles.dracula + ~~~~~~~~~~~~~~~~~~~~~~~ + + Pygments version of `Dracula` from https://github.com/dracula/dracula-theme. + + Based on the Dracula Theme for pygments by Chris Bracco. + See https://github.com/dracula/pygments/tree/fee9ed5613d1086bc01b9d0a5a0e9867a009f571 + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, Literal, \ + Number, Operator, Other, Punctuation, Text, Generic, Whitespace + + +__all__ = ['DraculaStyle'] + +background = "#282a36" +foreground = "#f8f8f2" +selection = "#44475a" +comment = "#6272a4" +cyan = "#8be9fd" +green = "#50fa7b" +orange = "#ffb86c" +pink = "#ff79c6" +purple = "#bd93f9" +red = "#ff5555" +yellow = "#f1fa8c" + +deletion = "#8b080b" + +class DraculaStyle(Style): + name = 'dracula' + + background_color = background + highlight_color = selection + line_number_color = yellow + line_number_background_color = selection + line_number_special_color = green + line_number_special_background_color = comment + + styles = { + Whitespace: foreground, + + Comment: comment, + Comment.Preproc: pink, + + Generic: foreground, + Generic.Deleted: deletion, + Generic.Emph: "underline", + Generic.Heading: "bold", + Generic.Inserted: "bold", + Generic.Output: selection, + Generic.EmphStrong: "underline", + Generic.Subheading: "bold", + + Error: foreground, + + Keyword: pink, + Keyword.Constant: pink, + Keyword.Declaration: cyan + " italic", + Keyword.Type: cyan, + + Literal: foreground, + + Name: foreground, + Name.Attribute: green, + Name.Builtin: cyan + " italic", + Name.Builtin.Pseudo: foreground, + Name.Class: green, + Name.Function: green, + Name.Label: cyan + " italic", + Name.Tag: pink, + Name.Variable: cyan + " italic", + + Number: orange, + + Operator: pink, + + Other: foreground, + + Punctuation: foreground, + + String: purple, + + Text: foreground, + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/emacs.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/emacs.py new file mode 100644 index 0000000000000000000000000000000000000000..72948634497f901aa40c9016a7d3dae7117ea175 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/emacs.py @@ -0,0 +1,75 @@ +""" + pygments.styles.emacs + ~~~~~~~~~~~~~~~~~~~~~ + + A highlighting style for Pygments, inspired by Emacs. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, \ + Number, Operator, Generic, Whitespace + + +__all__ = ['EmacsStyle'] + + +class EmacsStyle(Style): + """ + The default style (inspired by Emacs 22). + """ + name = 'emacs' + + background_color = "#f8f8f8" + + styles = { + Whitespace: "#bbbbbb", + Comment: "italic #008800", + Comment.Preproc: "noitalic", + Comment.Special: "noitalic bold", + + Keyword: "bold #AA22FF", + Keyword.Pseudo: "nobold", + Keyword.Type: "bold #00BB00", + + Operator: "#666666", + Operator.Word: "bold #AA22FF", + + Name.Builtin: "#AA22FF", + Name.Function: "#00A000", + Name.Class: "#0000FF", + Name.Namespace: "bold #0000FF", + Name.Exception: "bold #D2413A", + Name.Variable: "#B8860B", + Name.Constant: "#880000", + Name.Label: "#A0A000", + Name.Entity: "bold #999999", + Name.Attribute: "#BB4444", + Name.Tag: "bold #008000", + Name.Decorator: "#AA22FF", + + String: "#BB4444", + String.Doc: "italic", + String.Interpol: "bold #BB6688", + String.Escape: "bold #BB6622", + String.Regex: "#BB6688", + String.Symbol: "#B8860B", + String.Other: "#008000", + Number: "#666666", + + Generic.Heading: "bold #000080", + Generic.Subheading: "bold #800080", + Generic.Deleted: "#A00000", + Generic.Inserted: "#00A000", + Generic.Error: "#FF0000", + Generic.Emph: "italic", + Generic.Strong: "bold", + Generic.EmphStrong: "bold italic", + Generic.Prompt: "bold #000080", + Generic.Output: "#888", + Generic.Traceback: "#04D", + + Error: "border:#FF0000" + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/friendly.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/friendly.py new file mode 100644 index 0000000000000000000000000000000000000000..e1950f0872823b983b17c322957d09f159ec843b --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/friendly.py @@ -0,0 +1,76 @@ +""" + pygments.styles.friendly + ~~~~~~~~~~~~~~~~~~~~~~~~ + + A modern style based on the VIM pyte theme. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, \ + Number, Operator, Generic, Whitespace + + +__all__ = ['FriendlyStyle'] + + +class FriendlyStyle(Style): + """ + A modern style based on the VIM pyte theme. + """ + name = 'friendly' + + background_color = "#f0f0f0" + line_number_color = "#666666" + + styles = { + Whitespace: "#bbbbbb", + Comment: "italic #60a0b0", + Comment.Preproc: "noitalic #007020", + Comment.Special: "noitalic bg:#fff0f0", + + Keyword: "bold #007020", + Keyword.Pseudo: "nobold", + Keyword.Type: "nobold #902000", + + Operator: "#666666", + Operator.Word: "bold #007020", + + Name.Builtin: "#007020", + Name.Function: "#06287e", + Name.Class: "bold #0e84b5", + Name.Namespace: "bold #0e84b5", + Name.Exception: "#007020", + Name.Variable: "#bb60d5", + Name.Constant: "#60add5", + Name.Label: "bold #002070", + Name.Entity: "bold #d55537", + Name.Attribute: "#4070a0", + Name.Tag: "bold #062873", + Name.Decorator: "bold #555555", + + String: "#4070a0", + String.Doc: "italic", + String.Interpol: "italic #70a0d0", + String.Escape: "bold #4070a0", + String.Regex: "#235388", + String.Symbol: "#517918", + String.Other: "#c65d09", + Number: "#40a070", + + Generic.Heading: "bold #000080", + Generic.Subheading: "bold #800080", + Generic.Deleted: "#A00000", + Generic.Inserted: "#00A000", + Generic.Error: "#FF0000", + Generic.Emph: "italic", + Generic.Strong: "bold", + Generic.EmphStrong: "bold italic", + Generic.Prompt: "bold #c65d09", + Generic.Output: "#888", + Generic.Traceback: "#04D", + + Error: "border:#FF0000" + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/friendly_grayscale.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/friendly_grayscale.py new file mode 100644 index 0000000000000000000000000000000000000000..23dfaa59c10334cd36c9b8173231459d44def0cf --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/friendly_grayscale.py @@ -0,0 +1,80 @@ +""" + pygments.styles.friendly_grayscale + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + A style based on friendly style. + The color values of the friendly style have been converted to grayscale + using the luminosity value calculated by + http://www.workwithcolor.com/color-converter-01.htm + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, \ + Number, Operator, Generic, Whitespace + + +__all__ = ['FriendlyGrayscaleStyle'] + + +class FriendlyGrayscaleStyle(Style): + """ + A modern grayscale style based on the friendly style. + + .. versionadded:: 2.11 + """ + name = 'friendly_grayscale' + + background_color = "#f0f0f0" + + styles = { + Whitespace: "#bbbbbb", + Comment: "italic #959595", + Comment.Preproc: "noitalic #575757", + Comment.Special: "noitalic bg:#F4F4F4", + + Keyword: "bold #575757", + Keyword.Pseudo: "nobold", + Keyword.Type: "nobold #4F4F4F", + + Operator: "#666666", + Operator.Word: "bold #575757", + + Name.Builtin: "#575757", + Name.Function: "#3F3F3F", + Name.Class: "bold #7E7E7E", + Name.Namespace: "bold #7E7E7E", + Name.Exception: "#575757", + Name.Variable: "#9A9A9A", + Name.Constant: "#A5A5A5", + Name.Label: "bold #363636", + Name.Entity: "bold #848484", + Name.Attribute: "#707070", + Name.Tag: "bold #3B3B3B", + Name.Decorator: "bold #555555", + + String: "#717171", + String.Doc: "italic", + String.Interpol: "italic #9F9F9F", + String.Escape: "bold #717171", + String.Regex: "#575757", + String.Symbol: "#676767", + String.Other: "#7E7E7E", + Number: "#888888", + + Generic.Heading: "bold #373737", + Generic.Subheading: "bold #5A5A5A", + Generic.Deleted: "#545454", + Generic.Inserted: "#7D7D7D", + Generic.Error: "#898989", + Generic.Emph: "italic", + Generic.Strong: "bold", + Generic.EmphStrong: "bold italic", + Generic.Prompt: "bold #7E7E7E", + Generic.Output: "#888888", + Generic.Traceback: "#6D6D6D", + + Error: "border:#898989" + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/fruity.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/fruity.py new file mode 100644 index 0000000000000000000000000000000000000000..64c8f96eb2504c6e36b583cd054c19aec02765e0 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/fruity.py @@ -0,0 +1,47 @@ +""" + pygments.styles.fruity + ~~~~~~~~~~~~~~~~~~~~~~ + + pygments version of my "fruity" vim theme. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Token, Comment, Name, Keyword, \ + Generic, Number, String, Whitespace + + +__all__ = ['FruityStyle'] + + +class FruityStyle(Style): + """ + Pygments version of the "native" vim theme. + """ + + name = 'fruity' + + background_color = '#111111' + highlight_color = '#333333' + + styles = { + Whitespace: '#888888', + Token: '#ffffff', + Generic.Output: '#444444 bg:#222222', + Keyword: '#fb660a bold', + Keyword.Pseudo: 'nobold', + Number: '#0086f7 bold', + Name.Tag: '#fb660a bold', + Name.Variable: '#fb660a', + Comment: '#008800 bg:#0f140f italic', + Name.Attribute: '#ff0086 bold', + String: '#0086d2', + Name.Function: '#ff0086 bold', + Generic.Heading: '#ffffff bold', + Keyword.Type: '#cdcaa9 bold', + Generic.Subheading: '#ffffff bold', + Name.Constant: '#0086d2', + Comment.Preproc: '#ff0007 bold' + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/gh_dark.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/gh_dark.py new file mode 100644 index 0000000000000000000000000000000000000000..3bfd300036478ee10879b06f0c01f8f863713b72 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/gh_dark.py @@ -0,0 +1,113 @@ +""" + pygments.styles.gh_dark + ~~~~~~~~~~~~~~~~~~~~~~~ + + Github's Dark-Colorscheme based theme for Pygments + Colors extracted from https://github.com/primer/primitives + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, Error, Number, Operator, \ + Generic, Text, Literal, String, Token + + +__all__ = ['GhDarkStyle'] + + +# vars are defined to match the defs in +# - [GitHub's VS Code theme](https://github.com/primer/github-vscode-theme) and +# - [Primer styles](https://github.com/primer/primitives) +RED_2 = "#ffa198" +RED_3 = "#ff7b72" +RED_9 = "#490202" +ORANGE_2 = "#ffa657" +ORANGE_3 = "#f0883e" +GREEN_1 = "#7ee787" +GREEN_2 = "#56d364" +GREEN_7 = "#0f5323" +BLUE_1 = "#a5d6ff" +BLUE_2 = "#79c0ff" +PURPLE_2 = "#d2a8ff" +GRAY_3 = "#8b949e" +GRAY_4 = "#6e7681" +FG_SUBTLE = "#6e7681" +FG_DEFAULT = "#e6edf3" +BG_DEFAULT = "#0d1117" +DANGER_FG = "#f85149" + + +class GhDarkStyle(Style): + """ + Github's Dark-Colorscheme based theme for Pygments + """ + + name = 'github-dark' + + background_color = BG_DEFAULT + + # has transparency in VS Code theme as `colors.codemirror.activelineBg` + highlight_color = GRAY_4 + + line_number_special_color = FG_DEFAULT + line_number_special_background_color = FG_SUBTLE + + line_number_color = GRAY_4 + line_number_background_color = BG_DEFAULT + + styles = { + Token: FG_DEFAULT, + + Error: DANGER_FG, + + Keyword: RED_3, + Keyword.Constant: BLUE_2, + Keyword.Pseudo: BLUE_2, + + Name: FG_DEFAULT, + Name.Class: "bold "+ORANGE_3, + Name.Constant: "bold "+BLUE_2, + Name.Decorator: 'bold '+PURPLE_2, + Name.Entity: ORANGE_2, + Name.Exception: "bold "+ORANGE_3, + Name.Function: 'bold '+PURPLE_2, + Name.Label: "bold "+BLUE_2, + Name.Namespace: RED_3, + Name.Property: BLUE_2, + Name.Tag: GREEN_1, + Name.Variable: BLUE_2, + + Literal: BLUE_1, + Literal.Date: BLUE_2, + String: BLUE_1, + String.Affix: BLUE_2, + String.Delimiter: BLUE_2, + String.Escape: BLUE_2, + String.Heredoc: BLUE_2, + String.Regex: BLUE_2, + Number: BLUE_1, + + Comment: 'italic '+GRAY_3, + Comment.Preproc: "bold " + GRAY_3, + Comment.Special: "bold italic " + GRAY_3, + + Operator: 'bold ' + RED_3, + + Generic: FG_DEFAULT, + Generic.Deleted: f"bg:{RED_9} {RED_2}", + Generic.Emph: "italic", + Generic.Error: RED_2, + Generic.Heading: "bold "+BLUE_2, + Generic.Inserted: f'bg:{GREEN_7} {GREEN_2}', + Generic.Output: GRAY_3, + Generic.Prompt: GRAY_3, + Generic.Strong: "bold", + Generic.EmphStrong: "bold italic", + Generic.Subheading: BLUE_2, + Generic.Traceback: RED_3, + Generic.Underline: "underline", + + Text.Whitespace: FG_SUBTLE, + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/gruvbox.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/gruvbox.py new file mode 100644 index 0000000000000000000000000000000000000000..235639118756d4a8730cd7a2370e9e0b630cb5df --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/gruvbox.py @@ -0,0 +1,118 @@ +""" + pygments.styles.gruvbox + ~~~~~~~~~~~~~~~~~~~~~~~ + + pygments version of the "gruvbox" vim theme. + https://github.com/morhetz/gruvbox + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Token, Keyword, Name, Comment, String, Error, \ + Number, Operator, Generic + + +__all__ = ['GruvboxDarkStyle', 'GruvboxLightStyle'] + + +class GruvboxDarkStyle(Style): + """ + Pygments version of the "gruvbox" dark vim theme. + """ + + name = 'gruvbox-dark' + + background_color = '#282828' + highlight_color = '#ebdbb2' + + styles = { + Token: '#dddddd', + + Comment: 'italic #928374', + Comment.PreProc: '#8ec07c', + Comment.Special: 'bold italic #ebdbb2', + + Keyword: '#fb4934', + Operator.Word: '#fb4934', + + String: '#b8bb26', + String.Escape: '#fe8019', + + Number: '#d3869b', + + Name.Builtin: '#fe8019', + Name.Variable: '#83a598', + Name.Constant: '#d3869b', + Name.Class: '#8ec07c', + Name.Function: '#8ec07c', + Name.Namespace: '#8ec07c', + Name.Exception: '#fb4934', + Name.Tag: '#8ec07c', + Name.Attribute: '#fabd2f', + Name.Decorator: '#fb4934', + + Generic.Heading: 'bold #ebdbb2', + Generic.Subheading: 'underline #ebdbb2', + Generic.Deleted: 'bg:#fb4934 #282828', + Generic.Inserted: 'bg:#b8bb26 #282828', + Generic.Error: '#fb4934', + Generic.Emph: 'italic', + Generic.Strong: 'bold', + Generic.EmphStrong: 'bold italic', + Generic.Prompt: '#a89984', + Generic.Output: '#f2e5bc', + Generic.Traceback: '#fb4934', + + Error: 'bg:#fb4934 #282828' + } + + +class GruvboxLightStyle(Style): + """ + Pygments version of the "gruvbox" Light vim theme. + """ + + name = 'gruvbox-light' + + background_color = '#fbf1c7' + highlight_color = '#3c3836' + + styles = { + Comment: 'italic #928374', + Comment.PreProc: '#427b58', + Comment.Special: 'bold italic #3c3836', + + Keyword: '#9d0006', + Operator.Word: '#9d0006', + + String: '#79740e', + String.Escape: '#af3a03', + + Number: '#8f3f71', + + Name.Builtin: '#af3a03', + Name.Variable: '#076678', + Name.Constant: '#8f3f71', + Name.Class: '#427b58', + Name.Function: '#427b58', + Name.Namespace: '#427b58', + Name.Exception: '#9d0006', + Name.Tag: '#427b58', + Name.Attribute: '#b57614', + Name.Decorator: '#9d0006', + + Generic.Heading: 'bold #3c3836', + Generic.Subheading: 'underline #3c3836', + Generic.Deleted: 'bg:#9d0006 #fbf1c7', + Generic.Inserted: 'bg:#79740e #fbf1c7', + Generic.Error: '#9d0006', + Generic.Emph: 'italic', + Generic.Strong: 'bold', + Generic.Prompt: '#7c6f64', + Generic.Output: '#32302f', + Generic.Traceback: '#9d0006', + + Error: 'bg:#9d0006 #fbf1c7' + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/igor.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/igor.py new file mode 100644 index 0000000000000000000000000000000000000000..467b281d0be8489f7d6e54510b905153b022c5e7 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/igor.py @@ -0,0 +1,32 @@ +""" + pygments.styles.igor + ~~~~~~~~~~~~~~~~~~~~ + + Igor Pro default style. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String + + +__all__ = ['IgorStyle'] + + +class IgorStyle(Style): + """ + Pygments version of the official colors for Igor Pro procedures. + """ + + name = 'igor' + + styles = { + Comment: 'italic #FF0000', + Keyword: '#0000FF', + Name.Function: '#C34E00', + Name.Decorator: '#CC00A3', + Name.Class: '#007575', + String: '#009C00' + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/inkpot.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/inkpot.py new file mode 100644 index 0000000000000000000000000000000000000000..39902c27ce8bfa9c6aadca4d5b2e38a202e31592 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/inkpot.py @@ -0,0 +1,72 @@ +""" + pygments.styles.inkpot + ~~~~~~~~~~~~~~~~~~~~~~ + + A highlighting style for Pygments, inspired by the Inkpot theme for VIM. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Text, Other, Keyword, Name, Comment, String, \ + Error, Number, Operator, Generic, Whitespace, Punctuation + + +__all__ = ['InkPotStyle'] + + +class InkPotStyle(Style): + name = 'inkpot' + + background_color = "#1e1e27" + + styles = { + Text: "#cfbfad", + Other: "#cfbfad", + Whitespace: "#434357", + Comment: "#cd8b00", + Comment.Preproc: "#409090", + Comment.PreprocFile: "bg:#404040 #ffcd8b", + Comment.Special: "#808bed", + + Keyword: "#808bed", + Keyword.Pseudo: "nobold", + Keyword.Type: "#ff8bff", + + Operator: "#666666", + + Punctuation: "#cfbfad", + + Name: "#cfbfad", + Name.Attribute: "#cfbfad", + Name.Builtin.Pseudo: '#ffff00', + Name.Builtin: "#808bed", + Name.Class: "#ff8bff", + Name.Constant: "#409090", + Name.Decorator: "#409090", + Name.Exception: "#ff0000", + Name.Function: "#c080d0", + Name.Label: "#808bed", + Name.Namespace: "#ff0000", + Name.Variable: "#cfbfad", + + String: "bg:#404040 #ffcd8b", + String.Doc: "#808bed", + + Number: "#f0ad6d", + + Generic.Heading: "bold #000080", + Generic.Subheading: "bold #800080", + Generic.Deleted: "#A00000", + Generic.Inserted: "#00A000", + Generic.Error: "#FF0000", + Generic.Emph: "italic", + Generic.Strong: "bold", + Generic.EmphStrong: "bold italic", + Generic.Prompt: "bold #000080", + Generic.Output: "#888", + Generic.Traceback: "#04D", + + Error: "bg:#6e2e2e #ffffff" + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/lightbulb.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/lightbulb.py new file mode 100644 index 0000000000000000000000000000000000000000..8bcd21aafbd8275c92aec30d77eee74425508374 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/lightbulb.py @@ -0,0 +1,110 @@ +""" + pygments.styles.lightbulb + ~~~~~~~~~~~~~~~~~~~~~~~~~ + + A minimal dark theme based on the Lightbulb theme for VSCode. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import ( + Comment, + Error, + Generic, + Keyword, + Literal, + Name, + Number, + Operator, + Punctuation, + String, + Token, +) + + +__all__ = ['LightbulbStyle'] + + +COLORS = { + "bg": "#1d2331", + "blue_1": "#73D0FF", + "gray_1": "#7e8aa1", + "gray_2": "#3c4354", + "gray_3": "#6e7681", + "red_1": "#f88f7f", + "red_2": "#3d1e20", + "orange_1": "#FFAD66", + "orange_2": "#F29E74", + "yellow_1": "#FFD173", + "white": "#d4d2c8", + "magenta_1": "#DFBFFF", + "green_1": "#D5FF80", + "green_2": "#19362c", + "cyan_1": "#95E6CB", +} + + +class LightbulbStyle(Style): + """ + A minimal dark theme based on the Lightbulb theme for VSCode. + """ + + name = 'lightbulb' + + background_color = COLORS['bg'] + highlight_color = COLORS['gray_3'] + + line_number_color = COLORS['gray_2'] + line_number_special_color = COLORS['gray_2'] + + styles = { + Comment: COLORS["gray_1"], + Comment.Hashbang: "italic " + COLORS['red_1'], + Comment.Preproc: "bold " + COLORS['orange_1'], + Comment.Special: "italic " + COLORS['gray_1'], + Error: COLORS['red_1'], + Generic.Deleted: f"bg:{COLORS['red_2']} #f88f7f", + Generic.Emph: "italic", + Generic.Error: "#f88f7f", + Generic.Inserted: f"bg:{COLORS['green_2']} #6ad4af", + Generic.Output: COLORS['gray_1'], + Generic.Strong: "bold", + Generic.Traceback: COLORS['red_1'], + Keyword: COLORS['orange_1'], + Keyword.Constant: COLORS['orange_1'], + Keyword.Declaration: COLORS['orange_1'], + Keyword.Namespace: COLORS['orange_1'], + Keyword.Reserved: COLORS['orange_1'], + Keyword.Type: COLORS['blue_1'], + Literal: COLORS['green_1'], + Name: COLORS['white'], + Name.Attribute: COLORS['yellow_1'], + Name.Builtin: COLORS['yellow_1'], + Name.Builtin.Pseudo: "#5CCFE6", + Name.Class: COLORS['blue_1'], + Name.Constant: COLORS['yellow_1'], + Name.Decorator: "bold italic " + COLORS['gray_1'], + Name.Entity: COLORS['cyan_1'], + Name.Exception: COLORS['blue_1'], + Name.Function: COLORS['yellow_1'], + Name.Function.Magic: COLORS['yellow_1'], + Name.Other: COLORS['white'], + Name.Property: COLORS['yellow_1'], + Name.Tag: "#5CCFE6", + Name.Variable: COLORS['white'], + Number: COLORS['magenta_1'], + Operator: COLORS['orange_1'], + Operator.Word: COLORS['orange_1'], + Punctuation: COLORS['white'], + String: COLORS['green_1'], + String.Affix: COLORS['orange_2'], + String.Doc: COLORS['gray_1'], + String.Escape: COLORS['cyan_1'], + String.Interpol: COLORS['cyan_1'], + String.Other: COLORS['cyan_1'], + String.Regex: COLORS['cyan_1'], + String.Symbol: COLORS['magenta_1'], + Token: COLORS['white'], + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/lilypond.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/lilypond.py new file mode 100644 index 0000000000000000000000000000000000000000..b538798f18eacb1759797af4c6371533af7bb90d --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/lilypond.py @@ -0,0 +1,62 @@ +""" + pygments.styles.lilypond + ~~~~~~~~~~~~~~~~~~~~~~~~ + + LilyPond-specific style. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Token + + +__all__ = ['LilyPondStyle'] + + +class LilyPondStyle(Style): + """ + Style for the LilyPond language. + + .. versionadded:: 2.11 + """ + + name = 'lilypond' + + # Don't show it in the gallery, it's intended for LilyPond + # input only and doesn't show good output on Python code. + web_style_gallery_exclude = True + + styles = { + Token.Text: "", + Token.Keyword: "bold", + Token.Comment: "italic #A3AAB2", + Token.String: "#AB0909", + Token.String.Escape: "#C46C6C", + Token.String.Symbol: "noinherit", + Token.Pitch: "", #"#911520", + Token.Number: "#976806", # includes durations + # A bare 11 is not distinguishable from a number, so we highlight + # the same. + Token.ChordModifier: "#976806", + Token.Name.Lvalue: "#08547A", + Token.Name.BackslashReference: "#08547A", + Token.Name.Builtin.MusicCommand: "bold #08547A", + Token.Name.Builtin.PaperVariable: "bold #6C5A05", + Token.Name.Builtin.HeaderVariable: "bold #6C5A05", + Token.Name.Builtin.MusicFunction: "bold #08547A", + Token.Name.Builtin.Clef: "bold #08547A", + Token.Name.Builtin.Scale: "bold #08547A", + Token.Name.Builtin.RepeatType: "#08547A", + Token.Name.Builtin.Dynamic: "#68175A", + Token.Name.Builtin.Articulation: "#68175A", + Token.Name.Builtin.SchemeFunction: "bold #A83401", + Token.Name.Builtin.SchemeBuiltin: "bold", + Token.Name.Builtin.MarkupCommand: "bold #831E71", + Token.Name.Builtin.Context: "bold #038B8B", + Token.Name.Builtin.ContextProperty: "#038B8B", + Token.Name.Builtin.Grob: "bold #0C7441", + Token.Name.Builtin.GrobProperty: "#0C7441", + Token.Name.Builtin.Translator: "bold #6200A4", + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/lovelace.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/lovelace.py new file mode 100644 index 0000000000000000000000000000000000000000..6e255cd66775b329188ac7e6e1213377a644e472 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/lovelace.py @@ -0,0 +1,100 @@ +""" + pygments.styles.lovelace + ~~~~~~~~~~~~~~~~~~~~~~~~ + + Lovelace by Miikka Salminen + + Pygments style by Miikka Salminen (https://github.com/miikkas) + A desaturated, somewhat subdued style created for the Lovelace interactive + learning environment. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, \ + Number, Operator, Punctuation, Generic, Whitespace + + +__all__ = ['LovelaceStyle'] + + +class LovelaceStyle(Style): + """ + The style used in Lovelace interactive learning environment. Tries to avoid + the "angry fruit salad" effect with desaturated and dim colours. + """ + name = 'lovelace' + + _KW_BLUE = '#2838b0' + _NAME_GREEN = '#388038' + _DOC_ORANGE = '#b85820' + _OW_PURPLE = '#a848a8' + _FUN_BROWN = '#785840' + _STR_RED = '#b83838' + _CLS_CYAN = '#287088' + _ESCAPE_LIME = '#709030' + _LABEL_CYAN = '#289870' + _EXCEPT_YELLOW = '#908828' + + styles = { + Whitespace: '#a89028', + Comment: 'italic #888888', + Comment.Hashbang: _CLS_CYAN, + Comment.Multiline: '#888888', + Comment.Preproc: 'noitalic '+_LABEL_CYAN, + + Keyword: _KW_BLUE, + Keyword.Constant: 'italic #444444', + Keyword.Declaration: 'italic', + Keyword.Type: 'italic', + + Operator: '#666666', + Operator.Word: _OW_PURPLE, + + Punctuation: '#888888', + + Name.Attribute: _NAME_GREEN, + Name.Builtin: _NAME_GREEN, + Name.Builtin.Pseudo: 'italic', + Name.Class: _CLS_CYAN, + Name.Constant: _DOC_ORANGE, + Name.Decorator: _CLS_CYAN, + Name.Entity: _ESCAPE_LIME, + Name.Exception: _EXCEPT_YELLOW, + Name.Function: _FUN_BROWN, + Name.Function.Magic: _DOC_ORANGE, + Name.Label: _LABEL_CYAN, + Name.Namespace: _LABEL_CYAN, + Name.Tag: _KW_BLUE, + Name.Variable: '#b04040', + Name.Variable.Global:_EXCEPT_YELLOW, + Name.Variable.Magic: _DOC_ORANGE, + + String: _STR_RED, + String.Affix: '#444444', + String.Char: _OW_PURPLE, + String.Delimiter: _DOC_ORANGE, + String.Doc: 'italic '+_DOC_ORANGE, + String.Escape: _ESCAPE_LIME, + String.Interpol: 'underline', + String.Other: _OW_PURPLE, + String.Regex: _OW_PURPLE, + + Number: '#444444', + + Generic.Deleted: '#c02828', + Generic.Emph: 'italic', + Generic.Error: '#c02828', + Generic.Heading: '#666666', + Generic.Subheading: '#444444', + Generic.Inserted: _NAME_GREEN, + Generic.Output: '#666666', + Generic.Prompt: '#444444', + Generic.Strong: 'bold', + Generic.EmphStrong: 'bold italic', + Generic.Traceback: _KW_BLUE, + + Error: 'bg:'+_OW_PURPLE, + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/manni.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/manni.py new file mode 100644 index 0000000000000000000000000000000000000000..df1822a217eaa85d6a93fda3d60884e627374c67 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/manni.py @@ -0,0 +1,79 @@ +""" + pygments.styles.manni + ~~~~~~~~~~~~~~~~~~~~~ + + A colorful style, inspired by the terminal highlighting style. + + This is a port of the style used in the `php port`_ of pygments + by Manni. The style is called 'default' there. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, \ + Number, Operator, Generic, Whitespace + + +__all__ = ['ManniStyle'] + + +class ManniStyle(Style): + """ + A colorful style, inspired by the terminal highlighting style. + """ + name = 'manni' + + background_color = '#f0f3f3' + + styles = { + Whitespace: '#bbbbbb', + Comment: 'italic #0099FF', + Comment.Preproc: 'noitalic #009999', + Comment.Special: 'bold', + + Keyword: 'bold #006699', + Keyword.Pseudo: 'nobold', + Keyword.Type: '#007788', + + Operator: '#555555', + Operator.Word: 'bold #000000', + + Name.Builtin: '#336666', + Name.Function: '#CC00FF', + Name.Class: 'bold #00AA88', + Name.Namespace: 'bold #00CCFF', + Name.Exception: 'bold #CC0000', + Name.Variable: '#003333', + Name.Constant: '#336600', + Name.Label: '#9999FF', + Name.Entity: 'bold #999999', + Name.Attribute: '#330099', + Name.Tag: 'bold #330099', + Name.Decorator: '#9999FF', + + String: '#CC3300', + String.Doc: 'italic', + String.Interpol: '#AA0000', + String.Escape: 'bold #CC3300', + String.Regex: '#33AAAA', + String.Symbol: '#FFCC33', + String.Other: '#CC3300', + + Number: '#FF6600', + + Generic.Heading: 'bold #003300', + Generic.Subheading: 'bold #003300', + Generic.Deleted: 'border:#CC0000 bg:#FFCCCC', + Generic.Inserted: 'border:#00CC00 bg:#CCFFCC', + Generic.Error: '#FF0000', + Generic.Emph: 'italic', + Generic.Strong: 'bold', + Generic.EmphStrong: 'bold italic', + Generic.Prompt: 'bold #000099', + Generic.Output: '#AAAAAA', + Generic.Traceback: '#99CC66', + + Error: 'bg:#FFAAAA #AA0000' + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/material.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/material.py new file mode 100644 index 0000000000000000000000000000000000000000..633ef380fcfd326a77a5fc00e66935a1de486e2c --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/material.py @@ -0,0 +1,124 @@ +""" + pygments.styles.material + ~~~~~~~~~~~~~~~~~~~~~~~~ + + Mimic the Material theme color scheme. + + https://github.com/material-theme/vsc-material-theme + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Escape, \ + Error, Text, Number, Operator, Generic, Punctuation, Literal + + +__all__ = ['MaterialStyle'] + + +class MaterialStyle(Style): + """ + This style mimics the Material Theme color scheme. + """ + name = 'material' + + dark_teal = '#263238' + white = '#FFFFFF' + black = '#000000' + red = '#FF5370' + orange = '#F78C6C' + yellow = '#FFCB6B' + green = '#C3E88D' + cyan = '#89DDFF' + blue = '#82AAFF' + paleblue = '#B2CCD6' + purple = '#C792EA' + brown = '#C17E70' + pink = '#F07178' + violet = '#BB80B3' + foreground = '#EEFFFF' + faded = '#546E7A' + + background_color = dark_teal + highlight_color = '#2C3B41' + line_number_color = '#37474F' + line_number_background_color = dark_teal + line_number_special_color = '#607A86' + line_number_special_background_color = dark_teal + + styles = { + Text: foreground, + Escape: cyan, + Error: red, + + Keyword: violet, + Keyword.Constant: cyan, + Keyword.Declaration: violet, + Keyword.Namespace: 'italic ' + cyan, + Keyword.Pseudo: cyan, + Keyword.Type: violet, + + Name: foreground, + Name.Attribute: violet, + Name.Builtin: blue, + Name.Builtin.Pseudo: cyan, + Name.Class: yellow, + Name.Constant: foreground, + Name.Decorator: blue, + Name.Entity: cyan, + Name.Exception: yellow, + Name.Function: blue, + Name.Function.Magic: blue, + Name.Label: blue, + Name.Property: yellow, + Name.Namespace: yellow, + Name.Other: foreground, + Name.Tag: red, + Name.Variable: cyan, + Name.Variable.Class: cyan, + Name.Variable.Global: cyan, + Name.Variable.Instance: cyan, + Name.Variable.Magic: blue, + + Literal: green, + Literal.Date: green, + + String: green, + String.Affix: violet, + String.Backtick: green, + String.Char: green, + String.Delimiter: foreground, + String.Doc: 'italic ' + faded, + String.Double: green, + String.Escape: foreground, + String.Heredoc: green, + String.Interpol: cyan, + String.Other: green, + String.Regex: cyan, + String.Single: green, + String.Symbol: cyan, + + Number: orange, + + Operator: cyan, + Operator.Word: 'italic ' + cyan, + + Punctuation: cyan, + + Comment: 'italic ' + faded, + + Generic: foreground, + Generic.Deleted: red, + Generic.Emph: cyan, + Generic.Error: red, + Generic.Heading: green, + Generic.Inserted: green, + Generic.Output: faded, + Generic.Prompt: yellow, + Generic.Strong: red, + Generic.EmphStrong: yellow, + Generic.Subheading: cyan, + Generic.Traceback: red, + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/monokai.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/monokai.py new file mode 100644 index 0000000000000000000000000000000000000000..4a6ac0cab543c19d0db7c463cc04e3b1a73f4f97 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/monokai.py @@ -0,0 +1,112 @@ +""" + pygments.styles.monokai + ~~~~~~~~~~~~~~~~~~~~~~~ + + Mimic the Monokai color scheme. Based on tango.py. + + http://www.monokai.nl/blog/2006/07/15/textmate-color-theme/ + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, Token, \ + Number, Operator, Generic, Whitespace, Punctuation, Other, Literal + + +__all__ = ['MonokaiStyle'] + + +class MonokaiStyle(Style): + """ + This style mimics the Monokai color scheme. + """ + name = 'monokai' + + background_color = "#272822" + highlight_color = "#49483e" + + styles = { + # No corresponding class for the following: + Token: "#f8f8f2", # class: '' + Whitespace: "", # class: 'w' + Error: "#ed007e bg:#1e0010", # class: 'err' + Other: "", # class 'x' + + Comment: "#959077", # class: 'c' + Comment.Multiline: "", # class: 'cm' + Comment.Preproc: "", # class: 'cp' + Comment.Single: "", # class: 'c1' + Comment.Special: "", # class: 'cs' + + Keyword: "#66d9ef", # class: 'k' + Keyword.Constant: "", # class: 'kc' + Keyword.Declaration: "", # class: 'kd' + Keyword.Namespace: "#ff4689", # class: 'kn' + Keyword.Pseudo: "", # class: 'kp' + Keyword.Reserved: "", # class: 'kr' + Keyword.Type: "", # class: 'kt' + + Operator: "#ff4689", # class: 'o' + Operator.Word: "", # class: 'ow' - like keywords + + Punctuation: "#f8f8f2", # class: 'p' + + Name: "#f8f8f2", # class: 'n' + Name.Attribute: "#a6e22e", # class: 'na' - to be revised + Name.Builtin: "", # class: 'nb' + Name.Builtin.Pseudo: "", # class: 'bp' + Name.Class: "#a6e22e", # class: 'nc' - to be revised + Name.Constant: "#66d9ef", # class: 'no' - to be revised + Name.Decorator: "#a6e22e", # class: 'nd' - to be revised + Name.Entity: "", # class: 'ni' + Name.Exception: "#a6e22e", # class: 'ne' + Name.Function: "#a6e22e", # class: 'nf' + Name.Property: "", # class: 'py' + Name.Label: "", # class: 'nl' + Name.Namespace: "", # class: 'nn' - to be revised + Name.Other: "#a6e22e", # class: 'nx' + Name.Tag: "#ff4689", # class: 'nt' - like a keyword + Name.Variable: "", # class: 'nv' - to be revised + Name.Variable.Class: "", # class: 'vc' - to be revised + Name.Variable.Global: "", # class: 'vg' - to be revised + Name.Variable.Instance: "", # class: 'vi' - to be revised + + Number: "#ae81ff", # class: 'm' + Number.Float: "", # class: 'mf' + Number.Hex: "", # class: 'mh' + Number.Integer: "", # class: 'mi' + Number.Integer.Long: "", # class: 'il' + Number.Oct: "", # class: 'mo' + + Literal: "#ae81ff", # class: 'l' + Literal.Date: "#e6db74", # class: 'ld' + + String: "#e6db74", # class: 's' + String.Backtick: "", # class: 'sb' + String.Char: "", # class: 'sc' + String.Doc: "", # class: 'sd' - like a comment + String.Double: "", # class: 's2' + String.Escape: "#ae81ff", # class: 'se' + String.Heredoc: "", # class: 'sh' + String.Interpol: "", # class: 'si' + String.Other: "", # class: 'sx' + String.Regex: "", # class: 'sr' + String.Single: "", # class: 's1' + String.Symbol: "", # class: 'ss' + + + Generic: "", # class: 'g' + Generic.Deleted: "#ff4689", # class: 'gd', + Generic.Emph: "italic", # class: 'ge' + Generic.Error: "", # class: 'gr' + Generic.Heading: "", # class: 'gh' + Generic.Inserted: "#a6e22e", # class: 'gi' + Generic.Output: "#66d9ef", # class: 'go' + Generic.Prompt: "bold #ff4689", # class: 'gp' + Generic.Strong: "bold", # class: 'gs' + Generic.EmphStrong: "bold italic", # class: 'ges' + Generic.Subheading: "#959077", # class: 'gu' + Generic.Traceback: "", # class: 'gt' + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/murphy.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/murphy.py new file mode 100644 index 0000000000000000000000000000000000000000..1299fd5b6bf48ef2039c143dbe4b74533cd09054 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/murphy.py @@ -0,0 +1,82 @@ +""" + pygments.styles.murphy + ~~~~~~~~~~~~~~~~~~~~~~ + + Murphy's style from CodeRay. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, \ + Number, Operator, Generic, Whitespace + + +__all__ = ['MurphyStyle'] + + +class MurphyStyle(Style): + """ + Murphy's style from CodeRay. + """ + name = 'murphy' + + styles = { + Whitespace: "#bbbbbb", + Comment: "#666 italic", + Comment.Preproc: "#579 noitalic", + Comment.Special: "#c00 bold", + + Keyword: "bold #289", + Keyword.Pseudo: "#08f", + Keyword.Type: "#66f", + + Operator: "#333", + Operator.Word: "bold #000", + + Name.Builtin: "#072", + Name.Function: "bold #5ed", + Name.Class: "bold #e9e", + Name.Namespace: "bold #0e84b5", + Name.Exception: "bold #F00", + Name.Variable: "#036", + Name.Variable.Instance: "#aaf", + Name.Variable.Class: "#ccf", + Name.Variable.Global: "#f84", + Name.Constant: "bold #5ed", + Name.Label: "bold #970", + Name.Entity: "#800", + Name.Attribute: "#007", + Name.Tag: "#070", + Name.Decorator: "bold #555", + + String: "bg:#e0e0ff", + String.Char: "#88F bg:", + String.Doc: "#D42 bg:", + String.Interpol: "bg:#eee", + String.Escape: "bold #666", + String.Regex: "bg:#e0e0ff #000", + String.Symbol: "#fc8 bg:", + String.Other: "#f88", + + Number: "bold #60E", + Number.Integer: "bold #66f", + Number.Float: "bold #60E", + Number.Hex: "bold #058", + Number.Oct: "bold #40E", + + Generic.Heading: "bold #000080", + Generic.Subheading: "bold #800080", + Generic.Deleted: "#A00000", + Generic.Inserted: "#00A000", + Generic.Error: "#FF0000", + Generic.Emph: "italic", + Generic.Strong: "bold", + Generic.EmphStrong: "bold italic", + Generic.Prompt: "bold #c65d09", + Generic.Output: "#888", + Generic.Traceback: "#04D", + + Error: "#F00 bg:#FAA" + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/native.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/native.py new file mode 100644 index 0000000000000000000000000000000000000000..c9f818dd53b87b884b12292708fecb5b4e002bba --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/native.py @@ -0,0 +1,70 @@ +""" + pygments.styles.native + ~~~~~~~~~~~~~~~~~~~~~~ + + pygments version of my "native" vim theme. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, \ + Number, Operator, Generic, Token, Whitespace + + +__all__ = ['NativeStyle'] + + +class NativeStyle(Style): + """ + Pygments version of the "native" vim theme. + """ + name = 'native' + + background_color = '#202020' + highlight_color = '#404040' + line_number_color = '#aaaaaa' + + styles = { + Token: '#d0d0d0', + Whitespace: '#666666', + + Comment: 'italic #ababab', + Comment.Preproc: 'noitalic bold #ff3a3a', + Comment.Special: 'noitalic bold #e50808 bg:#520000', + + Keyword: 'bold #6ebf26', + Keyword.Pseudo: 'nobold', + Operator.Word: 'bold #6ebf26', + + String: '#ed9d13', + String.Other: '#ffa500', + + Number: '#51b2fd', + + Name.Builtin: '#2fbccd', + Name.Variable: '#40ffff', + Name.Constant: '#40ffff', + Name.Class: 'underline #71adff', + Name.Function: '#71adff', + Name.Namespace: 'underline #71adff', + Name.Exception: '#bbbbbb', + Name.Tag: 'bold #6ebf26', + Name.Attribute: '#bbbbbb', + Name.Decorator: '#ffa500', + + Generic.Heading: 'bold #ffffff', + Generic.Subheading: 'underline #ffffff', + Generic.Deleted: '#ff3a3a', + Generic.Inserted: '#589819', + Generic.Error: '#ff3a3a', + Generic.Emph: 'italic', + Generic.Strong: 'bold', + Generic.EmphStrong: 'bold italic', + Generic.Prompt: '#aaaaaa', + Generic.Output: '#cccccc', + Generic.Traceback: '#ff3a3a', + + Error: 'bg:#e3d2d2 #a61717' + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/nord.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/nord.py new file mode 100644 index 0000000000000000000000000000000000000000..5481e968195a01fe82861b273357f9423b23c462 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/nord.py @@ -0,0 +1,156 @@ +""" + pygments.styles.nord + ~~~~~~~~~~~~~~~~~~~~ + + pygments version of the "nord" theme by Arctic Ice Studio + https://www.nordtheme.com/ + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, Number, \ + Operator, Generic, Whitespace, Punctuation, Text, Token + + +__all__ = ['NordStyle', 'NordDarkerStyle'] + + +class NordStyle(Style): + """ + Pygments version of the "nord" theme by Arctic Ice Studio. + """ + name = 'nord' + + line_number_color = "#D8DEE9" + line_number_background_color = "#242933" + line_number_special_color = "#242933" + line_number_special_background_color = "#D8DEE9" + + background_color = "#2E3440" + highlight_color = "#3B4252" + + styles = { + Token: "#d8dee9", + + Whitespace: '#d8dee9', + Punctuation: '#eceff4', + + Comment: 'italic #616e87', + Comment.Preproc: '#5e81ac', + + Keyword: 'bold #81a1c1', + Keyword.Pseudo: 'nobold #81a1c1', + Keyword.Type: 'nobold #81a1c1', + + Operator: 'bold #81a1c1', + Operator.Word: 'bold #81a1c1', + + Name: '#d8dee9', + Name.Builtin: '#81a1c1', + Name.Function: '#88c0d0', + Name.Class: '#8fbcbb', + Name.Namespace: '#8fbcbb', + Name.Exception: '#bf616a', + Name.Variable: '#d8dee9', + Name.Constant: '#8fbcbb', + Name.Entity: '#d08770', + Name.Attribute: '#8fbcbb', + Name.Tag: '#81a1c1', + Name.Decorator: '#d08770', + + String: '#a3be8c', + String.Doc: '#616e87', + String.Interpol: '#a3be8c', + String.Escape: '#ebcb8b', + String.Regex: '#ebcb8b', + String.Symbol: '#a3be8c', + String.Other: '#a3be8c', + + Number: '#b48ead', + + Generic.Heading: 'bold #88c0d0', + Generic.Subheading: 'bold #88c0d0', + Generic.Deleted: '#bf616a', + Generic.Inserted: '#a3be8c', + Generic.Error: '#bf616a', + Generic.Emph: 'italic', + Generic.Strong: 'bold', + Generic.EmphStrong: 'bold italic', + Generic.Prompt: 'bold #616e88', + Generic.Output: '#d8dee9', + Generic.Traceback: '#bf616a', + + Error: '#bf616a', + Text: '#d8dee9', + } + + +class NordDarkerStyle(Style): + """ + Pygments version of a darker "nord" theme by Arctic Ice Studio + """ + name = 'nord-darker' + + line_number_color = "#D8DEE9" + line_number_background_color = "#242933" + line_number_special_color = "#242933" + line_number_special_background_color = "#D8DEE9" + + background_color = "#242933" + highlight_color = "#3B4252" + + styles = { + Token: "#d8dee9", + + Whitespace: '#d8dee9', + Punctuation: '#eceff4', + + Comment: 'italic #616e87', + Comment.Preproc: '#5e81ac', + + Keyword: 'bold #81a1c1', + Keyword.Pseudo: 'nobold #81a1c1', + Keyword.Type: 'nobold #81a1c1', + + Operator: 'bold #81a1c1', + Operator.Word: 'bold #81a1c1', + + Name: '#d8dee9', + Name.Builtin: '#81a1c1', + Name.Function: '#88c0d0', + Name.Class: '#8fbcbb', + Name.Namespace: '#8fbcbb', + Name.Exception: '#bf616a', + Name.Variable: '#d8dee9', + Name.Constant: '#8fbcbb', + Name.Entity: '#d08770', + Name.Attribute: '#8fbcbb', + Name.Tag: '#81a1c1', + Name.Decorator: '#d08770', + + String: '#a3be8c', + String.Doc: '#616e87', + String.Interpol: '#a3be8c', + String.Escape: '#ebcb8b', + String.Regex: '#ebcb8b', + String.Symbol: '#a3be8c', + String.Other: '#a3be8c', + + Number: '#b48ead', + + Generic.Heading: 'bold #88c0d0', + Generic.Subheading: 'bold #88c0d0', + Generic.Deleted: '#bf616a', + Generic.Inserted: '#a3be8c', + Generic.Error: '#bf616a', + Generic.Emph: 'italic', + Generic.Strong: 'bold', + Generic.Prompt: 'bold #616e88', + Generic.Output: '#d8dee9', + Generic.Traceback: '#bf616a', + + Error: '#bf616a', + Text: '#d8dee9', + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/onedark.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/onedark.py new file mode 100644 index 0000000000000000000000000000000000000000..75c4b17a43e236192777df8559082514aa86e345 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/onedark.py @@ -0,0 +1,63 @@ +""" + pygments.styles.onedark + ~~~~~~~~~~~~~~~~~~~~~~~ + + One Dark Theme for Pygments by Tobias Zoghaib (https://github.com/TobiZog) + + Inspired by one-dark-ui for the code editor Atom + (https://atom.io/themes/one-dark-ui). + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Comment, Keyword, Name, Number, Operator, \ + Punctuation, String, Token + + +__all__ = ['OneDarkStyle'] + + +class OneDarkStyle(Style): + """ + Theme inspired by One Dark Pro for Atom. + + .. versionadded:: 2.11 + """ + name = 'one-dark' + + background_color = '#282C34' + + styles = { + Token: '#ABB2BF', + + Punctuation: '#ABB2BF', + Punctuation.Marker: '#ABB2BF', + + Keyword: '#C678DD', + Keyword.Constant: '#E5C07B', + Keyword.Declaration: '#C678DD', + Keyword.Namespace: '#C678DD', + Keyword.Reserved: '#C678DD', + Keyword.Type: '#E5C07B', + + Name: '#E06C75', + Name.Attribute: '#E06C75', + Name.Builtin: '#E5C07B', + Name.Class: '#E5C07B', + Name.Function: 'bold #61AFEF', + Name.Function.Magic: 'bold #56B6C2', + Name.Other: '#E06C75', + Name.Tag: '#E06C75', + Name.Decorator: '#61AFEF', + Name.Variable.Class: '', + + String: '#98C379', + + Number: '#D19A66', + + Operator: '#56B6C2', + + Comment: '#7F848E' + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/paraiso_dark.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/paraiso_dark.py new file mode 100644 index 0000000000000000000000000000000000000000..9983e60d021993975c64140ea6bbce1c607ed874 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/paraiso_dark.py @@ -0,0 +1,124 @@ +""" + pygments.styles.paraiso_dark + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Paraíso (Dark) by Jan T. Sott + + Pygments template by Jan T. Sott (https://github.com/idleberg) + Created with Base16 Builder by Chris Kempson + (https://github.com/chriskempson/base16-builder). + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, Text, \ + Number, Operator, Generic, Whitespace, Punctuation, Other, Literal + + +__all__ = ['ParaisoDarkStyle'] + + +BACKGROUND = "#2f1e2e" +CURRENT_LINE = "#41323f" +SELECTION = "#4f424c" +FOREGROUND = "#e7e9db" +COMMENT = "#776e71" +RED = "#ef6155" +ORANGE = "#f99b15" +YELLOW = "#fec418" +GREEN = "#48b685" +AQUA = "#5bc4bf" +BLUE = "#06b6ef" +PURPLE = "#815ba4" + + +class ParaisoDarkStyle(Style): + name = 'paraiso-dark' + + background_color = BACKGROUND + highlight_color = SELECTION + + styles = { + # No corresponding class for the following: + Text: FOREGROUND, # class: '' + Whitespace: "", # class: 'w' + Error: RED, # class: 'err' + Other: "", # class 'x' + + Comment: COMMENT, # class: 'c' + Comment.Multiline: "", # class: 'cm' + Comment.Preproc: "", # class: 'cp' + Comment.Single: "", # class: 'c1' + Comment.Special: "", # class: 'cs' + + Keyword: PURPLE, # class: 'k' + Keyword.Constant: "", # class: 'kc' + Keyword.Declaration: "", # class: 'kd' + Keyword.Namespace: AQUA, # class: 'kn' + Keyword.Pseudo: "", # class: 'kp' + Keyword.Reserved: "", # class: 'kr' + Keyword.Type: YELLOW, # class: 'kt' + + Operator: AQUA, # class: 'o' + Operator.Word: "", # class: 'ow' - like keywords + + Punctuation: FOREGROUND, # class: 'p' + + Name: FOREGROUND, # class: 'n' + Name.Attribute: BLUE, # class: 'na' - to be revised + Name.Builtin: "", # class: 'nb' + Name.Builtin.Pseudo: "", # class: 'bp' + Name.Class: YELLOW, # class: 'nc' - to be revised + Name.Constant: RED, # class: 'no' - to be revised + Name.Decorator: AQUA, # class: 'nd' - to be revised + Name.Entity: "", # class: 'ni' + Name.Exception: RED, # class: 'ne' + Name.Function: BLUE, # class: 'nf' + Name.Property: "", # class: 'py' + Name.Label: "", # class: 'nl' + Name.Namespace: YELLOW, # class: 'nn' - to be revised + Name.Other: BLUE, # class: 'nx' + Name.Tag: AQUA, # class: 'nt' - like a keyword + Name.Variable: RED, # class: 'nv' - to be revised + Name.Variable.Class: "", # class: 'vc' - to be revised + Name.Variable.Global: "", # class: 'vg' - to be revised + Name.Variable.Instance: "", # class: 'vi' - to be revised + + Number: ORANGE, # class: 'm' + Number.Float: "", # class: 'mf' + Number.Hex: "", # class: 'mh' + Number.Integer: "", # class: 'mi' + Number.Integer.Long: "", # class: 'il' + Number.Oct: "", # class: 'mo' + + Literal: ORANGE, # class: 'l' + Literal.Date: GREEN, # class: 'ld' + + String: GREEN, # class: 's' + String.Backtick: "", # class: 'sb' + String.Char: FOREGROUND, # class: 'sc' + String.Doc: COMMENT, # class: 'sd' - like a comment + String.Double: "", # class: 's2' + String.Escape: ORANGE, # class: 'se' + String.Heredoc: "", # class: 'sh' + String.Interpol: ORANGE, # class: 'si' + String.Other: "", # class: 'sx' + String.Regex: "", # class: 'sr' + String.Single: "", # class: 's1' + String.Symbol: "", # class: 'ss' + + Generic: "", # class: 'g' + Generic.Deleted: RED, # class: 'gd', + Generic.Emph: "italic", # class: 'ge' + Generic.Error: "", # class: 'gr' + Generic.Heading: "bold " + FOREGROUND, # class: 'gh' + Generic.Inserted: GREEN, # class: 'gi' + Generic.Output: "", # class: 'go' + Generic.Prompt: "bold " + COMMENT, # class: 'gp' + Generic.Strong: "bold", # class: 'gs' + Generic.EmphStrong: "bold italic", # class: 'ges' + Generic.Subheading: "bold " + AQUA, # class: 'gu' + Generic.Traceback: "", # class: 'gt' + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/paraiso_light.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/paraiso_light.py new file mode 100644 index 0000000000000000000000000000000000000000..903ad88d63f908607b1d848a13ece7203428bf23 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/paraiso_light.py @@ -0,0 +1,124 @@ +""" + pygments.styles.paraiso_light + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Paraíso (Light) by Jan T. Sott + + Pygments template by Jan T. Sott (https://github.com/idleberg) + Created with Base16 Builder by Chris Kempson + (https://github.com/chriskempson/base16-builder). + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, Text, \ + Number, Operator, Generic, Whitespace, Punctuation, Other, Literal + + +__all__ = ['ParaisoLightStyle'] + + +BACKGROUND = "#e7e9db" +CURRENT_LINE = "#b9b6b0" +SELECTION = "#a39e9b" +FOREGROUND = "#2f1e2e" +COMMENT = "#8d8687" +RED = "#ef6155" +ORANGE = "#f99b15" +YELLOW = "#fec418" +GREEN = "#48b685" +AQUA = "#5bc4bf" +BLUE = "#06b6ef" +PURPLE = "#815ba4" + + +class ParaisoLightStyle(Style): + name = 'paraiso-light' + + background_color = BACKGROUND + highlight_color = SELECTION + + styles = { + # No corresponding class for the following: + Text: FOREGROUND, # class: '' + Whitespace: "", # class: 'w' + Error: RED, # class: 'err' + Other: "", # class 'x' + + Comment: COMMENT, # class: 'c' + Comment.Multiline: "", # class: 'cm' + Comment.Preproc: "", # class: 'cp' + Comment.Single: "", # class: 'c1' + Comment.Special: "", # class: 'cs' + + Keyword: PURPLE, # class: 'k' + Keyword.Constant: "", # class: 'kc' + Keyword.Declaration: "", # class: 'kd' + Keyword.Namespace: AQUA, # class: 'kn' + Keyword.Pseudo: "", # class: 'kp' + Keyword.Reserved: "", # class: 'kr' + Keyword.Type: YELLOW, # class: 'kt' + + Operator: AQUA, # class: 'o' + Operator.Word: "", # class: 'ow' - like keywords + + Punctuation: FOREGROUND, # class: 'p' + + Name: FOREGROUND, # class: 'n' + Name.Attribute: BLUE, # class: 'na' - to be revised + Name.Builtin: "", # class: 'nb' + Name.Builtin.Pseudo: "", # class: 'bp' + Name.Class: YELLOW, # class: 'nc' - to be revised + Name.Constant: RED, # class: 'no' - to be revised + Name.Decorator: AQUA, # class: 'nd' - to be revised + Name.Entity: "", # class: 'ni' + Name.Exception: RED, # class: 'ne' + Name.Function: BLUE, # class: 'nf' + Name.Property: "", # class: 'py' + Name.Label: "", # class: 'nl' + Name.Namespace: YELLOW, # class: 'nn' - to be revised + Name.Other: BLUE, # class: 'nx' + Name.Tag: AQUA, # class: 'nt' - like a keyword + Name.Variable: RED, # class: 'nv' - to be revised + Name.Variable.Class: "", # class: 'vc' - to be revised + Name.Variable.Global: "", # class: 'vg' - to be revised + Name.Variable.Instance: "", # class: 'vi' - to be revised + + Number: ORANGE, # class: 'm' + Number.Float: "", # class: 'mf' + Number.Hex: "", # class: 'mh' + Number.Integer: "", # class: 'mi' + Number.Integer.Long: "", # class: 'il' + Number.Oct: "", # class: 'mo' + + Literal: ORANGE, # class: 'l' + Literal.Date: GREEN, # class: 'ld' + + String: GREEN, # class: 's' + String.Backtick: "", # class: 'sb' + String.Char: FOREGROUND, # class: 'sc' + String.Doc: COMMENT, # class: 'sd' - like a comment + String.Double: "", # class: 's2' + String.Escape: ORANGE, # class: 'se' + String.Heredoc: "", # class: 'sh' + String.Interpol: ORANGE, # class: 'si' + String.Other: "", # class: 'sx' + String.Regex: "", # class: 'sr' + String.Single: "", # class: 's1' + String.Symbol: "", # class: 'ss' + + Generic: "", # class: 'g' + Generic.Deleted: RED, # class: 'gd', + Generic.Emph: "italic", # class: 'ge' + Generic.Error: "", # class: 'gr' + Generic.Heading: "bold " + FOREGROUND, # class: 'gh' + Generic.Inserted: GREEN, # class: 'gi' + Generic.Output: "", # class: 'go' + Generic.Prompt: "bold " + COMMENT, # class: 'gp' + Generic.Strong: "bold", # class: 'gs' + Generic.EmphStrong: "bold italic", # class: 'ges' + Generic.Subheading: "bold " + AQUA, # class: 'gu' + Generic.Traceback: "", # class: 'gt' + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/pastie.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/pastie.py new file mode 100644 index 0000000000000000000000000000000000000000..819968e1a1bb1230c7772a018368507cce54e13c --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/pastie.py @@ -0,0 +1,78 @@ +""" + pygments.styles.pastie + ~~~~~~~~~~~~~~~~~~~~~~ + + Style similar to the `pastie`_ default style. + + .. _pastie: http://pastie.caboo.se/ + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, \ + Number, Operator, Generic, Whitespace + + +__all__ = ['PastieStyle'] + + +class PastieStyle(Style): + """ + Style similar to the pastie default style. + """ + + name = 'pastie' + + styles = { + Whitespace: '#bbbbbb', + Comment: '#888888', + Comment.Preproc: 'bold #cc0000', + Comment.Special: 'bg:#fff0f0 bold #cc0000', + + String: 'bg:#fff0f0 #dd2200', + String.Regex: 'bg:#fff0ff #008800', + String.Other: 'bg:#f0fff0 #22bb22', + String.Symbol: '#aa6600', + String.Interpol: '#3333bb', + String.Escape: '#0044dd', + + Operator.Word: '#008800', + + Keyword: 'bold #008800', + Keyword.Pseudo: 'nobold', + Keyword.Type: '#888888', + + Name.Class: 'bold #bb0066', + Name.Exception: 'bold #bb0066', + Name.Function: 'bold #0066bb', + Name.Property: 'bold #336699', + Name.Namespace: 'bold #bb0066', + Name.Builtin: '#003388', + Name.Variable: '#336699', + Name.Variable.Class: '#336699', + Name.Variable.Instance: '#3333bb', + Name.Variable.Global: '#dd7700', + Name.Constant: 'bold #003366', + Name.Tag: 'bold #bb0066', + Name.Attribute: '#336699', + Name.Decorator: '#555555', + Name.Label: 'italic #336699', + + Number: 'bold #0000DD', + + Generic.Heading: '#333', + Generic.Subheading: '#666', + Generic.Deleted: 'bg:#ffdddd #000000', + Generic.Inserted: 'bg:#ddffdd #000000', + Generic.Error: '#aa0000', + Generic.Emph: 'italic', + Generic.Strong: 'bold', + Generic.EmphStrong: 'bold italic', + Generic.Prompt: '#555555', + Generic.Output: '#888888', + Generic.Traceback: '#aa0000', + + Error: 'bg:#e3d2d2 #a61717' + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/perldoc.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/perldoc.py new file mode 100644 index 0000000000000000000000000000000000000000..e76697a9ae27db683581fe7a8329e72908f2c9cf --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/perldoc.py @@ -0,0 +1,73 @@ +""" + pygments.styles.perldoc + ~~~~~~~~~~~~~~~~~~~~~~~ + + Style similar to the style used in the `perldoc`_ code blocks. + + .. _perldoc: http://perldoc.perl.org/ + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, \ + Number, Operator, Generic, Whitespace + + +__all__ = ['PerldocStyle'] + + +class PerldocStyle(Style): + """ + Style similar to the style used in the perldoc code blocks. + """ + + name = 'perldoc' + + background_color = '#eeeedd' + + styles = { + Whitespace: '#bbbbbb', + Comment: '#228B22', + Comment.Preproc: '#1e889b', + Comment.Special: '#8B008B bold', + + String: '#CD5555', + String.Heredoc: '#1c7e71 italic', + String.Regex: '#B452CD', + String.Other: '#cb6c20', + String.Regex: '#1c7e71', + + Number: '#B452CD', + + Operator.Word: '#8B008B', + + Keyword: '#8B008B bold', + Keyword.Type: '#00688B', + + Name.Class: '#008b45 bold', + Name.Exception: '#008b45 bold', + Name.Function: '#008b45', + Name.Namespace: '#008b45 underline', + Name.Variable: '#00688B', + Name.Constant: '#00688B', + Name.Decorator: '#707a7c', + Name.Tag: '#8B008B bold', + Name.Attribute: '#658b00', + Name.Builtin: '#658b00', + + Generic.Heading: 'bold #000080', + Generic.Subheading: 'bold #800080', + Generic.Deleted: '#aa0000', + Generic.Inserted: '#00aa00', + Generic.Error: '#aa0000', + Generic.Emph: 'italic', + Generic.Strong: 'bold', + Generic.EmphStrong: 'bold italic', + Generic.Prompt: '#555555', + Generic.Output: '#888888', + Generic.Traceback: '#aa0000', + + Error: 'bg:#e3d2d2 #a61717' + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/rainbow_dash.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/rainbow_dash.py new file mode 100644 index 0000000000000000000000000000000000000000..f98d5ef08e929f8d2f5ec86fc3506c120b69eec3 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/rainbow_dash.py @@ -0,0 +1,95 @@ +""" + pygments.styles.rainbow_dash + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + A bright and colorful syntax highlighting `theme`. + + .. _theme: http://sanssecours.github.io/Rainbow-Dash.tmbundle + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Comment, Error, Generic, Name, Number, Operator, \ + String, Text, Whitespace, Keyword + + +__all__ = ['RainbowDashStyle'] + + +BLUE_LIGHT = '#0080ff' +BLUE = '#2c5dcd' +GREEN = '#00cc66' +GREEN_LIGHT = '#ccffcc' +GREEN_NEON = '#00cc00' +GREY = '#aaaaaa' +GREY_LIGHT = '#cbcbcb' +GREY_DARK = '#4d4d4d' +PURPLE = '#5918bb' +RED = '#cc0000' +RED_DARK = '#c5060b' +RED_LIGHT = '#ffcccc' +RED_BRIGHT = '#ff0000' +WHITE = '#ffffff' +TURQUOISE = '#318495' +ORANGE = '#ff8000' + + +class RainbowDashStyle(Style): + """ + A bright and colorful syntax highlighting theme. + """ + + name = 'rainbow_dash' + + background_color = WHITE + + styles = { + Comment: f'italic {BLUE_LIGHT}', + Comment.Preproc: 'noitalic', + Comment.Special: 'bold', + + Error: f'bg:{RED} {WHITE}', + + Generic.Deleted: f'border:{RED_DARK} bg:{RED_LIGHT}', + Generic.Emph: 'italic', + Generic.Error: RED_BRIGHT, + Generic.Heading: f'bold {BLUE}', + Generic.Inserted: f'border:{GREEN_NEON} bg:{GREEN_LIGHT}', + Generic.Output: GREY, + Generic.Prompt: f'bold {BLUE}', + Generic.Strong: 'bold', + Generic.EmphStrong: 'bold italic', + Generic.Subheading: f'bold {BLUE}', + Generic.Traceback: RED_DARK, + + Keyword: f'bold {BLUE}', + Keyword.Pseudo: 'nobold', + Keyword.Type: PURPLE, + + Name.Attribute: f'italic {BLUE}', + Name.Builtin: f'bold {PURPLE}', + Name.Class: 'underline', + Name.Constant: TURQUOISE, + Name.Decorator: f'bold {ORANGE}', + Name.Entity: f'bold {PURPLE}', + Name.Exception: f'bold {PURPLE}', + Name.Function: f'bold {ORANGE}', + Name.Tag: f'bold {BLUE}', + + Number: f'bold {PURPLE}', + + Operator: BLUE, + Operator.Word: 'bold', + + String: GREEN, + String.Doc: 'italic', + String.Escape: f'bold {RED_DARK}', + String.Other: TURQUOISE, + String.Symbol: f'bold {RED_DARK}', + + Text: GREY_DARK, + + Whitespace: GREY_LIGHT + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/rrt.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/rrt.py new file mode 100644 index 0000000000000000000000000000000000000000..1e87d26251795a92e556ae459f6c78f95aded1d7 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/rrt.py @@ -0,0 +1,40 @@ +""" + pygments.styles.rrt + ~~~~~~~~~~~~~~~~~~~ + + pygments "rrt" theme, based on Zap and Emacs defaults. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Token, Comment, Name, Keyword, String, Number, Operator + + +__all__ = ['RrtStyle'] + + +class RrtStyle(Style): + """ + Minimalistic "rrt" theme, based on Zap and Emacs defaults. + """ + + name = 'rrt' + + background_color = '#000000' + highlight_color = '#0000ff' + + styles = { + Token: '#dddddd', + Comment: '#00ff00', + Name.Function: '#ffff00', + Name.Variable: '#eedd82', + Name.Constant: '#7fffd4', + Keyword: '#ff0000', + Operator.Word: '#ff0000', + Comment.Preproc: '#e5e5e5', + String: '#87ceeb', + Keyword.Type: '#ee82ee', + Number: '#ff00ff', + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/sas.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/sas.py new file mode 100644 index 0000000000000000000000000000000000000000..549a0cc9fac0cecf1c58715f47faf0da72566747 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/sas.py @@ -0,0 +1,46 @@ +""" + pygments.styles.sas + ~~~~~~~~~~~~~~~~~~~ + + Style inspired by SAS' enhanced program editor. Note This is not + meant to be a complete style. It's merely meant to mimic SAS' + program editor syntax highlighting. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, \ + Number, Other, Whitespace, Generic + + +__all__ = ['SasStyle'] + + +class SasStyle(Style): + """ + Style inspired by SAS' enhanced program editor. Note This is not + meant to be a complete style. It's merely meant to mimic SAS' + program editor syntax highlighting. + """ + + name = 'sas' + + styles = { + Whitespace: '#bbbbbb', + Comment: 'italic #008800', + String: '#800080', + Number: 'bold #2c8553', + Other: 'bg:#ffffe0', + Keyword: '#2c2cff', + Keyword.Reserved: 'bold #353580', + Keyword.Constant: 'bold', + Name.Builtin: '#2c2cff', + Name.Function: 'bold italic', + Name.Variable: 'bold #2c2cff', + Generic: '#2c2cff', + Generic.Emph: '#008800', + Generic.Error: '#d30202', + Error: 'bg:#e3d2d2 #a61717' + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/solarized.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/solarized.py new file mode 100644 index 0000000000000000000000000000000000000000..c0517024503af0a71199c0e658e1194f0371fae6 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/solarized.py @@ -0,0 +1,144 @@ +""" + pygments.styles.solarized + ~~~~~~~~~~~~~~~~~~~~~~~~~ + + Solarized by Camil Staps + + A Pygments style for the Solarized themes (licensed under MIT). + See: https://github.com/altercation/solarized + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Comment, Error, Generic, Keyword, Name, Number, \ + Operator, String, Token + + +__all__ = ['SolarizedLightStyle', 'SolarizedDarkStyle'] + + +def make_style(colors): + return { + Token: colors['base0'], + + Comment: 'italic ' + colors['base01'], + Comment.Hashbang: colors['base01'], + Comment.Multiline: colors['base01'], + Comment.Preproc: 'noitalic ' + colors['magenta'], + Comment.PreprocFile: 'noitalic ' + colors['base01'], + + Keyword: colors['green'], + Keyword.Constant: colors['cyan'], + Keyword.Declaration: colors['cyan'], + Keyword.Namespace: colors['orange'], + Keyword.Type: colors['yellow'], + + Operator: colors['base01'], + Operator.Word: colors['green'], + + Name.Builtin: colors['blue'], + Name.Builtin.Pseudo: colors['blue'], + Name.Class: colors['blue'], + Name.Constant: colors['blue'], + Name.Decorator: colors['blue'], + Name.Entity: colors['blue'], + Name.Exception: colors['blue'], + Name.Function: colors['blue'], + Name.Function.Magic: colors['blue'], + Name.Label: colors['blue'], + Name.Namespace: colors['blue'], + Name.Tag: colors['blue'], + Name.Variable: colors['blue'], + Name.Variable.Global:colors['blue'], + Name.Variable.Magic: colors['blue'], + + String: colors['cyan'], + String.Doc: colors['base01'], + String.Regex: colors['orange'], + + Number: colors['cyan'], + + Generic: colors['base0'], + Generic.Deleted: colors['red'], + Generic.Emph: 'italic', + Generic.Error: colors['red'], + Generic.Heading: 'bold', + Generic.Subheading: 'underline', + Generic.Inserted: colors['green'], + Generic.Output: colors['base0'], + Generic.Prompt: 'bold ' + colors['blue'], + Generic.Strong: 'bold', + Generic.EmphStrong: 'bold italic', + Generic.Traceback: colors['blue'], + + Error: 'bg:' + colors['red'], + } + + +DARK_COLORS = { + 'base03': '#002b36', + 'base02': '#073642', + 'base01': '#586e75', + 'base00': '#657b83', + 'base0': '#839496', + 'base1': '#93a1a1', + 'base2': '#eee8d5', + 'base3': '#fdf6e3', + 'yellow': '#b58900', + 'orange': '#cb4b16', + 'red': '#dc322f', + 'magenta': '#d33682', + 'violet': '#6c71c4', + 'blue': '#268bd2', + 'cyan': '#2aa198', + 'green': '#859900', +} + +LIGHT_COLORS = { + 'base3': '#002b36', + 'base2': '#073642', + 'base1': '#586e75', + 'base0': '#657b83', + 'base00': '#839496', + 'base01': '#93a1a1', + 'base02': '#eee8d5', + 'base03': '#fdf6e3', + 'yellow': '#b58900', + 'orange': '#cb4b16', + 'red': '#dc322f', + 'magenta': '#d33682', + 'violet': '#6c71c4', + 'blue': '#268bd2', + 'cyan': '#2aa198', + 'green': '#859900', +} + + +class SolarizedDarkStyle(Style): + """ + The solarized style, dark. + """ + + name = 'solarized-dark' + + styles = make_style(DARK_COLORS) + background_color = DARK_COLORS['base03'] + highlight_color = DARK_COLORS['base02'] + line_number_color = DARK_COLORS['base01'] + line_number_background_color = DARK_COLORS['base02'] + + +class SolarizedLightStyle(SolarizedDarkStyle): + """ + The solarized style, light. + """ + + name = 'solarized-light' + + styles = make_style(LIGHT_COLORS) + background_color = LIGHT_COLORS['base03'] + highlight_color = LIGHT_COLORS['base02'] + line_number_color = LIGHT_COLORS['base01'] + line_number_background_color = LIGHT_COLORS['base02'] diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/staroffice.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/staroffice.py new file mode 100644 index 0000000000000000000000000000000000000000..a21aa4157433b1ab8da816900d501514ca388537 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/staroffice.py @@ -0,0 +1,31 @@ +""" + pygments.styles.staroffice + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Style similar to StarOffice style, also in OpenOffice and LibreOffice. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Comment, Error, Literal, Name, Token + + +__all__ = ['StarofficeStyle'] + + +class StarofficeStyle(Style): + """ + Style similar to StarOffice style, also in OpenOffice and LibreOffice. + """ + name = 'staroffice' + + + styles = { + Token: '#000080', # Blue + Comment: '#696969', # DimGray + Error: '#800000', # Maroon + Literal: '#EE0000', # Red + Name: '#008000', # Green + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/stata_dark.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/stata_dark.py new file mode 100644 index 0000000000000000000000000000000000000000..315c5c6abc0fb0bc84a1bbed5a1c60d3c5022ee8 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/stata_dark.py @@ -0,0 +1,42 @@ +""" + pygments.styles.stata_dark + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Dark style inspired by Stata's do-file editor. Note this is not + meant to be a complete style, just for Stata's file formats. + + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Token, Keyword, Name, Comment, String, Error, \ + Number, Operator, Whitespace, Generic + + +__all__ = ['StataDarkStyle'] + + +class StataDarkStyle(Style): + name = 'stata-dark' + + background_color = "#232629" + highlight_color = "#49483e" + + styles = { + Token: '#cccccc', + Whitespace: '#bbbbbb', + Error: 'bg:#e3d2d2 #a61717', + String: '#51cc99', + Number: '#4FB8CC', + Operator: '', + Name.Function: '#6a6aff', + Name.Other: '#e2828e', + Keyword: 'bold #7686bb', + Keyword.Constant: '', + Comment: 'italic #777777', + Name.Variable: 'bold #7AB4DB', + Name.Variable.Global: 'bold #BE646C', + Generic.Prompt: '#ffffff', + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/stata_light.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/stata_light.py new file mode 100644 index 0000000000000000000000000000000000000000..95d72e2f3d6d700bcf8445d74e6554c400e7c3b1 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/stata_light.py @@ -0,0 +1,42 @@ +""" + pygments.styles.stata_light + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Light Style inspired by Stata's do-file editor. Note this is not + meant to be a complete style, just for Stata's file formats. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, \ + Number, Operator, Whitespace, Text + + +__all__ = ['StataLightStyle'] + + +class StataLightStyle(Style): + """ + Light mode style inspired by Stata's do-file editor. This is not + meant to be a complete style, just for use with Stata. + """ + + name = 'stata-light' + + styles = { + Text: '#111111', + Whitespace: '#bbbbbb', + Error: 'bg:#e3d2d2 #a61717', + String: '#7a2424', + Number: '#2c2cff', + Operator: '', + Name.Function: '#2c2cff', + Name.Other: '#be646c', + Keyword: 'bold #353580', + Keyword.Constant: '', + Comment: 'italic #008800', + Name.Variable: 'bold #35baba', + Name.Variable.Global: 'bold #b5565e', + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/tango.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/tango.py new file mode 100644 index 0000000000000000000000000000000000000000..986e3ffe6cc5b11178bc1845293c4da79b8b4014 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/tango.py @@ -0,0 +1,143 @@ +""" + pygments.styles.tango + ~~~~~~~~~~~~~~~~~~~~~ + + The Crunchy default Style inspired from the color palette from + the Tango Icon Theme Guidelines. + + http://tango.freedesktop.org/Tango_Icon_Theme_Guidelines + + Butter: #fce94f #edd400 #c4a000 + Orange: #fcaf3e #f57900 #ce5c00 + Chocolate: #e9b96e #c17d11 #8f5902 + Chameleon: #8ae234 #73d216 #4e9a06 + Sky Blue: #729fcf #3465a4 #204a87 + Plum: #ad7fa8 #75507b #5c35cc + Scarlet Red:#ef2929 #cc0000 #a40000 + Aluminium: #eeeeec #d3d7cf #babdb6 + #888a85 #555753 #2e3436 + + Not all of the above colors are used; other colors added: + very light grey: #f8f8f8 (for background) + + This style can be used as a template as it includes all the known + Token types, unlike most (if not all) of the styles included in the + Pygments distribution. + + However, since Crunchy is intended to be used by beginners, we have strived + to create a style that gloss over subtle distinctions between different + categories. + + Taking Python for example, comments (Comment.*) and docstrings (String.Doc) + have been chosen to have the same style. Similarly, keywords (Keyword.*), + and Operator.Word (and, or, in) have been assigned the same style. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, \ + Number, Operator, Generic, Whitespace, Punctuation, Other, Literal + + +__all__ = ['TangoStyle'] + + +class TangoStyle(Style): + """ + The Crunchy default Style inspired from the color palette from + the Tango Icon Theme Guidelines. + """ + + name = 'tango' + + background_color = "#f8f8f8" + + styles = { + # No corresponding class for the following: + #Text: "", # class: '' + Whitespace: "#f8f8f8", # class: 'w' + Error: "#a40000 border:#ef2929", # class: 'err' + Other: "#000000", # class 'x' + + Comment: "italic #8f5902", # class: 'c' + Comment.Multiline: "italic #8f5902", # class: 'cm' + Comment.Preproc: "italic #8f5902", # class: 'cp' + Comment.Single: "italic #8f5902", # class: 'c1' + Comment.Special: "italic #8f5902", # class: 'cs' + + Keyword: "bold #204a87", # class: 'k' + Keyword.Constant: "bold #204a87", # class: 'kc' + Keyword.Declaration: "bold #204a87", # class: 'kd' + Keyword.Namespace: "bold #204a87", # class: 'kn' + Keyword.Pseudo: "bold #204a87", # class: 'kp' + Keyword.Reserved: "bold #204a87", # class: 'kr' + Keyword.Type: "bold #204a87", # class: 'kt' + + Operator: "bold #ce5c00", # class: 'o' + Operator.Word: "bold #204a87", # class: 'ow' - like keywords + + Punctuation: "bold #000000", # class: 'p' + + # because special names such as Name.Class, Name.Function, etc. + # are not recognized as such later in the parsing, we choose them + # to look the same as ordinary variables. + Name: "#000000", # class: 'n' + Name.Attribute: "#c4a000", # class: 'na' - to be revised + Name.Builtin: "#204a87", # class: 'nb' + Name.Builtin.Pseudo: "#3465a4", # class: 'bp' + Name.Class: "#000000", # class: 'nc' - to be revised + Name.Constant: "#000000", # class: 'no' - to be revised + Name.Decorator: "bold #5c35cc", # class: 'nd' - to be revised + Name.Entity: "#ce5c00", # class: 'ni' + Name.Exception: "bold #cc0000", # class: 'ne' + Name.Function: "#000000", # class: 'nf' + Name.Property: "#000000", # class: 'py' + Name.Label: "#f57900", # class: 'nl' + Name.Namespace: "#000000", # class: 'nn' - to be revised + Name.Other: "#000000", # class: 'nx' + Name.Tag: "bold #204a87", # class: 'nt' - like a keyword + Name.Variable: "#000000", # class: 'nv' - to be revised + Name.Variable.Class: "#000000", # class: 'vc' - to be revised + Name.Variable.Global: "#000000", # class: 'vg' - to be revised + Name.Variable.Instance: "#000000", # class: 'vi' - to be revised + + # since the tango light blue does not show up well in text, we choose + # a pure blue instead. + Number: "bold #0000cf", # class: 'm' + Number.Float: "bold #0000cf", # class: 'mf' + Number.Hex: "bold #0000cf", # class: 'mh' + Number.Integer: "bold #0000cf", # class: 'mi' + Number.Integer.Long: "bold #0000cf", # class: 'il' + Number.Oct: "bold #0000cf", # class: 'mo' + + Literal: "#000000", # class: 'l' + Literal.Date: "#000000", # class: 'ld' + + String: "#4e9a06", # class: 's' + String.Backtick: "#4e9a06", # class: 'sb' + String.Char: "#4e9a06", # class: 'sc' + String.Doc: "italic #8f5902", # class: 'sd' - like a comment + String.Double: "#4e9a06", # class: 's2' + String.Escape: "#4e9a06", # class: 'se' + String.Heredoc: "#4e9a06", # class: 'sh' + String.Interpol: "#4e9a06", # class: 'si' + String.Other: "#4e9a06", # class: 'sx' + String.Regex: "#4e9a06", # class: 'sr' + String.Single: "#4e9a06", # class: 's1' + String.Symbol: "#4e9a06", # class: 'ss' + + Generic: "#000000", # class: 'g' + Generic.Deleted: "#a40000", # class: 'gd' + Generic.Emph: "italic #000000", # class: 'ge' + Generic.Error: "#ef2929", # class: 'gr' + Generic.Heading: "bold #000080", # class: 'gh' + Generic.Inserted: "#00A000", # class: 'gi' + Generic.Output: "italic #000000", # class: 'go' + Generic.Prompt: "#8f5902", # class: 'gp' + Generic.Strong: "bold #000000", # class: 'gs' + Generic.EmphStrong: "bold italic #000000", # class: 'ges' + Generic.Subheading: "bold #800080", # class: 'gu' + Generic.Traceback: "bold #a40000", # class: 'gt' + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/trac.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/trac.py new file mode 100644 index 0000000000000000000000000000000000000000..2dbffa468b6b5a2b5a1e13e724d97f88843a1a56 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/trac.py @@ -0,0 +1,66 @@ +""" + pygments.styles.trac + ~~~~~~~~~~~~~~~~~~~~ + + Port of the default trac highlighter design. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, \ + Number, Operator, Generic, Whitespace + + +__all__ = ['TracStyle'] + + +class TracStyle(Style): + """ + Port of the default trac highlighter design. + """ + + name = 'trac' + + styles = { + Whitespace: '#bbbbbb', + Comment: 'italic #999988', + Comment.Preproc: 'bold noitalic #999999', + Comment.Special: 'bold #999999', + + Operator: 'bold', + + String: '#bb8844', + String.Regex: '#808000', + + Number: '#009999', + + Keyword: 'bold', + Keyword.Type: '#445588', + + Name.Builtin: '#999999', + Name.Function: 'bold #990000', + Name.Class: 'bold #445588', + Name.Exception: 'bold #990000', + Name.Namespace: '#555555', + Name.Variable: '#008080', + Name.Constant: '#008080', + Name.Tag: '#000080', + Name.Attribute: '#008080', + Name.Entity: '#800080', + + Generic.Heading: '#999999', + Generic.Subheading: '#aaaaaa', + Generic.Deleted: 'bg:#ffdddd #000000', + Generic.Inserted: 'bg:#ddffdd #000000', + Generic.Error: '#aa0000', + Generic.Emph: 'italic', + Generic.Strong: 'bold', + Generic.EmphStrong: 'bold italic', + Generic.Prompt: '#555555', + Generic.Output: '#888888', + Generic.Traceback: '#aa0000', + + Error: 'bg:#e3d2d2 #a61717' + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/vim.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/vim.py new file mode 100644 index 0000000000000000000000000000000000000000..6b53d0080226aca51c83c91845ae8d8c8f3d439e --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/vim.py @@ -0,0 +1,67 @@ +""" + pygments.styles.vim + ~~~~~~~~~~~~~~~~~~~ + + A highlighting style for Pygments, inspired by vim. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, \ + Number, Operator, Generic, Whitespace, Token + + +__all__ = ['VimStyle'] + + +class VimStyle(Style): + """ + Styles somewhat like vim 7.0 + """ + + name = 'vim' + + background_color = "#000000" + highlight_color = "#222222" + + styles = { + Token: "#cccccc", + Whitespace: "", + Comment: "#000080", + Comment.Preproc: "", + Comment.Special: "bold #cd0000", + + Keyword: "#cdcd00", + Keyword.Declaration: "#00cd00", + Keyword.Namespace: "#cd00cd", + Keyword.Pseudo: "", + Keyword.Type: "#00cd00", + + Operator: "#3399cc", + Operator.Word: "#cdcd00", + + Name: "", + Name.Class: "#00cdcd", + Name.Builtin: "#cd00cd", + Name.Exception: "bold #666699", + Name.Variable: "#00cdcd", + + String: "#cd0000", + Number: "#cd00cd", + + Generic.Heading: "bold #000080", + Generic.Subheading: "bold #800080", + Generic.Deleted: "#cd0000", + Generic.Inserted: "#00cd00", + Generic.Error: "#FF0000", + Generic.Emph: "italic", + Generic.Strong: "bold", + Generic.EmphStrong: "bold italic", + Generic.Prompt: "bold #000080", + Generic.Output: "#888", + Generic.Traceback: "#04D", + + Error: "border:#FF0000" + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/vs.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/vs.py new file mode 100644 index 0000000000000000000000000000000000000000..9ac18c7818b05543467d1bdce8731be4ed4204d9 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/vs.py @@ -0,0 +1,41 @@ +""" + pygments.styles.vs + ~~~~~~~~~~~~~~~~~~ + + Simple style with MS Visual Studio colors. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, \ + Operator, Generic + + +__all__ = ['VisualStudioStyle'] + + +class VisualStudioStyle(Style): + name = 'vs' + + background_color = "#ffffff" + + styles = { + Comment: "#008000", + Comment.Preproc: "#0000ff", + Keyword: "#0000ff", + Operator.Word: "#0000ff", + Keyword.Type: "#2b91af", + Name.Class: "#2b91af", + String: "#a31515", + + Generic.Heading: "bold", + Generic.Subheading: "bold", + Generic.Emph: "italic", + Generic.Strong: "bold", + Generic.EmphStrong: "bold italic", + Generic.Prompt: "bold", + + Error: "border:#FF0000" + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/xcode.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/xcode.py new file mode 100644 index 0000000000000000000000000000000000000000..9ef7c8f1850b9fc561b7a2d286b00279b13a19cc --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/xcode.py @@ -0,0 +1,53 @@ +""" + pygments.styles.xcode + ~~~~~~~~~~~~~~~~~~~~~ + + Style similar to the `Xcode` default theme. + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Keyword, Name, Comment, String, Error, \ + Number, Operator, Literal + + +__all__ = ['XcodeStyle'] + + +class XcodeStyle(Style): + """ + Style similar to the Xcode default colouring theme. + """ + + name = 'xcode' + + styles = { + Comment: '#177500', + Comment.Preproc: '#633820', + + String: '#C41A16', + String.Char: '#2300CE', + + Operator: '#000000', + + Keyword: '#A90D91', + + Name: '#000000', + Name.Attribute: '#836C28', + Name.Class: '#3F6E75', + Name.Function: '#000000', + Name.Builtin: '#A90D91', + # In Obj-C code this token is used to colour Cocoa types + Name.Builtin.Pseudo: '#5B269A', + Name.Variable: '#000000', + Name.Tag: '#000000', + Name.Decorator: '#000000', + # Workaround for a BUG here: lexer treats multiline method signatres as labels + Name.Label: '#000000', + + Literal: '#1C01CE', + Number: '#1C01CE', + Error: '#000000', + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/zenburn.py b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/zenburn.py new file mode 100644 index 0000000000000000000000000000000000000000..4d0e0567fcb9d52d28a47fd77e93672ffd14d1d5 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pygments/styles/zenburn.py @@ -0,0 +1,83 @@ +""" + pygments.styles.zenburn + ~~~~~~~~~~~~~~~~~~~~~~~ + + Low contrast color scheme Zenburn. + + See: https://kippura.org/zenburnpage/ + https://github.com/jnurmine/Zenburn + + :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import Token, Name, Operator, Keyword, Generic, Comment, \ + Number, String, Literal, Punctuation, Error + + +__all__ = ['ZenburnStyle'] + + +class ZenburnStyle(Style): + """ + Low contrast Zenburn style. + """ + + name = 'zenburn' + + background_color = '#3f3f3f' + highlight_color = '#484848' + line_number_color = '#5d6262' + line_number_background_color = '#353535' + line_number_special_color = '#7a8080' + line_number_special_background_color = '#353535' + + styles = { + Token: '#dcdccc', + Error: '#e37170 bold', + + Keyword: '#efdcbc', + Keyword.Type: '#dfdfbf bold', + Keyword.Constant: '#dca3a3', + Keyword.Declaration: '#f0dfaf', + Keyword.Namespace: '#f0dfaf', + + Name: '#dcdccc', + Name.Tag: '#e89393 bold', + Name.Entity: '#cfbfaf', + Name.Constant: '#dca3a3', + Name.Class: '#efef8f', + Name.Function: '#efef8f', + Name.Builtin: '#efef8f', + Name.Builtin.Pseudo: '#dcdccc', + Name.Attribute: '#efef8f', + Name.Exception: '#c3bf9f bold', + + Literal: '#9fafaf', + + String: '#cc9393', + String.Doc: '#7f9f7f', + String.Interpol: '#dca3a3 bold', + + Number: '#8cd0d3', + Number.Float: '#c0bed1', + + Operator: '#f0efd0', + + Punctuation: '#f0efd0', + + Comment: '#7f9f7f italic', + Comment.Preproc: '#dfaf8f bold', + Comment.PreprocFile: '#cc9393', + Comment.Special: '#dfdfdf bold', + + Generic: '#ecbcbc bold', + Generic.Emph: '#ffffff bold', + Generic.Output: '#5b605e bold', + Generic.Heading: '#efefef bold', + Generic.Deleted: '#c3bf9f bg:#313c36', + Generic.Inserted: '#709080 bg:#313c36 bold', + Generic.Traceback: '#80d4aa bg:#2f2f2f bold', + Generic.Subheading: '#efefef bold', + } diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pyparsing-3.3.2.dist-info/licenses/LICENSE b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing-3.3.2.dist-info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..f9f48d0619a386cd812261b41b04016207b72d5b --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing-3.3.2.dist-info/licenses/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2003-2025 Paul McGuire + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/__pycache__/__init__.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..621034cb6145d3aab96fb8df3396ade5441d9fe6 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/__pycache__/__init__.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/__pycache__/actions.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/__pycache__/actions.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..153567f298daac3a02807fc82e7eaf7abbc32d59 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/__pycache__/actions.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/__pycache__/common.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/__pycache__/common.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e6ee41b7ca8a1b564ce09c07ec3bc717a65169a8 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/__pycache__/common.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/__pycache__/exceptions.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/__pycache__/exceptions.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d1ac3083ad40a229cb98d4c966edee3fd5a2bf21 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/__pycache__/exceptions.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/__pycache__/helpers.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/__pycache__/helpers.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7db365151aad2146e762a5ed11532d77c6425e25 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/__pycache__/helpers.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/__pycache__/results.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/__pycache__/results.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..94135cf57c940632b70433ccd36b79d605c2cddd Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/__pycache__/results.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/__pycache__/testing.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/__pycache__/testing.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f6fb4bdcc14233f72857867afe8a083740d7fc05 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/__pycache__/testing.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/__pycache__/unicode.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/__pycache__/unicode.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..367211bb3ee73869f343413b6e2e278249685026 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/__pycache__/unicode.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/__pycache__/util.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/__pycache__/util.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c3f8516a3decc113c42d57b19d7e18b8c408341c Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/__pycache__/util.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/__pycache__/warnings.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/__pycache__/warnings.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cbe12ef1c52ec97da2b2e2bbc0496e0faabc1eab Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/__pycache__/warnings.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/ai/__init__.py b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/ai/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/ai/__pycache__/__init__.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/ai/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a9a976eb70836ec83f4ec777923bf91117411a50 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/ai/__pycache__/__init__.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/ai/best_practices.md b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/ai/best_practices.md new file mode 100644 index 0000000000000000000000000000000000000000..94aa52d8f42579e90ddff66d53efc1626f27ff41 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/ai/best_practices.md @@ -0,0 +1,75 @@ + + +## Planning +- If not provided or if target language definition is ambiguous, ask for examples of valid strings to be parsed +- Before developing the pyparsing expressions, define a Backus-Naur Form definition and save this in docs/grammar.md. Update this document as changes are made in the parser. + +## Implementing +- Import pyparsing using `import pyparsing as pp`, and use that for all pyparsing references. + - If referencing names from `pyparsing.common`, follow the pyparsing import with "ppc = pp.common" and use `ppc` as the namespace to access `pyparsing.common`. + - If referencing names from `pyparsing.unicode`, follow the pyparsing import with "ppu = pp.unicode" and use `ppu` as the namespace to access `pyparsing.unicode`. +- When writing parsers that contain recursive elements (using `Forward()` or `infix_notation()`), immediately enable packrat parsing for performance: `pp.ParserElement.enable_packrat()` (call this right after importing pyparsing). See https://pyparsing-docs.readthedocs.io/en/latest/HowToUsePyparsing.html. + - For recursive grammars, define placeholders with `pp.Forward()` and assign later using the `<<=` operator; give Forwards meaningful names with `set_name()` to improve errors. +- Use PEP8 method and argument names in the pyparsing API (`parse_string`, not `parseString`). +- Do not include expressions for matching whitespace in the grammar. Pyparsing skips whitespace by default. +- For line-oriented grammars where newlines are significant, set skippable whitespace to just spaces/tabs early: `pp.ParserElement.set_default_whitespace_chars(" \t")`, and define `NL = pp.LineEnd().suppress()` to handle line ends explicitly. +- Prefer operator forms for readability: use +, |, ^, ~, etc., instead of explicit And/MatchFirst/Or/Not classes (see Usage notes in https://pyparsing-docs.readthedocs.io/en/latest/HowToUsePyparsing.html). +- Use `set_name()` on all major grammar elements to support railroad diagramming and better error/debug output. +- The grammar should be independently testable, without pulling in separate modules for data structures, evaluation, or command execution. +- Use results names for robust access to parsed data fields; results names should be valid Python identifiers to support attribute-style access on returned ParseResults. + - Results names should take the place of numeric indexing into parsed results in most places. + - Define results names using call format not `set_results_name()`, example: `full_name = Word(alphas)("first_name") + Word(alphas)("last_name")` + - If adding results name to an expression that is contains one more sub-expressions with results names, the expression must be inclused in a Group. +- Prefer `Keyword` over `Literal` for reserved words to avoid partial matches (e.g., `Keyword("for")` will not match the leading "for" in "format"). + - Use `pp.CaselessKeyword`/`pp.CaselessLiteral` when keywords should match regardless of case. +- When the full input must be consumed, call `parse_string` with `parse_all=True`. +- If the grammar must handle comments, define an expression for them and use the `ignore()` method to skip them. + - Prefer built-ins like `pp.cpp_style_comment` and `pp.python_style_comment` for common comment syntaxes. +- Use pyparsing `Group` to organize sub-expressions. Groups are also important for preserving results names when a sub-expression is used in a `OneOrMore` or `ZeroOrMore` expression. +- Suppress punctuation tokens to keep results clean; a convenient pattern is `LBRACK, RBRACK, LBRACE, RBRACE, COLON = pp.Suppress.using_each("[]{}:")`. +- For comma-separated sequences, prefer `pp.DelimitedList(...)`; wrap with `pp.Optional(...)` to allow empty lists or objects where appropriate. +- For helper sub-expressions used only to build larger expressions, consider `set_name(None)` to keep result dumps uncluttered. +- Use pyparsing `Each()` to define a list of elements that may occur in any order. + - The '&' operator is the operator form of Each and is often more readable when combining order-independent parts. +- Use parse actions to do parse-time conversion of data from strings to useful data types. + - Use objects defined in pyparsing.common for common types like integer, real — these already have their conversion parse actions defined. + - For quoted strings, use `pp.dbl_quoted_string().set_parse_action(pp.remove_quotes)` to unquote automatically. + - Map reserved words to Python constants per this example for parsing "true" to auto-convert to a Python True: `pp.Keyword("true").set_parse_action(pp.replace_with(True))` (and similarly for false/null/etc.). + - When you want native Python containers from the parse, use `pp.Group(..., aslist=True)` for lists and `pp.Dict(..., asdict=True)` for dict-like data. +- Use "using_each" with a list of keywords to define keyword constants, instead of separate assignments. +- Choose the appropriate matching method: + - `parse_string()` parses from the start + - `search_string()` searches anywhere in the text + - `scan_string()` yields all matches with positions + - `transform_string()` is a convenience wrapper around `scan_string` to apply filters or transforms defined in parse actions, to perform batch transforms or conversions of expressions within a larger body of text +- For line suffixes or directives, combine lookahead and slicing helpers: `pp.FollowedBy(...)` with `pp.rest_of_line`; when reusing a base expression with a different parse action, call `.copy()` before applying the new action to avoid side effects. +- When defining a parser to be used in a REPL: + - add pyparsing `Tag()` elements of the form `Tag("command", )` to each command definition to support model construction from parsed commands. + - define model classes using dataclasses, and use the "command" attribute in the parsed results to identify which model class to create. The model classes can then be used to construct the model from the ParseResults returned by parse_string(). Define the models in a separate parser_models.py file. +- If defining the grammar as part of a Parser class, only the finished grammar needs to be implemented as an instance variable. +- `ParseResults` support "in" testing for results names. Use "in" tests for the existence of results names, not `hasattr()`. +- Avoid left recursion where possible. If you must support left-recursive grammars, enable it with `pp.ParserElement.enable_left_recursion()` and do not enable packrat at the same time (these modes are incompatible). +- Use `pp.SkipTo` as a skipping expression to skip over arbitrary content. + - For example, `pp.SkipTo(pp.LineEnd())` will skip over all content until the end of the line; add a stop_on argument to SkipTo to stop skipping when a particular string is matched. + - Use `...` in place of simple SkipTo(expression) + +## Testing +- Use the pyparsing `ParserElement.run_tests` method to run mini validation tests. + - Pass a single multiline string to `run_tests` to test the parser on multiple test input strings, each line is a separate test. + - You can add comments starting with "#" within the string passed to `run_tests` to document the individual test cases. + - To pass test input strings that span multiple lines, pass the test input strings as a list of strings. + - Pass `parse_all=True` to `run_tests` to test that the entire input is consumed. +- When generating unit tests for the parser: + - generate tests that include presence and absence of optional elements + - use the methods in the mixin class pyparsing.testing.TestParseResultsAsserts to easily define expression, test input string, and expected results + - do not generate tests for invalid data + +## Debugging +- If troubleshooting parse actions, use pyparsing's `trace_parse_action` decorator to echo arguments and return value +- During development, call `pp.autoname_elements()` to auto-assign names to unnamed expressions to improve `dump()` and error messages. +- Sub-expressions can be tested in isolation using `ParserElement.matches()` +- When defined out of order, Literals can mistakenly match fragments: `Literal("for")` will match the leading "for" in "format". Can be corrected by using `Keyword` instead of `Literal`. +- Dump the parsed results using `ParseResults.dump()`, `ParseResults.pprint()`, or `repr(ParseResults)`. diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/ai/show_best_practices/__init__.py b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/ai/show_best_practices/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/ai/show_best_practices/__main__.py b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/ai/show_best_practices/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..b3172570ce5be7e8ec468ad4c1e493ac2df06886 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/ai/show_best_practices/__main__.py @@ -0,0 +1,2 @@ +import pyparsing +pyparsing.show_best_practices() diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/ai/show_best_practices/__pycache__/__init__.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/ai/show_best_practices/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9d6645e80a93696d8380481288fae39e6caa3500 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/ai/show_best_practices/__pycache__/__init__.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/ai/show_best_practices/__pycache__/__main__.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/ai/show_best_practices/__pycache__/__main__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..206bcc40a5c8074feee7fff14d5e593598ad70e7 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/ai/show_best_practices/__pycache__/__main__.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/diagram/__init__.py b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/diagram/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b8baa47d14751ee7954e380ef16b97707bce9e0d --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/diagram/__init__.py @@ -0,0 +1,761 @@ +# mypy: ignore-errors +from __future__ import annotations + +import itertools +import railroad +import pyparsing +import dataclasses +import typing +from typing import ( + Generic, + TypeVar, + Callable, + Iterable, +) +from jinja2 import Template +from io import StringIO +import inspect +import re + + +jinja2_template_source = """\ +{% if not embed %} + + + +{% endif %} + {% if not head %} + + {% else %} + {{ head | safe }} + {% endif %} +{% if not embed %} + + +{% endif %} + +{{ body | safe }} +{% for diagram in diagrams %} +
+

{{ diagram.title }}

+
{{ diagram.text }}
+
+ {{ diagram.svg }} +
+
+{% endfor %} +{% if not embed %} + + +{% endif %} +""" + +template = Template(jinja2_template_source) + + +_bookmark_lookup = {} +_bookmark_ids = itertools.count(start=1) + +def _make_bookmark(s: str) -> str: + """ + Converts a string into a valid HTML bookmark (ID or anchor name). + """ + if s in _bookmark_lookup: + return _bookmark_lookup[s] + + # Replace invalid characters with hyphens and ensure only valid characters + bookmark = re.sub(r'[^a-zA-Z0-9-]+', '-', s) + + # Ensure it starts with a letter by adding 'z' if necessary + if not bookmark[:1].isalpha(): + bookmark = f"z{bookmark}" + + # Convert to lowercase and strip hyphens + bookmark = bookmark.lower().strip('-') + + _bookmark_lookup[s] = bookmark = f"{bookmark}-{next(_bookmark_ids):04d}" + + return bookmark + + +def _collapse_verbose_regex(regex_str: str) -> str: + if "\n" not in regex_str: + return regex_str + collapsed = pyparsing.Regex(r"#.*$").suppress().transform_string(regex_str) + collapsed = re.sub(r"\s*\n\s*", "", collapsed) + return collapsed + + +@dataclasses.dataclass +class NamedDiagram: + """ + A simple structure for associating a name with a railroad diagram + """ + + name: str + index: int + diagram: railroad.DiagramItem = None + + @property + def bookmark(self): + bookmark = _make_bookmark(self.name) + return bookmark + + +T = TypeVar("T") + + +class EachItem(railroad.Group): + """ + Custom railroad item to compose a: + + - :class:`railroad.Group` containing a + + - :class:`railroad.OneOrMore` containing a + + - :class:`railroad.Choice` of the elements in the + :class:`railroad.Each` + + with the group label indicating that all must be matched + """ + + all_label = "[ALL]" + + def __init__(self, *items) -> None: + choice_item = railroad.Choice(len(items) - 1, *items) + one_or_more_item = railroad.OneOrMore(item=choice_item) + super().__init__(one_or_more_item, label=self.all_label) + + +class AnnotatedItem(railroad.Group): + """ + Simple subclass of Group that creates an annotation label + """ + + def __init__(self, label: str, item) -> None: + super().__init__(item=item, label=f"[{label}]" if label else "") + + +class EditablePartial(Generic[T]): + """ + Acts like a functools.partial, but can be edited. In other words, it represents a type that hasn't yet been + constructed. + """ + + # We need this here because the railroad constructors actually transform the data, so can't be called until the + # entire tree is assembled + + def __init__(self, func: Callable[..., T], args: list, kwargs: dict) -> None: + self.func = func + self.args = args + self.kwargs = kwargs + + @classmethod + def from_call(cls, func: Callable[..., T], *args, **kwargs) -> EditablePartial[T]: + """ + If you call this function in the same way that you would call the constructor, + it will store the arguments as you expect. For example + ``EditablePartial.from_call(Fraction, 1, 3)() == Fraction(1, 3)`` + """ + return EditablePartial(func=func, args=list(args), kwargs=kwargs) + + @property + def name(self): + return self.kwargs["name"] + + def __call__(self) -> T: + """ + Evaluate the partial and return the result + """ + args = self.args.copy() + kwargs = self.kwargs.copy() + + # This is a helpful hack to allow you to specify varargs parameters (e.g. *args) as keyword args (e.g. + # args=['list', 'of', 'things']) + arg_spec = inspect.getfullargspec(self.func) + if arg_spec.varargs in self.kwargs: + args += kwargs.pop(arg_spec.varargs) + + return self.func(*args, **kwargs) + + +def railroad_to_html(diagrams: list[NamedDiagram], embed=False, **kwargs) -> str: + """ + Given a list of :class:`NamedDiagram`, produce a single HTML string + that visualises those diagrams. + + :params kwargs: kwargs to be passed in to the template + """ + data = [] + for diagram in diagrams: + if diagram.diagram is None: + continue + io = StringIO() + try: + css = kwargs.get("css") + diagram.diagram.writeStandalone(io.write, css=css) + except AttributeError: + diagram.diagram.writeSvg(io.write) + title = diagram.name + if diagram.index == 0: + title += " (root)" + data.append( + { + "title": title, "text": "", "svg": io.getvalue(), "bookmark": diagram.bookmark + } + ) + + return template.render(diagrams=data, embed=embed, **kwargs) + + +def resolve_partial(partial: EditablePartial[T]) -> T: + """ + Recursively resolves a collection of Partials into whatever type they are + """ + if isinstance(partial, EditablePartial): + partial.args = resolve_partial(partial.args) + partial.kwargs = resolve_partial(partial.kwargs) + return partial() + elif isinstance(partial, list): + return [resolve_partial(x) for x in partial] + elif isinstance(partial, dict): + return {key: resolve_partial(x) for key, x in partial.items()} + else: + return partial + + +def to_railroad( + element: pyparsing.ParserElement, + diagram_kwargs: typing.Optional[dict] = None, + vertical: int = 3, + show_results_names: bool = False, + show_groups: bool = False, + show_hidden: bool = False, +) -> list[NamedDiagram]: + """ + Convert a pyparsing element tree into a list of diagrams. This is the recommended entrypoint to diagram + creation if you want to access the Railroad tree before it is converted to HTML + + :param element: base element of the parser being diagrammed + + :param diagram_kwargs: kwargs to pass to the :meth:`Diagram` constructor + + :param vertical: (optional) int - limit at which number of alternatives + should be shown vertically instead of horizontally + + :param show_results_names: bool to indicate whether results name + annotations should be included in the diagram + + :param show_groups: bool to indicate whether groups should be highlighted + with an unlabeled surrounding box + + :param show_hidden: bool to indicate whether internal elements that are + typically hidden should be shown + """ + # Convert the whole tree underneath the root + lookup = ConverterState(diagram_kwargs=diagram_kwargs or {}) + _to_diagram_element( + element, + lookup=lookup, + parent=None, + vertical=vertical, + show_results_names=show_results_names, + show_groups=show_groups, + show_hidden=show_hidden, + ) + + root_id = id(element) + # Convert the root if it hasn't been already + if root_id in lookup: + if not element.customName: + lookup[root_id].name = "" + lookup[root_id].mark_for_extraction(root_id, lookup, force=True) + + # Now that we're finished, we can convert from intermediate structures into Railroad elements + diags = list(lookup.diagrams.values()) + if len(diags) > 1: + # collapse out duplicate diags with the same name + seen = set() + deduped_diags = [] + for d in diags: + # don't extract SkipTo elements, they are uninformative as subdiagrams + if d.name == "...": + continue + if d.name is not None and d.name not in seen: + seen.add(d.name) + deduped_diags.append(d) + resolved = [resolve_partial(partial) for partial in deduped_diags] + else: + # special case - if just one diagram, always display it, even if + # it has no name + resolved = [resolve_partial(partial) for partial in diags] + return sorted(resolved, key=lambda diag: diag.index) + + +def _should_vertical( + specification: int, exprs: Iterable[pyparsing.ParserElement] +) -> bool: + """ + Returns true if we should return a vertical list of elements + """ + if specification is None: + return False + else: + return len(_visible_exprs(exprs)) >= specification + + +@dataclasses.dataclass +class ElementState: + """ + State recorded for an individual pyparsing Element + """ + + #: The pyparsing element that this represents + element: pyparsing.ParserElement + #: The output Railroad element in an unconverted state + converted: EditablePartial + #: The parent Railroad element, which we store so that we can extract this if it's duplicated + parent: EditablePartial + #: The order in which we found this element, used for sorting diagrams if this is extracted into a diagram + number: int + #: The name of the element + name: str = None + #: The index of this inside its parent + parent_index: typing.Optional[int] = None + #: If true, we should extract this out into a subdiagram + extract: bool = False + #: If true, all of this element's children have been filled out + complete: bool = False + + def mark_for_extraction( + self, el_id: int, state: ConverterState, name: str = None, force: bool = False + ): + """ + Called when this instance has been seen twice, and thus should eventually be extracted into a sub-diagram + :param el_id: id of the element + :param state: element/diagram state tracker + :param name: name to use for this element's text + :param force: If true, force extraction now, regardless of the state of this. Only useful for extracting the + root element when we know we're finished + """ + self.extract = True + + # Set the name + if not self.name: + if name: + # Allow forcing a custom name + self.name = name + elif self.element.customName: + self.name = self.element.customName + else: + self.name = "" + + # Just because this is marked for extraction doesn't mean we can do it yet. We may have to wait for children + # to be added + # Also, if this is just a string literal etc, don't bother extracting it + if force or (self.complete and _worth_extracting(self.element)): + state.extract_into_diagram(el_id) + + +class ConverterState: + """ + Stores some state that persists between recursions into the element tree + """ + index_generator = itertools.count(start=1) + + def __init__(self, diagram_kwargs: typing.Optional[dict] = None) -> None: + #: A dictionary mapping ParserElements to state relating to them + self._element_diagram_states: dict[int, ElementState] = {} + #: A dictionary mapping ParserElement IDs to subdiagrams generated from them + self.diagrams: dict[int, EditablePartial[NamedDiagram]] = {} + #: The index of the next element. This is used for sorting + self.index: int = 0 + #: Shared kwargs that are used to customize the construction of diagrams + self.diagram_kwargs: dict = diagram_kwargs or {} + self.extracted_diagram_names: set[str] = set() + + def __setitem__(self, key: int, value: ElementState): + self._element_diagram_states[key] = value + + def __getitem__(self, key: int) -> ElementState: + return self._element_diagram_states[key] + + def __delitem__(self, key: int): + del self._element_diagram_states[key] + + def __contains__(self, key: int): + return key in self._element_diagram_states + + def get(self, key, default=None): + try: + return self[key] + except KeyError: + return default + + def generate_index(self) -> int: + """ + Generate a number used to index a diagram + """ + return next(self.index_generator) + + def extract_into_diagram(self, el_id: int): + """ + Used when we encounter the same token twice in the same tree. When this + happens, we replace all instances of that token with a terminal, and + create a new subdiagram for the token + """ + position = self[el_id] + + # Replace the original definition of this element with a regular block + if position.parent: + href = f"#{_make_bookmark(position.name)}" + ret = EditablePartial.from_call(railroad.NonTerminal, text=position.name, href=href) + if "item" in position.parent.kwargs: + position.parent.kwargs["item"] = ret + elif "items" in position.parent.kwargs: + position.parent.kwargs["items"][position.parent_index] = ret + + # If the element we're extracting is a group, skip to its content but keep the title + if position.converted.func == railroad.Group: + content = position.converted.kwargs["item"] + else: + content = position.converted + + self.diagrams[el_id] = EditablePartial.from_call( + NamedDiagram, + name=position.name, + diagram=EditablePartial.from_call( + railroad.Diagram, content, **self.diagram_kwargs + ), + index=position.number, + ) + + del self[el_id] + + +def _worth_extracting(element: pyparsing.ParserElement) -> bool: + """ + Returns true if this element is worth having its own sub-diagram. Simply, if any of its children + themselves have children, then its complex enough to extract + """ + children = element.recurse() + return any(child.recurse() for child in children) + + +def _apply_diagram_item_enhancements(fn): + """ + decorator to ensure enhancements to a diagram item (such as results name annotations) + get applied on return from _to_diagram_element (we do this since there are several + returns in _to_diagram_element) + """ + + def _inner( + element: pyparsing.ParserElement, + parent: typing.Optional[EditablePartial], + lookup: ConverterState = None, + vertical: int = None, + index: int = 0, + name_hint: str = None, + show_results_names: bool = False, + show_groups: bool = False, + show_hidden: bool = False, + ) -> typing.Optional[EditablePartial]: + ret = fn( + element, + parent, + lookup, + vertical, + index, + name_hint, + show_results_names, + show_groups, + show_hidden, + ) + + # apply annotation for results name, if present + if show_results_names and ret is not None: + element_results_name = element.resultsName + if element_results_name: + # add "*" to indicate if this is a "list all results" name + modal_tag = "" if element.modalResults else "*" + ret = EditablePartial.from_call( + railroad.Group, + item=ret, + label=f"{repr(element_results_name)}{modal_tag}", + ) + + return ret + + return _inner + + +def _visible_exprs(exprs: Iterable[pyparsing.ParserElement]): + non_diagramming_exprs = ( + pyparsing.ParseElementEnhance, + pyparsing.PositionToken, + pyparsing.And._ErrorStop, + ) + return [ + e + for e in exprs + if not isinstance(e, non_diagramming_exprs) + ] + + +@_apply_diagram_item_enhancements +def _to_diagram_element( + element: pyparsing.ParserElement, + parent: typing.Optional[EditablePartial], + lookup: ConverterState = None, + vertical: int = None, + index: int = 0, + name_hint: str = None, + show_results_names: bool = False, + show_groups: bool = False, + show_hidden: bool = False, +) -> typing.Optional[EditablePartial]: + """ + Recursively converts a PyParsing Element to a railroad Element + :param lookup: The shared converter state that keeps track of useful things + :param index: The index of this element within the parent + :param parent: The parent of this element in the output tree + :param vertical: Controls at what point we make a list of elements vertical. If this is an integer (the default), + it sets the threshold of the number of items before we go vertical. If True, always go vertical, if False, never + do so + :param name_hint: If provided, this will override the generated name + :param show_results_names: bool flag indicating whether to add annotations for results names + :param show_groups: bool flag indicating whether to show groups using bounding box + :param show_hidden: bool flag indicating whether to show elements that are typically hidden + :returns: The converted version of the input element, but as a Partial that hasn't yet been constructed + """ + exprs = element.recurse() + name = name_hint or element.customName or type(element).__name__ + + # Python's id() is used to provide a unique identifier for elements + el_id = id(element) + + element_results_name = element.resultsName + + # Here we basically bypass processing certain wrapper elements if they contribute nothing to the diagram + if not element.customName: + if isinstance( + element, + ( + # pyparsing.TokenConverter, + pyparsing.Forward, + pyparsing.Located, + pyparsing.AtStringStart, + pyparsing.AtLineStart, + ), + ): + # However, if this element has a useful custom name, and its child does not, we can pass it on to the child + if exprs: + if not exprs[0].customName: + propagated_name = name + else: + propagated_name = None + + return _to_diagram_element( + element.expr, + parent=parent, + lookup=lookup, + vertical=vertical, + index=index, + name_hint=propagated_name, + show_results_names=show_results_names, + show_groups=show_groups, + show_hidden=show_hidden, + ) + + # If the element isn't worth extracting, we always treat it as the first time we say it + if _worth_extracting(element): + looked_up = lookup.get(el_id) + if looked_up and looked_up.name is not None: + # If we've seen this element exactly once before, we are only just now finding out that it's a duplicate, + # so we have to extract it into a new diagram. + looked_up.mark_for_extraction(el_id, lookup, name=name_hint) + href = f"#{_make_bookmark(looked_up.name)}" + ret = EditablePartial.from_call(railroad.NonTerminal, text=looked_up.name, href=href) + return ret + + elif el_id in lookup.diagrams: + # If we have seen the element at least twice before, and have already extracted it into a subdiagram, we + # just put in a marker element that refers to the sub-diagram + text = lookup.diagrams[el_id].kwargs["name"] + ret = EditablePartial.from_call( + railroad.NonTerminal, text=text, href=f"#{_make_bookmark(text)}" + ) + return ret + + # Recursively convert child elements + # Here we find the most relevant Railroad element for matching pyparsing Element + # We use ``items=[]`` here to hold the place for where the child elements will go once created + + # see if this element is normally hidden, and whether hidden elements are desired + # if not, just return None + if not element.show_in_diagram and not show_hidden: + return None + + if isinstance(element, pyparsing.And): + # detect And's created with ``expr*N`` notation - for these use a OneOrMore with a repeat + # (all will have the same name, and resultsName) + if not exprs: + return None + if len(set((e.name, e.resultsName) for e in exprs)) == 1 and len(exprs) > 2: + ret = EditablePartial.from_call( + railroad.OneOrMore, item="", repeat=str(len(exprs)) + ) + elif _should_vertical(vertical, exprs): + ret = EditablePartial.from_call(railroad.Stack, items=[]) + else: + ret = EditablePartial.from_call(railroad.Sequence, items=[]) + elif isinstance(element, (pyparsing.Or, pyparsing.MatchFirst)): + if not exprs: + return None + if _should_vertical(vertical, exprs): + ret = EditablePartial.from_call(railroad.Choice, 0, items=[]) + else: + ret = EditablePartial.from_call(railroad.HorizontalChoice, items=[]) + elif isinstance(element, pyparsing.Each): + if not exprs: + return None + ret = EditablePartial.from_call(EachItem, items=[]) + elif isinstance(element, pyparsing.NotAny): + ret = EditablePartial.from_call(AnnotatedItem, label="NOT", item="") + elif isinstance(element, pyparsing.FollowedBy): + ret = EditablePartial.from_call(AnnotatedItem, label="LOOKAHEAD", item="") + elif isinstance(element, pyparsing.PrecededBy): + ret = EditablePartial.from_call(AnnotatedItem, label="LOOKBEHIND", item="") + elif isinstance(element, pyparsing.Group): + if show_groups: + ret = EditablePartial.from_call(AnnotatedItem, label="", item="") + else: + ret = EditablePartial.from_call( + railroad.Group, item=None, label=element_results_name + ) + elif isinstance(element, pyparsing.TokenConverter): + label = type(element).__name__.lower() + if label == "tokenconverter": + ret = EditablePartial.from_call(railroad.Sequence, items=[]) + else: + ret = EditablePartial.from_call(AnnotatedItem, label=label, item="") + elif isinstance(element, pyparsing.Opt): + ret = EditablePartial.from_call(railroad.Optional, item="") + elif isinstance(element, pyparsing.OneOrMore): + if element.not_ender is not None: + args = [ + parent, + lookup, + vertical, + index, + name_hint, + show_results_names, + show_groups, + show_hidden, + ] + return _to_diagram_element( + (~element.not_ender.expr + element.expr)[1, ...].set_name(element.name), + *args, + ) + ret = EditablePartial.from_call(railroad.OneOrMore, item=None) + elif isinstance(element, pyparsing.ZeroOrMore): + if element.not_ender is not None: + args = [ + parent, + lookup, + vertical, + index, + name_hint, + show_results_names, + show_groups, + show_hidden, + ] + return _to_diagram_element( + (~element.not_ender.expr + element.expr)[...].set_name(element.name), + *args, + ) + ret = EditablePartial.from_call(railroad.ZeroOrMore, item="") + elif isinstance(element, pyparsing.Empty) and not element.customName: + # Skip unnamed "Empty" elements + ret = None + elif isinstance(element, pyparsing.ParseElementEnhance): + ret = EditablePartial.from_call(railroad.Sequence, items=[]) + elif len(exprs) > 0 and not element_results_name: + ret = EditablePartial.from_call(railroad.Group, item="", label=name) + elif isinstance(element, pyparsing.Regex): + collapsed_patt = _collapse_verbose_regex(element.pattern) + ret = EditablePartial.from_call(railroad.Terminal, collapsed_patt) + elif len(exprs) > 0: + ret = EditablePartial.from_call(railroad.Sequence, items=[]) + else: + terminal = EditablePartial.from_call(railroad.Terminal, element.defaultName) + ret = terminal + + if ret is None: + return + + # Indicate this element's position in the tree so we can extract it if necessary + lookup[el_id] = ElementState( + element=element, + converted=ret, + parent=parent, + parent_index=index, + number=lookup.generate_index(), + ) + if element.customName: + lookup[el_id].mark_for_extraction(el_id, lookup, element.customName) + + i = 0 + for expr in exprs: + # Add a placeholder index in case we have to extract the child before we even add it to the parent + if "items" in ret.kwargs: + ret.kwargs["items"].insert(i, None) + + item = _to_diagram_element( + expr, + parent=ret, + lookup=lookup, + vertical=vertical, + index=i, + show_results_names=show_results_names, + show_groups=show_groups, + show_hidden=show_hidden, + ) + + # Some elements don't need to be shown in the diagram + if item is not None: + if "item" in ret.kwargs: + ret.kwargs["item"] = item + elif "items" in ret.kwargs: + # If we've already extracted the child, don't touch this index, since it's occupied by a nonterminal + ret.kwargs["items"][i] = item + i += 1 + elif "items" in ret.kwargs: + # If we're supposed to skip this element, remove it from the parent + del ret.kwargs["items"][i] + + # If all this items children are none, skip this item + if ret and ( + ("items" in ret.kwargs and len(ret.kwargs["items"]) == 0) + or ("item" in ret.kwargs and ret.kwargs["item"] is None) + ): + ret = EditablePartial.from_call(railroad.Terminal, name) + + # Mark this element as "complete", ie it has all of its children + if el_id in lookup: + lookup[el_id].complete = True + + if el_id in lookup and lookup[el_id].extract and lookup[el_id].complete: + lookup.extract_into_diagram(el_id) + if ret is not None: + text = lookup.diagrams[el_id].kwargs["name"] + href = f"#{_make_bookmark(text)}" + ret = EditablePartial.from_call( + railroad.NonTerminal, text=text, href=href + ) + + return ret diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/diagram/__pycache__/__init__.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/diagram/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..269b66118027631f48547ea45c6ecf83c85d03ff Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/diagram/__pycache__/__init__.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/tools/__init__.py b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/tools/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/tools/__pycache__/__init__.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/tools/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2b0f10a9d246c0b796ff3d8f6b8e9eb94f4187e7 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/tools/__pycache__/__init__.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/tools/__pycache__/cvt_pyparsing_pep8_names.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/tools/__pycache__/cvt_pyparsing_pep8_names.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..283609d6bc8ce2e5cea5aefec38a765cdeb43a2e Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/tools/__pycache__/cvt_pyparsing_pep8_names.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/tools/cvt_pyparsing_pep8_names.py b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/tools/cvt_pyparsing_pep8_names.py new file mode 100644 index 0000000000000000000000000000000000000000..ecd2be7b4bc2eac78b4af9dd6829495bcf000338 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pyparsing/tools/cvt_pyparsing_pep8_names.py @@ -0,0 +1,142 @@ +import warnings +from functools import lru_cache +import pyparsing as pp + + +@lru_cache(maxsize=None) +def camel_to_snake(s: str) -> str: + """ + Convert CamelCase to snake_case. + """ + return "".join(f"_{c.lower()}" if c.isupper() else c for c in s).lstrip("_") + + +pre_pep8_method_names = """ +addCondition addParseAction anyCloseTag anyOpenTag asDict asList cStyleComment canParseNext conditionAsParseAction +convertToDate convertToDatetime convertToFloat convertToInteger countedArray cppStyleComment dblQuotedString +dblSlashComment defaultName dictOf disableMemoization downcaseTokens enableLeftRecursion enablePackrat getName +htmlComment ignoreWhitespace infixNotation inlineLiteralsUsing javaStyleComment leaveWhitespace +lineEnd lineStart matchOnlyAtCol matchPreviousExpr matchPreviousLiteral nestedExpr nullDebugAction oneOf +originalTextFor parseFile parseString parseWithTabs pythonStyleComment quotedString removeQuotes replaceWith +resetCache restOfLine runTests scanString searchString setBreak setDebug setDebugActions setDefaultWhitespaceChars +setFailAction setName setParseAction setResultsName setWhitespaceChars sglQuotedString stringEnd stringStart tokenMap +traceParseAction transformString tryParse unicodeString upcaseTokens withAttribute withClass +""".split() + +special_changes = { + "opAssoc": "OpAssoc", + "delimitedList": "DelimitedList", + "delimited_list": "DelimitedList", + "replaceHTMLEntity": "replace_html_entity", + "makeHTMLTags": "make_html_tags", + "makeXMLTags": "make_xml_tags", + "commonHTMLEntity": "common_html_entity", + "stripHTMLTags": "strip_html_tags", + "indentedBlock": "IndentedBlock", + "locatedExpr": "Located", +} + +pre_pep8_arg_names = """parseAll maxMatches listAllMatches callDuringTry includeSeparators fullDump printResults +failureTests postParse matchString identChars maxMismatches initChars bodyChars asKeyword excludeChars asGroupList +asMatch quoteChar escChar escQuote unquoteResults endQuoteChar convertWhitespaceEscapes notChars wordChars stopOn +failOn joinString markerString intExpr useRegex asString ignoreExpr""".split() + +special_changes_arg_names = { + "asList": "aslist", +} + +pre_pep8_method_name = pp.one_of(pre_pep8_method_names, as_keyword=True) +pre_pep8_method_name.set_parse_action(lambda t: camel_to_snake(t[0])) +special_pre_pep8_name = pp.one_of(special_changes, as_keyword=True) +def update_special_changes(s, l, t): + if t[0] == "indentedBlock": + warnings.warn( + "Conversion of 'indentedBlock' to new 'IndentedBlock'" + " requires added code changes to remove 'indentStack' argument\n" + f" {pp.lineno(l, s)}: {pp.line(l, s)}", + stacklevel=2, + ) + elif t[0] == "locatedExpr": + warnings.warn( + "Conversion of 'locatedExpr' to new 'Located'" + " may require added code changes - Located does not automatically" + " group parsed elements\n" + f" {pp.lineno(l, s)}: {pp.line(l, s)}", + stacklevel=2, + ) + return special_changes[t[0]] +special_pre_pep8_name.set_parse_action(update_special_changes) +# only replace arg names if part of an arg list +pre_pep8_arg_name = pp.Regex( + rf"{pp.util.make_compressed_re(pre_pep8_arg_names)}" +) + pp.FollowedBy("=") +pre_pep8_arg_name.set_parse_action(lambda t: camel_to_snake(t[0])) +special_pre_pep8_arg_name = pp.one_of(special_changes_arg_names, as_keyword=True) + pp.FollowedBy("=") +special_pre_pep8_arg_name.set_parse_action(lambda t: special_changes_arg_names[t[0]]) + +pep8_converter = special_pre_pep8_arg_name | pre_pep8_method_name | special_pre_pep8_name | pre_pep8_arg_name + +if __name__ == "__main__": + import argparse + from pathlib import Path + import sys + + argparser = argparse.ArgumentParser( + description = ( + "Utility to convert Python pyparsing scripts using legacy" + " camelCase names to use PEP8 snake_case names." + "\nBy default, this script will only show whether this script would make any changes." + ) + ) + argparser.add_argument("--verbose", "-v", action="store_true", help="Show unified diff for each source file") + argparser.add_argument("-vv", action="store_true", dest="verbose2", help="Show unified diff for each source file, plus names of scanned files with no changes") + argparser.add_argument("--update", "-u", action="store_true", help="Update source files in-place") + argparser.add_argument("--encoding", type=str, default="utf-8", help="Encoding of source files (default: utf-8)") + argparser.add_argument("--exit-zero-even-if-changed", "-exit0", action="store_true", help="Exit with status code 0 even if changes were made") + argparser.add_argument("source_filename", nargs="+", help="Source filenames or filename patterns of Python files to be converted") + args = argparser.parse_args() + + + def show_diffs(original, modified): + import difflib + + diff = difflib.unified_diff( + original.splitlines(), modified.splitlines(), lineterm="" + ) + sys.stdout.writelines(f"{diff_line}\n" for diff_line in diff) + + exit_status = 0 + + for filename_pattern in args.source_filename: + + for filename in Path().glob(filename_pattern): + if not Path(filename).is_file(): + continue + + try: + original_contents = Path(filename).read_text(encoding=args.encoding) + modified_contents = pep8_converter.transform_string( + original_contents + ) + + if modified_contents != original_contents: + if args.update: + Path(filename).write_text(modified_contents, encoding=args.encoding) + print(f"Converted {filename}") + else: + print(f"Found required changes in {filename}") + + if args.verbose: + show_diffs(original_contents, modified_contents) + print() + + exit_status = 1 + + else: + if args.verbose2: + print(f"No required changes in {filename}") + + except Exception as e: + print(f"Failed to convert {filename}: {type(e).__name__}: {e}") + + sys.exit(exit_status if not args.exit_zero_even_if_changed else 0) diff --git a/TTS/Kokoro/.venv/Lib/site-packages/pyyaml-6.0.3.dist-info/licenses/LICENSE b/TTS/Kokoro/.venv/Lib/site-packages/pyyaml-6.0.3.dist-info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..2f1b8e15e5627d92f0521605c9870bc8e5505cb4 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/pyyaml-6.0.3.dist-info/licenses/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2017-2021 Ingy döt Net +Copyright (c) 2006-2016 Kirill Simonov + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/__init__.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6f9a9ede088259c5bdc92f17a99729e8c302f536 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/__init__.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/_networking.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/_networking.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..26ddd6adb50b2a1dfe78bc9323f27143077daada Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/_networking.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/_type_checking.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/_type_checking.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..93b2f1f76b93abdb4b3f06c723d58308140d51e5 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/_type_checking.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/collection.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/collection.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..577c78d653eb0bcf45b4907657a2ae90d555c087 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/collection.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/compare.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/compare.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bd4dc80844239732bdbf7d71380374d55d03640c Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/compare.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/compat.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/compat.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2f7a2c6ba9d91ec308790b041f7944a1d6fc6dc5 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/compat.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/container.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/container.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..40f5b02bec84f99b41a91fde4b60f20cbbfd836e Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/container.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/events.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/events.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1e6d13ceba15e132ae84132691b9af0b025a7abd Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/events.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/exceptions.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/exceptions.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9b10bb7d54548536ced0a0a65ee64a8abcf61ea8 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/exceptions.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/parser.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/parser.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e76bbd7be77f5a39d4692450e7456c791c7bc595 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/parser.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/paths.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/paths.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..de56178661879084f89b016d0e2c39ad36f2b4c2 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/paths.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/plugin.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/plugin.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3072ad5095f417f90177efaf29be7fe1a6d66c5f Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/plugin.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/query.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/query.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ea806363f3411c33c0ab9051226d67435419c6b5 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/query.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/resource.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/resource.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..913d3c7126d20645214182d79788c49c8eea3547 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/resource.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/serializer.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/serializer.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d36a2d670737f146ea1169b1383c241f6f8aa142 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/serializer.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/store.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/store.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ec78de1aea36ffd2c507f52152f5a3cd63965f67 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/store.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/term.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/term.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7d1d33706a219fb61eedf78c0cfa50be6e3eb697 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/term.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/util.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/util.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..234321d23105f4f4e3641e61eb61fcdfd23c7555 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/util.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/void.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/void.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2f8340e1f689960d8c76f590aea6f0b0c4b44512 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/void.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/xsd_datetime.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/xsd_datetime.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..91e8e99bcadfdaf40e0615b6f3fec049fc9facef Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/__pycache__/xsd_datetime.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/__init__.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/__pycache__/__init__.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f03125ab4ba2f990c1f54b1ada9914abf5f6fab0 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/__pycache__/__init__.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/graphdb/__init__.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/graphdb/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2c112ef55992a04b30a5b06e2b51bec7ca9f0ab7 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/graphdb/__init__.py @@ -0,0 +1,6 @@ +from rdflib.contrib.rdf4j import has_httpx + +if has_httpx: + from .client import GraphDBClient + + __all__ = ["GraphDBClient"] diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/graphdb/__pycache__/__init__.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/graphdb/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4fc77983f8b584b2f55072f1c6c9d0e0491608e5 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/graphdb/__pycache__/__init__.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/graphdb/__pycache__/exceptions.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/graphdb/__pycache__/exceptions.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1e3e46cb38c884c0efd00cf455416470a3fc7c25 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/graphdb/__pycache__/exceptions.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/graphdb/__pycache__/models.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/graphdb/__pycache__/models.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..829515f93da1445cdc9df0a9a3906085b8cacf6d Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/graphdb/__pycache__/models.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/graphdb/__pycache__/util.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/graphdb/__pycache__/util.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f2cae6004c8a517d0acf930fd7e15827f8dd66bc Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/graphdb/__pycache__/util.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/graphdb/client.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/graphdb/client.py new file mode 100644 index 0000000000000000000000000000000000000000..62d841f4af66dfa2cd191651653e24ed72cec10c --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/graphdb/client.py @@ -0,0 +1,3032 @@ +"""GraphDB client module.""" + +from __future__ import annotations + +import json +import os +import pathlib +import typing as t + +import httpx + +import rdflib.contrib.rdf4j +from rdflib import Graph, Literal, URIRef +from rdflib.contrib.graphdb.exceptions import ( + BadRequestError, + ConflictError, + ForbiddenError, + InternalServerError, + NotFoundError, + PreconditionFailedError, + RepositoryNotFoundError, + RepositoryNotHealthyError, + ResponseFormatError, + ServiceUnavailableError, + UnauthorisedError, +) +from rdflib.contrib.graphdb.models import ( + AccessControlEntry, + AuthenticatedUser, + BackupOperationBean, + ClearGraphAccessControlEntry, + ClusterRequest, + FreeAccessSettings, + GraphDBRepository, + ImportSettings, + InfrastructureStatistics, + NodeStatus, + ParserSettings, + PluginAccessControlEntry, + RepositoryConfigBean, + RepositoryConfigBeanCreate, + RepositorySizeInfo, + RepositoryStatistics, + ServerImportBody, + StatementAccessControlEntry, + StructuresStatistics, + SystemAccessControlEntry, + User, + UserCreate, + UserUpdate, + _parse_operation, + _parse_plugin, + _parse_policy, + _parse_role, +) +from rdflib.contrib.graphdb.util import ( + extract_filename_from_content_disposition, + infer_filename_from_fileobj, +) +from rdflib.contrib.rdf4j import RDF4JClient + +FileContent = t.Union[ + bytes, + str, + t.IO[bytes], + t.Tuple[t.Optional[str], t.Union[bytes, str, t.IO[bytes]]], + t.Tuple[t.Optional[str], t.Union[bytes, str, t.IO[bytes]], t.Optional[str]], +] + +FilesType = t.Union[ + t.Mapping[str, FileContent], + t.Iterable[t.Tuple[str, FileContent]], +] + +_ALLOWED_FGAC_SCOPES = {"statement", "clear_graph", "plugin", "system"} + + +class AccessControlListManagement: + """Manage fine-grained access control lists for GraphDB repositories.""" + + def __init__(self, identifier: str, http_client: httpx.Client): + self._identifier = identifier + self._http_client = http_client + + @property + def http_client(self): + return self._http_client + + @property + def identifier(self): + """Repository identifier.""" + return self._identifier + + def list( + self, + scope: t.Literal["statement", "clear_graph", "plugin", "system"] | None = None, + operation: t.Literal["read", "write", "*"] | None = None, + subject: str | URIRef | None = None, + predicate: str | URIRef | None = None, + obj: str | URIRef | Literal | None = None, + graph: t.Literal["*", "named", "default"] | URIRef | Graph | None = None, + plugin: str | None = None, + role: str | None = None, + policy: t.Literal["allow", "deny", "abstain"] | None = None, + ) -> t.List[ + SystemAccessControlEntry + | StatementAccessControlEntry + | PluginAccessControlEntry + | ClearGraphAccessControlEntry + ]: + """ + List ACL rules for the repository. + + Parameters: + scope: The scope of the FGAC rule (`statement`, `clear_graph`, `plugin`, `system`). + operation: The operation of the FGAC rule (`read`, `write`, `*`). + subject: The subject of the FGAC rule in Turtle format (for example, ``). + predicate: The predicate of the FGAC rule in Turtle format (for example, ``). + obj: The object of the FGAC rule in Turtle format (for example, `"Mary"@en`). + graph: The graph of the FGAC rule in Turtle format (for example, ``). + plugin: The plugin name for the FGAC rule with plugin scope (for example, `elasticsearch-connector`). + role: The role associated with the FGAC rule. + policy: The policy for the FGAC rule (`allow`, `deny`, `abstain`). + + Returns: + A list of FGAC rules. + + Raises: + ValueError: If the parameters are invalid. + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + InternalServerError: If the server returns an internal error. + ResponseFormatError: If the response cannot be parsed. + """ + params: dict[str, str] = {} + if scope is not None: + if scope not in _ALLOWED_FGAC_SCOPES: + raise ValueError(f"Invalid FGAC scope filter: {scope!r}") + params["scope"] = scope + if operation is not None: + params["operation"] = _parse_operation(operation) + if subject is not None: + if isinstance(subject, URIRef): + params["subject"] = subject.n3() + elif isinstance(subject, str): + params["subject"] = subject + else: + raise ValueError(f"Invalid FGAC subject filter: {subject!r}") + if predicate is not None: + if isinstance(predicate, URIRef): + params["predicate"] = predicate.n3() + elif isinstance(predicate, str): + params["predicate"] = predicate + else: + raise ValueError(f"Invalid FGAC predicate filter: {predicate!r}") + if obj is not None: + if isinstance(obj, (URIRef, Literal)): + params["object"] = obj.n3() + elif isinstance(obj, str): + params["object"] = obj + else: + raise ValueError(f"Invalid FGAC object filter: {obj!r}") + if graph is not None: + if isinstance(graph, URIRef): + params["context"] = graph.n3() + elif isinstance(graph, Graph): + params["context"] = graph.identifier.n3() + elif isinstance(graph, str): + params["context"] = graph + else: + raise ValueError(f"Invalid FGAC graph filter: {graph!r}") + if plugin is not None: + params["plugin"] = _parse_plugin(plugin) + if role is not None: + params["role"] = _parse_role(role) + if policy is not None: + params["policy"] = _parse_policy(policy) + + try: + response = self._http_client.get( + f"/rest/repositories/{self.identifier}/acl", params=params + ) + response.raise_for_status() + try: + payload = response.json() + except (ValueError, TypeError) as err: + raise ResponseFormatError( + f"Failed to parse GraphDB response: {err}" + ) from err + + if not isinstance(payload, list): + raise ResponseFormatError( + "Failed to parse GraphDB response: expected a list of ACL entries." + ) + + try: + return [AccessControlEntry.from_dict(acl) for acl in payload] + except (ValueError, TypeError) as err: + raise ResponseFormatError( + f"Failed to parse GraphDB response: {err}" + ) from err + except httpx.HTTPStatusError as err: + status = err.response.status_code + if status == 401: + raise UnauthorisedError( + f"Request is unauthorised: {err.response.text}" + ) from err + elif status == 403: + raise ForbiddenError( + f"Request is forbidden: {err.response.text}" + ) from err + elif status == 500: + raise InternalServerError( + f"Internal server error: {err.response.text}" + ) from err + raise + + def set(self, acl_rules: t.Sequence[AccessControlEntry]): + """ + Set ACL rules for the repository. + + !!! Note + This method overwrites existing ACL rules in the repository. + If you want to add new rules without overwriting existing ones, + use the [`add`][rdflib.contrib.graphdb.client.AccessControlListManagement.add] method. + + Parameters: + acl_rules: The list of ACL rules to set. + + Raises: + BadRequestError: If the request is invalid. + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + InternalServerError: If the server returns an internal error. + ValueError: If the ACL rules are not provided as a sequence or are not AccessControlEntry instances. + """ + acl_rules_list = list(acl_rules) + if any(not isinstance(rule, AccessControlEntry) for rule in acl_rules_list): + raise ValueError("All ACL rules must be AccessControlEntry instances.") + + payload = [rule.as_dict() for rule in acl_rules_list] + headers = {"Content-Type": "application/json"} + try: + response = self._http_client.put( + f"/rest/repositories/{self.identifier}/acl", + headers=headers, + json=payload, + ) + response.raise_for_status() + except httpx.HTTPStatusError as err: + status = err.response.status_code + if status == 400: + raise BadRequestError(f"Invalid request: {err.response.text}") from err + elif status == 401: + raise UnauthorisedError( + f"Request is unauthorised: {err.response.text}" + ) from err + elif status == 403: + raise ForbiddenError( + f"Request is forbidden: {err.response.text}" + ) from err + elif status == 500: + raise InternalServerError( + f"Internal server error: {err.response.text}" + ) from err + raise + + def add( + self, acl_rules: t.Sequence[AccessControlEntry], position: int | None = None + ): + """ + Add ACL rules to the repository. + + You can also provide an optional URL request parameter position that specifies the position of the rules to be added. + The position is zero-based (0 is the first position). If the position parameter is not provided, the rules are added at + the end of the list. + + Parameters: + acl_rules: The list of ACL rules to add. + position: The zero-based position to add the rules at. + + Raises: + BadRequestError: If the request is invalid. + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + InternalServerError: If the server returns an internal error. + ValueError: If the position is not an integer or is a negative integer. + ValueError: If the ACL rules are not provided as a sequence or are not AccessControlEntry instances. + """ + acl_rules_list = list(acl_rules) + if any(not isinstance(rule, AccessControlEntry) for rule in acl_rules_list): + raise ValueError("All ACL rules must be AccessControlEntry instances.") + + payload = [rule.as_dict() for rule in acl_rules_list] + headers = {"Content-Type": "application/json"} + params = {} + if position is not None: + if not isinstance(position, int): + raise ValueError("Position must be an integer.") + if position < 0: + raise ValueError("Position must be a positive integer.") + params["position"] = str(position) + try: + response = self._http_client.post( + f"/rest/repositories/{self.identifier}/acl", + headers=headers, + json=payload, + params=params, + ) + response.raise_for_status() + except httpx.HTTPStatusError as err: + status = err.response.status_code + if status == 400: + raise BadRequestError(f"Invalid request: {err.response.text}") from err + elif status == 401: + raise UnauthorisedError( + f"Request is unauthorised: {err.response.text}" + ) from err + elif status == 403: + raise ForbiddenError( + f"Request is forbidden: {err.response.text}" + ) from err + elif status == 500: + raise InternalServerError( + f"Internal server error: {err.response.text}" + ) from err + raise + + def delete(self, acl_rules: t.Sequence[AccessControlEntry]): + """ + Delete ACL rules from the repository. + + The provided FGAC rules are removed from the list regardless of their position. + + Parameters: + acl_rules: The list of ACL rules to delete. + + Raises: + BadRequestError: If the request is invalid. + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + InternalServerError: If the server returns an internal error. + ValueError: If the ACL rules are not provided as a sequence or are not AccessControlEntry instances. + """ + acl_rules_list = list(acl_rules) + if any(not isinstance(rule, AccessControlEntry) for rule in acl_rules_list): + raise ValueError("All ACL rules must be AccessControlEntry instances.") + + payload = [rule.as_dict() for rule in acl_rules_list] + headers = {"Content-Type": "application/json"} + try: + response = self._http_client.request( + method="DELETE", + url=f"/rest/repositories/{self.identifier}/acl", + headers=headers, + json=payload, + ) + response.raise_for_status() + except httpx.HTTPStatusError as err: + status = err.response.status_code + if status == 400: + raise BadRequestError(f"Invalid request: {err.response.text}") from err + elif status == 401: + raise UnauthorisedError( + f"Request is unauthorised: {err.response.text}" + ) from err + elif status == 403: + raise ForbiddenError( + f"Request is forbidden: {err.response.text}" + ) from err + elif status == 500: + raise InternalServerError( + f"Internal server error: {err.response.text}" + ) from err + raise + + +class ClusterGroupManagement: + """Manage and monitor GraphDB cluster configurations.""" + + def __init__(self, http_client: httpx.Client): + self._http_client = http_client + + @property + def http_client(self): + return self._http_client + + def truncate_log(self) -> None: + """Truncate the GraphDB cluster log. + + The truncate log operation is used to free up storage space on all cluster nodes by clearing the + current transaction log and removing cached recovery snapshots. + + Raises: + ResponseFormatError: If the response is not in the expected format. + BadRequestError: If the request is invalid. + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + """ + try: + response = self.http_client.post("/rest/cluster/truncate-log") + response.raise_for_status() + except httpx.HTTPStatusError as err: + status = err.response.status_code + if status == 400: + raise BadRequestError(f"Invalid request: {err.response.text}") from err + elif status == 401: + raise UnauthorisedError( + f"Request is unauthorised: {err.response.text}" + ) from err + elif status == 403: + raise ForbiddenError( + f"Request is forbidden: {err.response.text}" + ) from err + raise + + def get_config(self) -> ClusterRequest: + """Get the GraphDB cluster configuration. + + Returns: + Cluster configuration. + + Raises: + ResponseFormatError: If the response is not in the expected format. + UnauthorisedError: If the request is unauthorised. + NotFoundError: If the cluster configuration is not found. + InternalServerError: If the server returns an internal error. + """ + try: + headers = {"Accept": "application/json"} + response = self.http_client.get("/rest/cluster/config", headers=headers) + response.raise_for_status() + try: + return ClusterRequest.from_dict(response.json()) + except (KeyError, TypeError, ValueError) as err: + raise ResponseFormatError( + f"Failed to parse cluster configuration: {err}" + ) from err + except httpx.HTTPStatusError as err: + status = err.response.status_code + if status == 401: + raise UnauthorisedError( + f"Request is unauthorised: {err.response.text}" + ) from err + elif status == 404: + raise NotFoundError( + f"Cluster configuration not found: {err.response.text}" + ) from err + elif status == 500: + raise InternalServerError( + f"Internal server error: {err.response.text}" + ) from err + raise + + def create_config( + self, + nodes: list[str], + election_min_timeout: int | None = None, + election_range_timeout: int | None = None, + heartbeat_interval: int | None = None, + message_size_kb: int | None = None, + verification_timeout: int | None = None, + transaction_log_maximum_size_gb: int | None = None, + batch_update_interval: int | None = None, + ) -> None: + """Create a GraphDB cluster. + + Parameters: + nodes: List of node addresses. + election_min_timeout: The minimum wait time in milliseconds for a heartbeat from a leader. + election_range_timeout: The variable portion of each waiting period in milliseconds for a heartbeat. + heartbeat_interval: The interval in milliseconds between each heartbeat that is sent to follower nodes by the leader. + message_size_kb: The size of the data blocks, in kilobytes, transferred during data replication streaming through the RPC protocol. + verification_timeout: The amount of time in milliseconds that a follower node would wait before attempting to verify the last committed + entry when the first verification is unsuccessful. + transaction_log_maximum_size_gb: Maximum size of the transaction log in GBs. The transaction log will be automatically truncated if it + becomes bigger than this value. The minimum transaction log size is 1 GB. Setting it to a negative value will disable automatic transaction + log truncation. + batch_update_interval: The interval in milliseconds between requesting updates from the primary cluster. Used only when the cluster is in + secondary mode. + + Raises: + BadRequestError: If the request is invalid. + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + ConflictError: If the cluster configuration already exists. + PreconditionFailedError: If the cluster is not in a state to create a configuration. + """ + try: + if not isinstance(nodes, list) or any( + not isinstance(node, str) for node in nodes + ): + raise TypeError("nodes must be a list[str].") + + _int_fields: list[tuple[str, int | None]] = [ + ("election_min_timeout", election_min_timeout), + ("election_range_timeout", election_range_timeout), + ("heartbeat_interval", heartbeat_interval), + ("message_size_kb", message_size_kb), + ("verification_timeout", verification_timeout), + ("transaction_log_maximum_size_gb", transaction_log_maximum_size_gb), + ("batch_update_interval", batch_update_interval), + ] + for field_name, value in _int_fields: + if value is not None and type(value) is not int: + raise TypeError(f"{field_name} must be an int if provided.") + + payload: dict[str, t.Any] = {"nodes": nodes} + if election_min_timeout is not None: + payload["electionMinTimeout"] = election_min_timeout + if election_range_timeout is not None: + payload["electionRangeTimeout"] = election_range_timeout + if heartbeat_interval is not None: + payload["heartbeatInterval"] = heartbeat_interval + if message_size_kb is not None: + payload["messageSizeKB"] = message_size_kb + if verification_timeout is not None: + payload["verificationTimeout"] = verification_timeout + if transaction_log_maximum_size_gb is not None: + payload["transactionLogMaximumSizeGB"] = transaction_log_maximum_size_gb + if batch_update_interval is not None: + payload["batchUpdateInterval"] = batch_update_interval + + headers = {"Content-Type": "application/json"} + response = self.http_client.post( + "/rest/cluster/config", headers=headers, json=payload + ) + response.raise_for_status() + except httpx.HTTPStatusError as err: + status = err.response.status_code + if status == 400: + raise BadRequestError(f"Invalid request: {err.response.text}") from err + elif status == 401: + raise UnauthorisedError( + f"Request is unauthorised: {err.response.text}" + ) from err + elif status == 403: + raise ForbiddenError( + f"Request is forbidden: {err.response.text}" + ) from err + elif status == 409: + raise ConflictError( + f"Cluster configuration already exists: {err.response.text}" + ) from err + elif status == 412: + raise PreconditionFailedError( + f"Precondition failed: {err.response.text}" + ) from err + raise + + def delete_config(self, force: bool | None = None) -> dict[str, str]: + """Delete the GraphDB cluster. + + By default, the cluster group cannot be deleted if one or more nodes are unreachable. + Reachable here means that the nodes are not in status `NO_CONNECTION`, therefore there is an + RPC connection to them. + + Parameter: + force: When set to `True`, the cluster configuration will be deleted only on the reachable nodes and + the response will always succeed. + + Returns: + A dictionary where the node address is the key and the deletion status message is the value. + + Raises: + ResponseFormatError: If the response is not in the expected format. + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + PreconditionFailedError: If one or more nodes in the group are not reachable and force is not set to `True`. + """ + params: dict[str, str] | None = None + if force is not None: + params = {"force": str(force).lower()} + try: + headers = {"Accept": "application/json"} + if params is None: + response = self.http_client.delete( + "/rest/cluster/config", headers=headers + ) + else: + response = self.http_client.delete( + "/rest/cluster/config", headers=headers, params=params + ) + response.raise_for_status() + try: + payload = response.json() + except (ValueError, TypeError) as err: + raise ResponseFormatError( + f"Failed to parse cluster deletion response: {err}" + ) from err + if not isinstance(payload, dict): + raise ResponseFormatError( + "Failed to parse cluster deletion response: expected a JSON object." + ) + if not all( + isinstance(key, str) and isinstance(value, str) + for key, value in payload.items() + ): + raise ResponseFormatError( + "Failed to parse cluster deletion response: expected string keys and values." + ) + return t.cast(dict[str, str], payload) + except httpx.HTTPStatusError as err: + status = err.response.status_code + if status == 401: + raise UnauthorisedError( + f"Request is unauthorised: {err.response.text}" + ) from err + elif status == 403: + raise ForbiddenError( + f"Request is forbidden: {err.response.text}" + ) from err + elif status == 412: + raise PreconditionFailedError( + f"Precondition failed: {err.response.text}" + ) from err + raise + + def update_config( + self, + election_min_timeout: int | None = None, + election_range_timeout: int | None = None, + heartbeat_interval: int | None = None, + message_size_kb: int | None = None, + verification_timeout: int | None = None, + transaction_log_maximum_size_gb: int | None = None, + batch_update_interval: int | None = None, + ) -> ClusterRequest: + """Update the GraphDB cluster configuration. + + If one of the cluster nodes is down or was not able to accept the new configuration, + the operation will not be successful. A total consensus between the nodes is required. + In case one or more of them cannot append the new configuration, it will be rejected + by all of the nodes. + + Parameters: + election_min_timeout: The minimum wait time in milliseconds for a heartbeat from a leader. + election_range_timeout: The variable portion of each waiting period in milliseconds for a heartbeat. + heartbeat_interval: The interval in milliseconds between each heartbeat that is sent to follower nodes by the leader. + message_size_kb: The size of the data blocks, in kilobytes, transferred during data replication streaming through the RPC protocol. + verification_timeout: The amount of time in milliseconds that a follower node would wait before attempting to verify the last committed + entry when the first verification is unsuccessful. + transaction_log_maximum_size_gb: Maximum size of the transaction log in GBs. The transaction log will be automatically truncated if it + becomes bigger than this value. The minimum transaction log size is 1 GB. Setting it to a negative value will disable automatic transaction + log truncation. + batch_update_interval: The interval in milliseconds between requesting updates from the primary cluster. Used only when the cluster is in + secondary mode. + + Returns: + The updated cluster configuration. + + Raises: + BadRequestError: If the request is invalid. + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + PreconditionFailedError: If one or more nodes in the group are not reachable. + """ + _int_fields: list[tuple[str, int | None]] = [ + ("election_min_timeout", election_min_timeout), + ("election_range_timeout", election_range_timeout), + ("heartbeat_interval", heartbeat_interval), + ("message_size_kb", message_size_kb), + ("verification_timeout", verification_timeout), + ("transaction_log_maximum_size_gb", transaction_log_maximum_size_gb), + ("batch_update_interval", batch_update_interval), + ] + for field_name, value in _int_fields: + if value is not None and type(value) is not int: + raise TypeError(f"{field_name} must be an int if provided.") + + payload: dict[str, t.Any] = {} + if election_min_timeout is not None: + payload["electionMinTimeout"] = election_min_timeout + if election_range_timeout is not None: + payload["electionRangeTimeout"] = election_range_timeout + if heartbeat_interval is not None: + payload["heartbeatInterval"] = heartbeat_interval + if message_size_kb is not None: + payload["messageSizeKB"] = message_size_kb + if verification_timeout is not None: + payload["verificationTimeout"] = verification_timeout + if transaction_log_maximum_size_gb is not None: + payload["transactionLogMaximumSizeGB"] = transaction_log_maximum_size_gb + if batch_update_interval is not None: + payload["batchUpdateInterval"] = batch_update_interval + + headers = {"Accept": "application/json"} + try: + response = self.http_client.patch( + "/rest/cluster/config", headers=headers, json=payload + ) + response.raise_for_status() + try: + return ClusterRequest.from_dict(response.json()) + except (KeyError, TypeError, ValueError) as err: + raise ResponseFormatError( + f"Failed to parse updated cluster configuration: {err}" + ) from err + except httpx.HTTPStatusError as err: + status = err.response.status_code + if status == 400: + raise BadRequestError(f"Invalid request: {err.response.text}") from err + elif status == 401: + raise UnauthorisedError( + f"Request is unauthorised: {err.response.text}" + ) from err + elif status == 403: + raise ForbiddenError( + f"Request is forbidden: {err.response.text}" + ) from err + elif status == 412: + raise PreconditionFailedError( + f"Precondition failed: {err.response.text}" + ) from err + raise + + def add_tag(self, tag: str) -> None: + """Add primary cluster tag. + + Parameters: + tag: The identifier tag to add to the primary cluster. + + Raises: + TypeError: If tag is not a string. + ValueError: If tag is an empty string. + BadRequestError: If the request is invalid. + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + PreconditionFailedError: If the cluster is not in a state to add a tag. + """ + if not isinstance(tag, str): + raise TypeError("tag must be a string") + if not tag: + raise ValueError("tag must be a non-empty string") + + try: + response = self.http_client.post( + "/rest/cluster/config/tag", json={"tag": tag} + ) + response.raise_for_status() + except httpx.HTTPStatusError as err: + status = err.response.status_code + if status == 400: + raise BadRequestError(f"Invalid request: {err.response.text}") from err + elif status == 401: + raise UnauthorisedError( + f"Request is unauthorised: {err.response.text}" + ) from err + elif status == 403: + raise ForbiddenError( + f"Request is forbidden: {err.response.text}" + ) from err + elif status == 412: + raise PreconditionFailedError( + f"Precondition failed: {err.response.text}" + ) from err + raise + + def delete_tag(self, tag: str) -> None: + """Remove primary cluster tag. + + Parameters: + tag: The identifier tag to remove from the primary cluster. + + Raises: + TypeError: If tag is not a string. + ValueError: If tag is an empty string. + BadRequestError: If the request is invalid. + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + PreconditionFailedError: If the cluster is not in a state to delete a tag. + """ + if not isinstance(tag, str): + raise TypeError("tag must be a string") + if not tag: + raise ValueError("tag must be a non-empty string") + + headers = {"Content-Type": "application/json"} + try: + response = self.http_client.request( + method="DELETE", + url="/rest/cluster/config/tag", + headers=headers, + json={"tag": tag}, + ) + response.raise_for_status() + except httpx.HTTPStatusError as err: + status = err.response.status_code + if status == 400: + raise BadRequestError(f"Invalid request: {err.response.text}") from err + elif status == 401: + raise UnauthorisedError( + f"Request is unauthorised: {err.response.text}" + ) from err + elif status == 403: + raise ForbiddenError( + f"Request is forbidden: {err.response.text}" + ) from err + elif status == 412: + raise PreconditionFailedError( + f"Precondition failed: {err.response.text}" + ) from err + raise + + def enable_secondary_mode(self, primary_node: str, tag: str) -> None: + """Enable cluster secondary mode. + + You can switch any healthy primary cluster to secondary mode by providing the RPC address + of the primary cluster node that it will replicate and then declaring the tag used to identify + it. Once you have switched a cluster to secondary mode, all of its current repositories and + data will be removed and replaced with the data and state of the primary cluster. + + !!! Note + You can enable the secondary cluster mode from any of the nodes of a cluster, not just the + leader node. You can also use any of the healthy nodes of the primary cluster to connect to + that cluster. + + !!! Warning + Enabling the secondary mode will delete all data on the secondary cluster and replicate + the state of the primary cluster. + + Parameters: + primary_node: The RPC address of one of the healthy nodes of the primary cluster. + tag: The identifier tag of the primary cluster. + + Raises: + TypeError: If primary_node or tag is not a string. + ValueError: If primary_node or tag is an empty string. + BadRequestError: If the request is invalid. + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + PreconditionFailedError: If the cluster is not in a state to enable secondary mode. + """ + if not isinstance(primary_node, str): + raise TypeError("primary_node must be a string") + if not primary_node: + raise ValueError("primary_node must be a non-empty string") + if not isinstance(tag, str): + raise TypeError("tag must be a string") + if not tag: + raise ValueError("tag must be a non-empty string") + + payload = {"primaryNode": primary_node, "tag": tag} + try: + response = self.http_client.post( + "/rest/cluster/config/secondary-mode", json=payload + ) + response.raise_for_status() + except httpx.HTTPStatusError as err: + status = err.response.status_code + if status == 400: + raise BadRequestError(f"Invalid request: {err.response.text}") from err + elif status == 401: + raise UnauthorisedError( + f"Request is unauthorised: {err.response.text}" + ) from err + elif status == 403: + raise ForbiddenError( + f"Request is forbidden: {err.response.text}" + ) from err + elif status == 412: + raise PreconditionFailedError( + f"Precondition failed: {err.response.text}" + ) from err + raise + + def disable_secondary_mode(self) -> None: + """Disable cluster secondary mode. + + Once in secondary mode, you can disable secondary mode and then you will no longer be in + that mode. Doing this will stop the pulling of updates from the primary cluster. + + Raises: + BadRequestError: If the request is invalid. + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + PreconditionFailedError: If the cluster is not in a state to disable secondary mode. + """ + try: + response = self.http_client.delete("/rest/cluster/config/secondary-mode") + response.raise_for_status() + except httpx.HTTPStatusError as err: + status = err.response.status_code + if status == 400: + raise BadRequestError(f"Invalid request: {err.response.text}") from err + elif status == 401: + raise UnauthorisedError( + f"Request is unauthorised: {err.response.text}" + ) from err + elif status == 403: + raise ForbiddenError( + f"Request is forbidden: {err.response.text}" + ) from err + elif status == 412: + raise PreconditionFailedError( + f"Precondition failed: {err.response.text}" + ) from err + raise + + def add_nodes(self, nodes: list[str]) -> None: + """Add nodes to the GraphDB cluster. + + Parameters: + nodes: List of node addresses to add to the cluster. + + Raises: + TypeError: If nodes is not a list of strings. + BadRequestError: If the request is invalid. + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + PreconditionFailedError: If one or more nodes in the group are not reachable. + """ + if not isinstance(nodes, list) or any( + not isinstance(node, str) for node in nodes + ): + raise TypeError("nodes must be a list[str].") + + payload = {"nodes": nodes} + headers = {"Content-Type": "application/json"} + try: + response = self.http_client.post( + "/rest/cluster/config/node", headers=headers, json=payload + ) + response.raise_for_status() + except httpx.HTTPStatusError as err: + status = err.response.status_code + if status == 400: + raise BadRequestError(f"Invalid request: {err.response.text}") from err + elif status == 401: + raise UnauthorisedError( + f"Request is unauthorised: {err.response.text}" + ) from err + elif status == 403: + raise ForbiddenError( + f"Request is forbidden: {err.response.text}" + ) from err + elif status == 412: + raise PreconditionFailedError( + f"Precondition failed: {err.response.text}" + ) from err + raise + + def remove_nodes(self, nodes: list[str]) -> None: + """Remove nodes from the GraphDB cluster. + + Parameters: + nodes: List of node addresses to remove from the cluster. + + Raises: + TypeError: If nodes is not a list of strings. + BadRequestError: If the request is invalid. + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + PreconditionFailedError: If one or more nodes in the group are not reachable. + """ + if not isinstance(nodes, list) or any( + not isinstance(node, str) for node in nodes + ): + raise TypeError("nodes must be a list[str].") + + payload = {"nodes": nodes} + try: + response = self.http_client.request( + method="DELETE", + url="/rest/cluster/config/node", + json=payload, + ) + response.raise_for_status() + except httpx.HTTPStatusError as err: + status = err.response.status_code + if status == 400: + raise BadRequestError(f"Invalid request: {err.response.text}") from err + elif status == 401: + raise UnauthorisedError( + f"Request is unauthorised: {err.response.text}" + ) from err + elif status == 403: + raise ForbiddenError( + f"Request is forbidden: {err.response.text}" + ) from err + elif status == 412: + raise PreconditionFailedError( + f"Precondition failed: {err.response.text}" + ) from err + raise + + def replace_nodes(self, add_nodes: list[str], remove_nodes: list[str]) -> None: + """Replace nodes in the GraphDB cluster. + + Parameters: + add_nodes: List of node addresses to add to the cluster. + remove_nodes: List of node addresses to remove from the cluster. + + Raises: + TypeError: If add_nodes or remove_nodes is not a list of strings. + BadRequestError: If the request is invalid. + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + PreconditionFailedError: If one or more nodes in the group are not reachable. + """ + if not isinstance(add_nodes, list) or any( + not isinstance(node, str) for node in add_nodes + ): + raise TypeError("add_nodes must be a list[str].") + if not isinstance(remove_nodes, list) or any( + not isinstance(node, str) for node in remove_nodes + ): + raise TypeError("remove_nodes must be a list[str].") + + payload = {"removeNodes": remove_nodes, "addNodes": add_nodes} + try: + response = self.http_client.patch("/rest/cluster/config/node", json=payload) + response.raise_for_status() + except httpx.HTTPStatusError as err: + status = err.response.status_code + if status == 400: + raise BadRequestError(f"Invalid request: {err.response.text}") from err + elif status == 401: + raise UnauthorisedError( + f"Request is unauthorised: {err.response.text}" + ) from err + elif status == 403: + raise ForbiddenError( + f"Request is forbidden: {err.response.text}" + ) from err + elif status == 412: + raise PreconditionFailedError( + f"Precondition failed: {err.response.text}" + ) from err + raise + + def node_status(self) -> NodeStatus: + """Get the status of this GraphDB cluster node. + + Returns: + NodeStatus: The status of this GraphDB cluster node. + + Raises: + ResponseFormatError: If the response cannot be parsed. + BadRequestError: If the request is invalid. + NotFoundError: If the node status is not found. + InternalServerError: If the internal server error. + """ + try: + headers = {"Accept": "application/json"} + response = self.http_client.get( + "/rest/cluster/node/status", headers=headers + ) + response.raise_for_status() + try: + return NodeStatus.from_dict(response.json()) + except (KeyError, TypeError, ValueError) as err: + raise ResponseFormatError( + f"Failed to parse node status: {err}" + ) from err + except httpx.HTTPStatusError as err: + status = err.response.status_code + if status == 400: + raise BadRequestError(f"Invalid request: {err.response.text}") from err + elif status == 404: + raise NotFoundError( + f"Node status not found: {err.response.text}" + ) from err + elif status == 500: + raise InternalServerError( + f"Internal server error: {err.response.text}" + ) from err + raise + + def group_status(self) -> list[NodeStatus]: + """Get the status of the GraphDB cluster. + + Returns: + A list of node statuses for the cluster group. + + Raises: + ResponseFormatError: If the response cannot be parsed. + BadRequestError: If the request is invalid. + NotFoundError: If the group status is not found. + InternalServerError: If the internal server error. + """ + try: + headers = {"Accept": "application/json"} + response = self.http_client.get( + "/rest/cluster/group/status", headers=headers + ) + response.raise_for_status() + try: + data = response.json() + return [NodeStatus.from_dict(item) for item in data] + except (KeyError, TypeError, ValueError) as err: + raise ResponseFormatError( + f"Failed to parse group status: {err}" + ) from err + except httpx.HTTPStatusError as err: + status = err.response.status_code + if status == 400: + raise BadRequestError(f"Invalid request: {err.response.text}") from err + elif status == 404: + raise NotFoundError( + f"Group status not found: {err.response.text}" + ) from err + elif status == 500: + raise InternalServerError( + f"Internal server error: {err.response.text}" + ) from err + raise + + +class Repository(rdflib.contrib.rdf4j.client.Repository): + """GraphDB Repository client. + + Overrides specific methods of the RDF4J Repository class and also provides GraphDB-only functionality + (such as FGAC ACL management) made available through the GraphDB REST API. + + Parameters: + identifier: The identifier of the repository. + http_client: The httpx.Client instance. + """ + + def __init__(self, identifier: str, http_client: httpx.Client): + super().__init__(identifier, http_client) + self._access_control_list_management = AccessControlListManagement( + self.identifier, self.http_client + ) + + @property + def acl(self) -> AccessControlListManagement: + return self._access_control_list_management + + def health(self, timeout: int = 5) -> bool: + """Repository health check. + + Parameters: + timeout: A timeout parameter in seconds. If provided, the endpoint attempts + to retrieve the repository within this timeout. If not, the passive + check is performed. + + Returns: + bool: True if the repository is healthy, otherwise an error is raised. + + Raises: + RepositoryNotFoundError: If the repository is not found. + RepositoryNotHealthyError: If the repository is not healthy. + """ + try: + params = {"passive": str(timeout)} + response = self.http_client.get( + f"/repositories/{self.identifier}/health", params=params + ) + response.raise_for_status() + return True + except httpx.HTTPStatusError as err: + if err.response.status_code == 404: + raise RepositoryNotFoundError( + f"Repository {self._identifier} not found." + ) + raise RepositoryNotHealthyError( + f"Repository {self._identifier} is not healthy. {err.response.status_code} - {err.response.text}" + ) + + def get_server_import_files(self) -> list[ImportSettings]: + """Get server files available for import. + + Returns: + A list of files available for import. + + Raises: + ResponseFormatError: If the response format is invalid. + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + InternalServerError: If the server returns an internal error. + """ + try: + headers = {"Accept": "application/json"} + response = self.http_client.get( + f"/rest/repositories/{self.identifier}/import/server", + headers=headers, + ) + response.raise_for_status() + try: + result = [] + for item in response.json(): + # Convert nested parserSettings dict to ParserSettings instance + if "parserSettings" in item and isinstance( + item["parserSettings"], dict + ): + item["parserSettings"] = ParserSettings( + **item["parserSettings"] + ) + result.append(ImportSettings(**item)) + return result + except (ValueError, TypeError) as err: + raise ResponseFormatError(f"Failed to parse response: {err}") from err + except httpx.HTTPStatusError as err: + if err.response.status_code == 401: + raise UnauthorisedError( + f"Request is unauthorised: {err.response.text}" + ) from err + elif err.response.status_code == 403: + raise ForbiddenError( + f"Request is forbidden: {err.response.text}" + ) from err + elif err.response.status_code == 500: + raise InternalServerError( + f"Internal server error: {err.response.text}" + ) from err + raise + + def import_server_import_file(self, server_import_body: ServerImportBody) -> None: + """Import a server file into the repository. + + Parameters: + server_import_body: The server import body. + + Raises: + BadRequestError: If the request is bad. + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + NotFoundError: If the request is not found. + """ + try: + headers = {"Content-Type": "application/json"} + response = self.http_client.post( + f"/rest/repositories/{self.identifier}/import/server", + headers=headers, + json=server_import_body.as_dict(), + ) + response.raise_for_status() + except httpx.HTTPStatusError as err: + status = err.response.status_code + if status == 400: + raise BadRequestError(f"Bad request: {err.response.text}") from err + elif status == 401: + raise UnauthorisedError( + f"Request is unauthorised: {err.response.text}" + ) from err + elif status == 403: + raise ForbiddenError( + f"Request is forbidden: {err.response.text}" + ) from err + elif status == 404: + raise NotFoundError( + f"Request is not found: {err.response.text}" + ) from err + raise + + def cancel_server_import_file(self, name: str) -> None: + """Cancel server file import operation. + + Parameters: + name: The name of the file import to interrupt. + + Raises: + BadRequestError: If the request is bad. + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + """ + try: + params = {"name": name} + response = self.http_client.delete( + f"/rest/repositories/{self.identifier}/import/server", + params=params, + ) + response.raise_for_status() + except httpx.HTTPStatusError as err: + status = err.response.status_code + if status == 400: + raise BadRequestError(f"Bad request: {err.response.text}") from err + elif status == 401: + raise UnauthorisedError( + f"Request is unauthorised: {err.response.text}" + ) from err + elif status == 403: + raise ForbiddenError( + f"Request is forbidden: {err.response.text}" + ) from err + raise + + +class RepositoryManager(rdflib.contrib.rdf4j.client.RepositoryManager): + """GraphDB Repository Manager. + + This manager client overrides specific RDF4J RepositoryManager class methods to provide GraphDB-specific implementations. + """ + + def get(self, repository_id: str) -> Repository: + """Get a repository by ID. + + !!! Note + This performs a health check before returning the repository object. + + Parameters: + repository_id: The identifier of the repository. + + Returns: + Repository: The repository instance. + + Raises: + RepositoryNotFoundError: If the repository is not found. + RepositoryNotHealthyError: If the repository is not healthy. + """ + _repo = super().get(repository_id) + return Repository(_repo.identifier, _repo.http_client) + + +class MonitoringManagement: + """ + Monitor different GraphDB processes. + """ + + def __init__(self, http_client: httpx.Client): + self._http_client = http_client + + @property + def http_client(self): + return self._http_client + + @property + def structures(self) -> StructuresStatistics: + """Get structures statistics. + + Returns: + The structures statistics. + + Raises: + ResponseFormatError: If the response format is invalid. + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + InternalServerError: If the server returns an internal error. + ServiceUnavailableError: If the server is unavailable. + """ + try: + headers = {"Accept": "application/json"} + response = self.http_client.get("/rest/monitor/structures", headers=headers) + response.raise_for_status() + try: + return StructuresStatistics(**response.json()) + except (ValueError, TypeError) as err: + raise ResponseFormatError(f"Failed to parse response: {err}") from err + except httpx.HTTPStatusError as err: + status = err.response.status_code + if status == 401: + raise UnauthorisedError( + f"Request is unauthorised: {err.response.text}" + ) from err + elif status == 403: + raise ForbiddenError( + f"Request is forbidden: {err.response.text}" + ) from err + elif status == 500: + raise InternalServerError( + f"Internal server error: {err.response.text}" + ) from err + elif status == 503: + raise ServiceUnavailableError( + f"Service is unavailable: {err.response.text}" + ) from err + raise + + def get_repo_stats(self, repository_id: str): + """Get repository statistics. + + Parameters: + repository_id: The identifier of the repository. + + Returns: + RepositoryStatistics: The repository statistics. + + Raises: + ResponseFormatError: If the response cannot be parsed. + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + InternalServerError: If the server returns an internal error. + """ + try: + headers = {"Accept": "application/json"} + response = self.http_client.get( + f"/rest/monitor/repository/{repository_id}", headers=headers + ) + response.raise_for_status() + try: + return RepositoryStatistics.from_dict(response.json()) + except (ValueError, TypeError, KeyError) as err: + raise ResponseFormatError(f"Failed to parse response: {err}") from err + except httpx.HTTPStatusError as err: + status = err.response.status_code + if status == 401: + raise UnauthorisedError( + f"Request is unauthorised: {err.response.text}" + ) from err + elif status == 403: + raise ForbiddenError( + f"Request is forbidden: {err.response.text}" + ) from err + elif status == 500: + raise InternalServerError( + f"Internal server error: {err.response.text}" + ) from err + raise + + @property + def infrastructure(self) -> InfrastructureStatistics: + """Get all infrastructure statistics. + + Returns: + InfrastructureStatistics: The infrastructure statistics. + + Raises: + ResponseFormatError: If the response cannot be parsed. + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + InternalServerError: If the server returns an internal error. + """ + try: + headers = {"Accept": "application/json"} + response = self.http_client.get( + "/rest/monitor/infrastructure", headers=headers + ) + response.raise_for_status() + try: + return InfrastructureStatistics.from_dict(response.json()) + except (ValueError, TypeError, KeyError) as err: + raise ResponseFormatError(f"Failed to parse response: {err}") from err + except httpx.HTTPStatusError as err: + status = err.response.status_code + if status == 401: + raise UnauthorisedError( + f"Request is unauthorised: {err.response.text}" + ) from err + elif status == 403: + raise ForbiddenError( + f"Request is forbidden: {err.response.text}" + ) from err + elif status == 500: + raise InternalServerError( + f"Internal server error: {err.response.text}" + ) from err + raise + + def cluster(self) -> str: + """Get cluster statistics. + + !!! Note + This endpoint is only available in GraphDB EE. + + Returns: + Prometheus-style metrics. + + Raises: + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + InternalServerError: If the server returns an internal error. + ServiceUnavailableError: If the server is unavailable. + """ + try: + headers = {"Accept": "text/plain"} + response = self.http_client.get("/rest/monitor/cluster", headers=headers) + response.raise_for_status() + return response.text + except httpx.HTTPStatusError as err: + status = err.response.status_code + if status == 401: + raise UnauthorisedError( + f"Request is unauthorised: {err.response.text}" + ) from err + elif status == 403: + raise ForbiddenError( + f"Request is forbidden: {err.response.text}" + ) from err + elif status == 500: + raise InternalServerError( + f"Internal server error: {err.response.text}" + ) from err + elif status == 503: + raise ServiceUnavailableError( + f"Service is unavailable: {err.response.text}" + ) from err + raise + + def backup(self) -> BackupOperationBean | None: + """Track backup operations. + + Returns: + On-going backup operations or `None` if no backup is in progress. + + Raises: + ResponseFormatError: If the response cannot be parsed. + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + InternalServerError: If the server returns an internal error. + ServiceUnavailableError: If the server is unavailable. + """ + try: + headers = {"Accept": "application/json"} + response = self.http_client.get("/rest/monitor/backup", headers=headers) + response.raise_for_status() + try: + data = response.json() + if not data: + return None + return BackupOperationBean.from_dict(data) + except (ValueError, TypeError, KeyError) as err: + raise ResponseFormatError(f"Failed to parse response: {err}") from err + except httpx.HTTPStatusError as err: + status = err.response.status_code + if status == 401: + raise UnauthorisedError( + f"Request is unauthorised: {err.response.text}" + ) from err + elif status == 403: + raise ForbiddenError( + f"Request is forbidden: {err.response.text}" + ) from err + elif status == 500: + raise InternalServerError( + f"Internal server error: {err.response.text}" + ) from err + elif status == 503: + raise ServiceUnavailableError( + f"Service is unavailable: {err.response.text}" + ) from err + raise + + +class RecoveryManagement: + """ + GraphDB Recovery Management client. + """ + + def __init__(self, http_client: httpx.Client): + self._http_client = http_client + + @property + def http_client(self): + return self._http_client + + def restore( + self, + backup: bytes | bytearray | memoryview | t.IO[bytes] | str | os.PathLike[str], + repositories: list[str] | None = None, + restore_system_data: bool | None = None, + remove_stale_repositories: bool | None = None, + ) -> None: + """Restore GraphDB instance from a backup archive. + + Parameters: + backup: Backup archive content as bytes/bytes-like, a binary file-like + object, or a filesystem path to a `.tar` produced by + [`backup`][rdflib.contrib.graphdb.client.RecoveryManagement.backup]. + repositories: List of repositories to restore. If `None` (default), the + parameter is omitted and all repositories found in the backup are + restored. If an empty list (`[]`) is provided, no repositories from + the backup are restored. + restore_system_data: Whether to restore system data (users, saved queries, + visual graphs, etc.). If omitted, GraphDB defaults to `false`. If + `true` and no system data exists in the backup, GraphDB returns an + error. + remove_stale_repositories: Whether to remove repositories on the target + instance that are not restored from the backup. If omitted, GraphDB + defaults to `false`. + + Raises: + ValueError: If parameters are invalid, or if backup is not a supported type. + BadRequestError: If the request is bad. + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + """ + if repositories is not None: + if not isinstance(repositories, list): + raise ValueError("repositories must be a list or None") + if not all(isinstance(r, str) for r in repositories): + raise ValueError("repositories must be a list of strings") + if ( + not isinstance(restore_system_data, bool) + and restore_system_data is not None + ): + raise ValueError("restore_system_data must be a bool or None") + if ( + not isinstance(remove_stale_repositories, bool) + and remove_stale_repositories is not None + ): + raise ValueError("remove_stale_repositories must be a bool or None") + + payload: dict[str, t.Any] = {} + if repositories is not None: + payload["repositories"] = repositories + if restore_system_data is not None: + payload["restoreSystemData"] = restore_system_data + if remove_stale_repositories is not None: + payload["removeStaleRepositories"] = remove_stale_repositories + + params_part: FileContent = (None, json.dumps(payload), "application/json") + + def _post(file_part: FileContent) -> None: + try: + response = self.http_client.post( + "/rest/recovery/restore", + files=[("params", params_part), ("file", file_part)], + ) + response.raise_for_status() + except httpx.HTTPStatusError as err: + status = err.response.status_code + if status == 400: + raise BadRequestError(f"Bad request: {err.response.text}") from err + elif status == 401: + raise UnauthorisedError( + f"Request is unauthorised: {err.response.text}" + ) from err + elif status == 403: + raise ForbiddenError( + f"Request is forbidden: {err.response.text}" + ) from err + raise err + + if isinstance(backup, (bytes, bytearray, memoryview)): + content = bytes(backup) + _post(("graphdb-backup.tar", content, "application/x-tar")) + return + + if hasattr(backup, "read") and not isinstance(backup, (str, os.PathLike)): + file_obj = t.cast(t.IO[bytes], backup) + filename = infer_filename_from_fileobj(file_obj, "graphdb-backup.tar") + _post((filename, file_obj, "application/x-tar")) + return + + if isinstance(backup, (str, os.PathLike)): + backup_path = pathlib.Path(backup).expanduser() + with open(backup_path, "rb") as f: + filename = backup_path.name or infer_filename_from_fileobj( + f, "graphdb-backup.tar" + ) + _post((filename, f, "application/x-tar")) + return + + raise ValueError( + "backup must be bytes/bytes-like, a binary file-like object, or a filesystem path" + ) + + def cloud_restore( + self, + bucket_uri: str, + repositories: list[str] | None = None, + restore_system_data: bool | None = None, + remove_stale_repositories: bool | None = None, + authentication_file: ( + bytes | bytearray | memoryview | t.IO[bytes] | str | os.PathLike[str] | None + ) = None, + ) -> None: + """Restore GraphDB instance from a cloud backup archive. + + Parameters: + bucket_uri: Cloud bucket URI including provider-specific parameters (required). + repositories: List of repositories to restore. If `None` (default), the + parameter is omitted and all repositories found in the backup are + restored. If an empty list (`[]`) is provided, no repositories from + the backup are restored. + restore_system_data: Whether to restore system data (users, saved queries, + visual graphs, etc.). If omitted, GraphDB defaults to `false`. If + `true` and no system data exists in the backup, GraphDB returns an + error. + remove_stale_repositories: Whether to remove repositories on the target + instance that are not restored from the backup. If omitted, GraphDB + defaults to `false`. + authentication_file: Optional credential file content as bytes/bytes-like, a + binary file-like object, or a filesystem path. + + Raises: + ValueError: If parameters are invalid, or authentication_file is not a supported type. + BadRequestError: If the request is bad. + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + """ + if not isinstance(bucket_uri, str) or not bucket_uri: + raise ValueError("bucket_uri must be a non-empty string") + + if repositories is not None: + if not isinstance(repositories, list): + raise ValueError("repositories must be a list or None") + if not all(isinstance(r, str) for r in repositories): + raise ValueError("repositories must be a list of strings") + if ( + not isinstance(restore_system_data, bool) + and restore_system_data is not None + ): + raise ValueError("restore_system_data must be a bool or None") + if ( + not isinstance(remove_stale_repositories, bool) + and remove_stale_repositories is not None + ): + raise ValueError("remove_stale_repositories must be a bool or None") + + payload: dict[str, t.Any] = {} + if repositories is not None: + payload["repositories"] = repositories + if restore_system_data is not None: + payload["restoreSystemData"] = restore_system_data + if remove_stale_repositories is not None: + payload["removeStaleRepositories"] = remove_stale_repositories + payload["bucketUri"] = bucket_uri + + params_part: FileContent = (None, json.dumps(payload), "application/json") + + def _post(authentication_part: FileContent | None) -> None: + files: list[tuple[str, FileContent]] = [("params", params_part)] + if authentication_part is not None: + files.append(("authenticationFile", authentication_part)) + try: + response = self.http_client.post( + "/rest/recovery/cloud-restore", + headers={"Accept": "application/json"}, + files=files, + ) + response.raise_for_status() + except httpx.HTTPStatusError as err: + status = err.response.status_code + if status == 400: + raise BadRequestError(f"Bad request: {err.response.text}") from err + elif status == 401: + raise UnauthorisedError( + f"Request is unauthorised: {err.response.text}" + ) from err + elif status == 403: + raise ForbiddenError( + f"Request is forbidden: {err.response.text}" + ) from err + raise err + + if authentication_file is None: + _post(None) + return + + if isinstance(authentication_file, (bytes, bytearray, memoryview)): + content = bytes(authentication_file) + _post(("authentication-file", content, "application/octet-stream")) + return + + if hasattr(authentication_file, "read") and not isinstance( + authentication_file, (str, os.PathLike) + ): + file_obj = t.cast(t.IO[bytes], authentication_file) + filename = infer_filename_from_fileobj(file_obj, "authentication-file") + _post((filename, file_obj, "application/octet-stream")) + return + + if isinstance(authentication_file, (str, os.PathLike)): + auth_path = pathlib.Path(authentication_file).expanduser() + with open(auth_path, "rb") as f: + filename = auth_path.name or infer_filename_from_fileobj( + f, "authentication-file" + ) + _post((filename, f, "application/octet-stream")) + return + + raise ValueError( + "authentication_file must be bytes/bytes-like, a binary file-like object, or a filesystem path" + ) + + @t.overload + def backup( + self, + repositories: list[str] | None = None, + backup_system_data: bool | None = None, + *, + dest: None = None, + ) -> bytes: ... + + @t.overload + def backup( + self, + repositories: list[str] | None = None, + backup_system_data: bool | None = None, + *, + dest: str | os.PathLike[str], + ) -> pathlib.Path: ... + + def backup( + self, + repositories: list[str] | None = None, + backup_system_data: bool | None = None, + *, + dest: str | os.PathLike[str] | None = None, + ) -> bytes | pathlib.Path: + """Create a new backup of GraphDB instance. + + The backup is returned as a tar archive containing repository data and + optionally system data (user accounts, saved queries, visual graphs, etc.). + + Parameters: + repositories: List of repositories to be backed up, specified by their repository identifiers. + If `None`, all repositories will be included in the backup. + backup_system_data: Determines whether user account data such as user accounts, saved queries, + or visual graphs, among others, should be included in the backup. + dest: Destination path to save the backup archive. If `None`, the backup + content is returned as bytes (suitable for small backups). If a directory + path is provided, the filename from the response Content-Disposition header + is used (e.g., backup-2026-01-16-10-30-00.tar). If a file path is provided, + that exact path is used. The response is streamed directly to disk + (recommended for large backups). + + Returns: + bytes: If `dest` is `None`, returns the backup archive as bytes. + Path: If `dest` is provided, returns the resolved `pathlib.Path` where the backup was saved. + + Raises: + ValueError: If repositories is not a list or None, or if backup_system_data is not a bool or None. + BadRequestError: If the request is bad. + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + OSError: If the destination path cannot be written to. + """ + if repositories is not None: + if not isinstance(repositories, list): + raise ValueError("repositories must be a list or None") + if not all(isinstance(r, str) for r in repositories): + raise ValueError("repositories must be a list of strings") + if not isinstance(backup_system_data, bool) and backup_system_data is not None: + raise ValueError("backup_system_data must be a bool") + + payload: dict[str, t.Any] = {} + if repositories is not None: + payload["repositories"] = repositories + if backup_system_data is not None: + payload["backupSystemData"] = backup_system_data + + def _handle_http_error(err: httpx.HTTPStatusError) -> t.NoReturn: + status = err.response.status_code + if status == 400: + raise BadRequestError(f"Bad request: {err.response.text}") from err + elif status == 401: + raise UnauthorisedError( + f"Request is unauthorised: {err.response.text}" + ) from err + elif status == 403: + raise ForbiddenError( + f"Request is forbidden: {err.response.text}" + ) from err + raise err + + if dest is None: + # Return bytes directly (suitable for small backups) + try: + response = self.http_client.post("/rest/recovery/backup", json=payload) + response.raise_for_status() + return response.content + except httpx.HTTPStatusError as err: + _handle_http_error(err) + else: + # Stream to disk (recommended for large backups) + dest_path = pathlib.Path(dest).expanduser().resolve() + + try: + with self.http_client.stream( + "POST", "/rest/recovery/backup", json=payload + ) as response: + response.raise_for_status() + + # If dest is a directory, extract filename from Content-Disposition + if dest_path.is_dir(): + content_disposition = response.headers.get( + "Content-Disposition", "" + ) + filename = extract_filename_from_content_disposition( + content_disposition + ) + if filename: + dest_path = dest_path / filename + else: + # Fallback to a default name if header parsing fails + dest_path = dest_path / "graphdb-backup.tar" + + # Use a temporary file during download, then rename atomically + tmp_path = dest_path.with_suffix(dest_path.suffix + ".partial") + + with open(tmp_path, "wb") as f: + for chunk in response.iter_bytes(): + f.write(chunk) + tmp_path.replace(dest_path) + return dest_path + except httpx.HTTPStatusError as err: + _handle_http_error(err) + + def cloud_backup( + self, + bucket_uri: str, + repositories: list[str] | None = None, + backup_system_data: bool | None = None, + authentication_file: ( + bytes | bytearray | memoryview | t.IO[bytes] | str | os.PathLike[str] | None + ) = None, + ) -> None: + """Create a new backup of GraphDB instance uploaded to a cloud bucket. + + GraphDB uploads the resulting `.tar` archive directly to the configured + cloud bucket. This uses the GraphDB endpoint `/rest/recovery/cloud-backup`. + + Parameters: + bucket_uri: Cloud bucket URI including provider-specific parameters (required). + repositories: Optional list of repositories to be backed up. + backup_system_data: Optional flag to include system data (users, saved queries, etc.). + authentication_file: Optional credential file content as bytes/bytes-like, a + binary file-like object, or a filesystem path. + + Raises: + ValueError: If parameters are invalid, or authentication_file is not a supported type. + BadRequestError: If the request is bad. + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + """ + if not isinstance(bucket_uri, str) or not bucket_uri: + raise ValueError("bucket_uri must be a non-empty string") + + if repositories is not None: + if not isinstance(repositories, list): + raise ValueError("repositories must be a list or None") + if not all(isinstance(r, str) for r in repositories): + raise ValueError("repositories must be a list of strings") + + if not isinstance(backup_system_data, bool) and backup_system_data is not None: + raise ValueError("backup_system_data must be a bool") + + payload: dict[str, t.Any] = {} + if repositories is not None: + payload["repositories"] = repositories + if backup_system_data is not None: + payload["backupSystemData"] = backup_system_data + payload["bucketUri"] = bucket_uri + + params_part: FileContent = (None, json.dumps(payload), "application/json") + + def _post(authentication_part: FileContent | None) -> None: + files: list[tuple[str, FileContent]] = [("params", params_part)] + if authentication_part is not None: + files.append(("authenticationFile", authentication_part)) + try: + response = self.http_client.post( + "/rest/recovery/cloud-backup", + headers={"Accept": "application/json"}, + files=files, + ) + response.raise_for_status() + except httpx.HTTPStatusError as err: + status = err.response.status_code + if status == 400: + raise BadRequestError(f"Bad request: {err.response.text}") from err + elif status == 401: + raise UnauthorisedError( + f"Request is unauthorised: {err.response.text}" + ) from err + elif status == 403: + raise ForbiddenError( + f"Request is forbidden: {err.response.text}" + ) from err + raise err + + if authentication_file is None: + _post(None) + return + + if isinstance(authentication_file, (bytes, bytearray, memoryview)): + content = bytes(authentication_file) + _post(("authentication-file", content, "application/octet-stream")) + return + + if hasattr(authentication_file, "read") and not isinstance( + authentication_file, (str, os.PathLike) + ): + file_obj = t.cast(t.IO[bytes], authentication_file) + filename = infer_filename_from_fileobj(file_obj, "authentication-file") + _post((filename, file_obj, "application/octet-stream")) + return + + if isinstance(authentication_file, (str, os.PathLike)): + auth_path = pathlib.Path(authentication_file).expanduser() + with open(auth_path, "rb") as f: + filename = auth_path.name or infer_filename_from_fileobj( + f, "authentication-file" + ) + _post((filename, f, "application/octet-stream")) + return + + raise ValueError( + "authentication_file must be bytes/bytes-like, a binary file-like object, or a filesystem path" + ) + + +class RepositoryManagement: + """GraphDB Repository Management client. + + The functionality provided by this management client accepts an optional location parameter to operate on external + GraphDB locations. + """ + + def __init__(self, http_client: httpx.Client): + self._http_client = http_client + + def list(self, location: str | None = None) -> list[GraphDBRepository]: + """List all repositories. + + Parameters: + location: The location of the repositories. + + Returns: + list[GraphDBRepository]: List of GraphDB repositories. + + Raises: + InternalServerError: If the server returns an internal error. + ResponseFormatError: If the response cannot be parsed. + """ + params = {} + if location is not None: + params["location"] = location + try: + response = self.http_client.get("/rest/repositories", params=params) + response.raise_for_status() + try: + return [GraphDBRepository.from_dict(repo) for repo in response.json()] + except (ValueError, TypeError) as err: + raise ResponseFormatError( + f"Failed to parse GraphDB response: {err}" + ) from err + except httpx.HTTPStatusError as err: + if err.response.status_code == 500: + raise InternalServerError( + f"Internal server error: {err.response.text}" + ) from err + raise + + def create( + self, + config: RepositoryConfigBeanCreate | str, + location: str | None = None, + files: FilesType | None = None, + ): + """Create a new repository. + + Parameters: + config: Repository configuration. When a `RepositoryConfigBeanCreate` is + provided, the request is sent as JSON. When a string is provided, it + is treated as Turtle content and sent as multipart/form-data part + `config` (required by GraphDB) with the content type `text/turtle`. + location: Optional repository location (query param `location`). + files: Optional extra multipart parts for GraphDB-specific files (e.g. + `obdaFile`, `owlFile`, `propertiesFile`, `constraintFile`, + `dbMetadataFile`, `lensesFile`). Keys must be the form part names; + values may be file content or httpx-style file tuples. Ignored when + `config` is a dataclass (JSON payload). + + Raises: + BadRequestError: If the request is invalid. + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + InternalServerError: If the server returns an internal error. + """ + params = {} + if location is not None: + params["location"] = location + + def _normalize_file_content(field: str, value: FileContent) -> FileContent: + if isinstance(value, tuple): + # fill in the missing filename with the field name + if len(value) == 2: + filename, content = value + return (filename or field, content) + filename, content, content_type = value + return (filename or field, content, content_type) + return (field, value) + + try: + if isinstance(config, str): + extra_parts: list[tuple[str, FileContent]] = [] + if files is not None: + if isinstance(files, t.Mapping): + extra_parts = list(files.items()) + else: + extra_parts = list(files) + + if any(field == "config" for field, _ in extra_parts): + raise ValueError( + "Do not pass a 'config' multipart part via files; use the config argument instead." + ) + + multipart_files: list[tuple[str, FileContent]] = [ + ("config", ("config.ttl", config, "text/turtle")) + ] + for field, content in extra_parts: + multipart_files.append( + (field, _normalize_file_content(field, content)) + ) + + response = self.http_client.post( + "/rest/repositories", + params=params, + files=multipart_files, + ) + else: + if files is not None: + raise ValueError( + "Additional files can only be provided when config is a Turtle string." + ) + response = self.http_client.post( + "/rest/repositories", + headers={"Content-Type": "application/json"}, + json=config.as_dict(), + params=params, + ) + response.raise_for_status() + except httpx.HTTPStatusError as err: + status = err.response.status_code + if status == 400: + raise BadRequestError(f"Invalid request: {err.response.text}") from err + elif status == 401: + raise UnauthorisedError( + f"Request is unauthorised: {err.response.text}" + ) from err + elif status == 403: + raise ForbiddenError( + f"Request is forbidden: {err.response.text}" + ) from err + elif status == 500: + raise InternalServerError( + f"Internal server error: {err.response.text}" + ) from err + raise + + @property + def http_client(self): + return self._http_client + + @t.overload + def get( + self, + repository_id: str, + content_type: t.Literal["application/json"], + location: str | None = None, + ) -> RepositoryConfigBean: ... + + @t.overload + def get( + self, + repository_id: str, + content_type: None = None, + location: str | None = None, + ) -> RepositoryConfigBean: ... + + @t.overload + def get( + self, + repository_id: str, + content_type: t.Literal["text/turtle"], + location: str | None = None, + ) -> Graph: ... + + @t.overload + def get( + self, + repository_id: str, + content_type: str, + location: str | None = None, + ) -> RepositoryConfigBean | Graph: ... + + def get( + self, + repository_id: str, + content_type: str | None = None, + location: str | None = None, + ) -> RepositoryConfigBean | Graph: + """Get a repository's configuration. + + Parameters: + repository_id: The identifier of the repository. + content_type: The content type of the response. Can be `application/json` or + `text/turtle`. Defaults to `application/json`. + location: The location of the repository. + + Returns: + RepositoryConfigBean: The repository configuration. + Graph: The repository configuration in RDF. + + Raises: + BadRequestError: If the content type is not supported. + ResponseFormatError: If the response cannot be parsed. + RepositoryNotFoundError: If the repository is not found. + InternalServerError: If the server returns an internal error. + """ + if content_type is None: + content_type = "application/json" + if content_type not in ("application/json", "text/turtle"): + raise ValueError(f"Unsupported content type: {content_type}.") + headers = {"Accept": content_type} + params = {} + if location is not None: + params["location"] = location + try: + response = self.http_client.get( + f"/rest/repositories/{repository_id}", headers=headers, params=params + ) + response.raise_for_status() + + if content_type == "application/json": + try: + return RepositoryConfigBean(**response.json()) + except (ValueError, TypeError) as err: + raise ResponseFormatError( + "Failed to parse GraphDB response." + ) from err + elif content_type == "text/turtle": + try: + return Graph().parse(data=response.text, format="turtle") + except Exception as err: + raise ResponseFormatError(f"Error parsing RDF: {err}") from err + else: + raise ValueError(f"Unhandled content type: {content_type}.") + except httpx.HTTPStatusError as err: + if err.response.status_code == 404: + raise RepositoryNotFoundError( + f"Repository {repository_id} not found." + ) from err + elif err.response.status_code == 500: + raise InternalServerError("Internal server error.") from err + raise + + def edit(self, repository_id: str, config: RepositoryConfigBeanCreate) -> None: + """Edit a repository's configuration. + + Parameters: + repository_id: The identifier of the repository. + config: The repository configuration. + + Raises: + BadRequestError: If the request is invalid. + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + InternalServerError: If the server returns an internal error. + """ + headers = { + "Content-Type": "application/json", + } + try: + response = self.http_client.put( + f"/rest/repositories/{repository_id}", + headers=headers, + json=config.as_dict(), + ) + response.raise_for_status() + except httpx.HTTPStatusError as err: + if err.response.status_code == 400: + raise BadRequestError(f"Invalid request: {err.response.text}") from err + elif err.response.status_code == 401: + raise UnauthorisedError( + f"Request is unauthorised: {err.response.text}" + ) from err + elif err.response.status_code == 403: + raise ForbiddenError( + f"Request is forbidden: {err.response.text}" + ) from err + elif err.response.status_code == 500: + raise InternalServerError( + f"Internal server error: {err.response.text}" + ) from err + raise + + def delete(self, repository_id: str, location: str | None = None) -> None: + """Delete a repository. + + Parameters: + repository_id: The identifier of the repository. + location: The location of the repository. + + Raises: + BadRequestError: If the request is invalid. + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + InternalServerError: If the server returns an internal error. + """ + params = {} + if location is not None: + params["location"] = location + try: + response = self.http_client.delete( + f"/rest/repositories/{repository_id}", params=params + ) + response.raise_for_status() + except httpx.HTTPStatusError as err: + if err.response.status_code == 400: + raise BadRequestError(f"Invalid request: {err.response.text}") from err + elif err.response.status_code == 401: + raise UnauthorisedError( + f"Request is unauthorised: {err.response.text}" + ) from err + elif err.response.status_code == 403: + raise ForbiddenError( + f"Request is forbidden: {err.response.text}" + ) from err + elif err.response.status_code == 500: + raise InternalServerError( + f"Internal server error: {err.response.text}" + ) from err + raise + + def restart( + self, repository_id: str, sync: bool | None = None, location: str | None = None + ) -> str: + """Restart a repository. + + Parameters: + repository_id: The identifier of the repository. + sync: Whether to sync the repository. + location: The location of the repository. + + Returns: + str: The response text. + + Raises: + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + RepositoryNotFoundError: If the repository is not found. + """ + params = {} + if sync is not None: + params["sync"] = str(sync).lower() + if location is not None: + params["location"] = location + try: + response = self.http_client.post( + f"/rest/repositories/{repository_id}/restart", params=params + ) + response.raise_for_status() + return response.text + except httpx.HTTPStatusError as err: + if err.response.status_code == 401: + raise UnauthorisedError("Request is unauthorised.") from err + elif err.response.status_code == 403: + raise ForbiddenError("Request is forbidden.") from err + elif err.response.status_code == 404: + raise RepositoryNotFoundError( + f"Repository {repository_id} not found." + ) from err + raise + + def size( + self, repository_id: str, location: str | None = None + ) -> RepositorySizeInfo: + """Get repository size. + + Parameters: + repository_id: The identifier of the repository. + location: The location of the repository. + + Raises: + ResponseFormatError: If the response cannot be parsed. + InternalServerError: If the server returns an internal error. + """ + params = {} + if location: + params["location"] = location + try: + response = self.http_client.get( + f"/rest/repositories/{repository_id}/size", params=params + ) + response.raise_for_status() + try: + return RepositorySizeInfo(**response.json()) + except (ValueError, TypeError) as err: + raise ResponseFormatError("Failed to parse GraphDB response.") from err + except httpx.HTTPStatusError as err: + if err.response.status_code == 500: + raise InternalServerError( + f"Internal server error: {err.response.text}" + ) from err + raise + + @t.overload + def validate( + self, + repository_id: str, + *, + content_type: str, + content: str, + location: str | None = None, + shapes_repository_id: None = None, + ) -> str: ... + + @t.overload + def validate( + self, + repository_id: str, + *, + content: t.IO[bytes], + content_type: str | None = None, + location: str | None = None, + shapes_repository_id: None = None, + ) -> str: ... + + @t.overload + def validate( + self, + repository_id: str, + *, + shapes_repository_id: str, + location: str | None = None, + ) -> str: ... + + def validate( + self, + repository_id: str, + *, + content_type: str | None = None, + content: str | t.IO[bytes] | None = None, + location: str | None = None, + shapes_repository_id: str | None = None, + ) -> str: + """Validate repository data using SHACL shapes. + + Parameters: + repository_id: The identifier of the repository. + content_type: Content type of the request body (required for text payloads). + content: SHACL shapes payload; string for text-based validation or file-like + (binary) object for multipart validation. + location: Optional repository location. + shapes_repository_id: ID of repository containing SHACL shapes; when + provided, no content is sent and shapes are fetched from that + repository. + + Returns: + str: Validation report as RDF Turtle. + + Raises: + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + InternalServerError: If the server returns an internal error. + """ + params = {} + if location is not None: + params["location"] = location + + if shapes_repository_id is not None: + if content is not None: + raise ValueError( + "content must not be provided when shapes_repository_id is set." + ) + if content_type is not None: + raise ValueError( + "content_type must not be provided when shapes_repository_id is set." + ) + headers = {"Accept": "text/turtle"} + try: + response = self.http_client.post( + url=f"/rest/repositories/{repository_id}/validate/repository/{shapes_repository_id}", + params=params, + headers=headers, + ) + response.raise_for_status() + return response.text + except httpx.HTTPStatusError as err: + status = err.response.status_code + if status == 401: + raise UnauthorisedError("Request is unauthorised.") from err + elif status == 403: + raise ForbiddenError("Request is forbidden.") from err + elif status == 500: + raise InternalServerError( + f"Internal server error: {err.response.text}" + ) from err + raise + + if content is None: + raise ValueError("content must be provided.") + + is_file_like = hasattr(content, "read") and not isinstance(content, str) + + if is_file_like: + headers = {"Accept": "text/turtle"} + file_part = ( + "shapes.ttl", + t.cast(t.IO[bytes], content), + content_type or "text/turtle", + ) + files: FilesType = {"file": file_part} + try: + response = self.http_client.post( + url=f"/rest/repositories/{repository_id}/validate/file", + params=params, + headers=headers, + files=files, + ) + response.raise_for_status() + return response.text + except httpx.HTTPStatusError as err: + status = err.response.status_code + if status == 401: + raise UnauthorisedError("Request is unauthorised.") from err + elif status == 403: + raise ForbiddenError("Request is forbidden.") from err + elif status == 500: + raise InternalServerError( + f"Internal server error: {err.response.text}" + ) from err + raise + else: + if not content_type: + raise ValueError("content_type must be provided for text validation.") + + headers = {"Content-Type": content_type, "Accept": "text/turtle"} + try: + response = self.http_client.post( + url=f"/rest/repositories/{repository_id}/validate/text", + params=params, + headers=headers, + content=content, + ) + response.raise_for_status() + return response.text + except httpx.HTTPStatusError as err: + status = err.response.status_code + if status == 401: + raise UnauthorisedError("Request is unauthorised.") from err + elif status == 403: + raise ForbiddenError("Request is forbidden.") from err + elif status == 500: + raise InternalServerError( + f"Internal server error: {err.response.text}" + ) from err + raise + + +class SecurityManagement: + """GraphDB Security Management client.""" + + def __init__(self, http_client: httpx.Client): + self._http_client = http_client + + @property + def http_client(self): + return self._http_client + + @property + def enabled(self) -> bool: + """Check if security is enabled. + + Returns: + bool: True if security is enabled, False otherwise. + + Raises: + ResponseFormatError: If the response format is invalid. + InternalServerError: If the server returns an internal error. + """ + try: + headers = {"Accept": "application/json"} + response = self.http_client.get("/rest/security", headers=headers) + response.raise_for_status() + try: + value = response.json() + if not isinstance(value, bool): + raise ResponseFormatError("Response is not a boolean.") + return value + except (ValueError, TypeError) as err: + raise ResponseFormatError( + f"Failed to parse GraphDB response: {err}" + ) from err + except httpx.HTTPStatusError as err: + if err.response.status_code == 500: + raise InternalServerError( + f"Internal server error: {err.response.text}" + ) from err + raise + + @enabled.setter + def enabled(self, value: bool): + """Enable or disable security. + + Parameters: + value: The value to set. + + Raises: + TypeError: If the value is not a boolean. + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + PreconditionFailedError: If the precondition is failed. + """ + if not isinstance(value, bool): + raise TypeError("Value must be a boolean.") + try: + headers = {"Content-Type": "application/json", "Accept": "application/json"} + response = self.http_client.post( + "/rest/security", headers=headers, json=value + ) + response.raise_for_status() + except httpx.HTTPStatusError as err: + if err.response.status_code == 401: + raise UnauthorisedError("Request is unauthorised.") from err + elif err.response.status_code == 403: + raise ForbiddenError("Request is forbidden.") from err + elif err.response.status_code == 412: + raise PreconditionFailedError("Precondition failed.") from err + raise + + def get_free_access_details(self): + """ + Check if free access is enabled. + + Returns: + FreeAccessSettings: The free access settings. + + Raises: + ResponseFormatError: If the response format is invalid. + InternalServerError: If the server returns an internal error. + """ + try: + headers = {"Accept": "application/json"} + response = self.http_client.get( + "/rest/security/free-access", headers=headers + ) + response.raise_for_status() + try: + return FreeAccessSettings(**response.json()) + except (ValueError, TypeError) as err: + raise ResponseFormatError( + f"Failed to parse GraphDB response: {err}" + ) from err + except httpx.HTTPStatusError as err: + if err.response.status_code == 500: + raise InternalServerError( + f"Internal server error: {err.response.text}" + ) from err + raise + + def set_free_access_details(self, free_access_settings: FreeAccessSettings): + """ + Enable or disable free access. + + Parameters: + free_access_settings: The free access settings. + + Raises: + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + PreconditionFailedError: If the precondition is failed. + """ + try: + headers = {"Content-Type": "application/json", "Accept": "application/json"} + response = self.http_client.post( + "/rest/security/free-access", + headers=headers, + json=free_access_settings.as_dict(), + ) + response.raise_for_status() + except httpx.HTTPStatusError as err: + if err.response.status_code == 401: + raise UnauthorisedError("Request is unauthorised.") from err + elif err.response.status_code == 403: + raise ForbiddenError("Request is forbidden.") from err + elif err.response.status_code == 412: + raise PreconditionFailedError("Precondition failed.") from err + raise + + +class UserManagement: + """GraphDB User Management client.""" + + def __init__(self, http_client: httpx.Client): + self._http_client = http_client + + @property + def http_client(self): + return self._http_client + + def list(self) -> list[User]: + """ + Get all users. + + Returns: + A list of users. + + Raises: + ResponseFormatError: If the response format is invalid. + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + PreconditionFailedError: If the precondition is failed. + InternalServerError: If the server returns an internal error. + """ + headers = {"Accept": "application/json"} + try: + response = self.http_client.get("/rest/security/users", headers=headers) + response.raise_for_status() + try: + return [User(**user) for user in response.json()] + except (ValueError, TypeError) as err: + raise ResponseFormatError( + f"Failed to parse GraphDB response: {err}" + ) from err + except httpx.HTTPStatusError as err: + if err.response.status_code == 401: + raise UnauthorisedError("Request is unauthorised.") from err + elif err.response.status_code == 403: + raise ForbiddenError("Request is forbidden.") from err + elif err.response.status_code == 412: + raise PreconditionFailedError("Precondition failed.") from err + elif err.response.status_code == 500: + raise InternalServerError( + f"Internal server error: {err.response.text}" + ) from err + raise + + def get(self, username: str) -> User: + """ + Get a user. + + Parameters: + username: The username of the user. + + Returns: + User: The user. + + Raises: + ResponseFormatError: If the response format is invalid. + ForbiddenError: If the request is forbidden. + NotFoundError: If the user is not found. + InternalServerError: If the server returns an internal error. + """ + try: + headers = {"Accept": "application/json"} + response = self.http_client.get( + f"/rest/security/users/{username}", headers=headers + ) + response.raise_for_status() + try: + return User(**response.json()) + except (ValueError, TypeError) as err: + raise ResponseFormatError( + f"Failed to parse GraphDB response: {err}" + ) from err + except httpx.HTTPStatusError as err: + if err.response.status_code == 403: + raise ForbiddenError("Request is forbidden.") from err + elif err.response.status_code == 404: + raise NotFoundError("User not found.") from err + elif err.response.status_code == 500: + raise InternalServerError( + f"Internal server error: {err.response.text}" + ) from err + raise + + def overwrite(self, username: str, user: User) -> None: + """ + Overwrite a user. + + Parameters: + username: The username of the user. + user: The user to overwrite. + + Raises: + TypeError: if username is not a string or user is not an instance of User. + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + NotFoundError: If the user is not found. + """ + if not isinstance(username, str): + raise TypeError("Username must be a string.") + if not isinstance(user, User): + raise TypeError("User must be an instance of User.") + + try: + headers = {"Content-Type": "application/json"} + response = self.http_client.put( + f"/rest/security/users/{username}", headers=headers, json=user.as_dict() + ) + response.raise_for_status() + except httpx.HTTPStatusError as err: + if err.response.status_code == 401: + raise UnauthorisedError("Request is unauthorised.") from err + elif err.response.status_code == 403: + raise ForbiddenError("Request is forbidden.") from err + elif err.response.status_code == 404: + raise NotFoundError("User not found.") from err + raise + + def create(self, username: str, user: UserCreate) -> None: + """ + Create a user. + + Parameters: + username: The username of the user. + user: The user to create. + + Raises: + TypeError: if username is not a string or user is not an instance of UserCreate. + BadRequestError: If the request is bad. + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + """ + if not isinstance(username, str): + raise TypeError("Username must be a string.") + if not isinstance(user, UserCreate): + raise TypeError("User must be an instance of UserCreate.") + + try: + headers = {"Content-Type": "application/json"} + response = self.http_client.post( + f"/rest/security/users/{username}", headers=headers, json=user.as_dict() + ) + response.raise_for_status() + except httpx.HTTPStatusError as err: + if err.response.status_code == 400: + raise BadRequestError(f"Bad request. {err.response.text}") from err + elif err.response.status_code == 401: + raise UnauthorisedError("Request is unauthorised.") from err + elif err.response.status_code == 403: + raise ForbiddenError("Request is forbidden.") from err + raise + + def delete(self, username: str) -> None: + """ + Delete a user. + + Parameters: + username: The username of the user. + + Raises: + TypeError: if username is not a string. + BadRequestError: If the request is bad. + UnauthorisedError: If the request is unauthorised. + ForbiddenError: If the request is forbidden. + NotFoundError: If the user is not found. + """ + if not isinstance(username, str): + raise TypeError("Username must be a string.") + + try: + response = self.http_client.delete(f"/rest/security/users/{username}") + response.raise_for_status() + except httpx.HTTPStatusError as err: + if err.response.status_code == 400: + raise BadRequestError(f"Bad request. {err.response.text}") from err + elif err.response.status_code == 401: + raise UnauthorisedError("Request is unauthorised.") from err + elif err.response.status_code == 403: + raise ForbiddenError("Request is forbidden.") from err + elif err.response.status_code == 404: + raise NotFoundError("User not found.") from err + raise + + def update(self, username: str, user: UserUpdate | dict[str, t.Any]) -> None: + """ + Update a user. + + !!! Note + Certain user fields are not updatable using PATCH. For example, at the + time of writing, `grantedAuthorities` are not updatable, but `appSettings` are. + + Parameters: + username: The username of the user. + user: The user data to update, either as a UserUpdate instance or a dict. + + Raises: + TypeError: if username is not a string or user is not an instance of UserUpdate or dict. + ForbiddenError: If the request is forbidden. + PreconditionFailedError: If the precondition is failed. + """ + if not isinstance(username, str): + raise TypeError("Username must be a string.") + if not isinstance(user, (UserUpdate, dict)): + raise TypeError("User must be an instance of UserUpdate or dict.") + + if isinstance(user, UserUpdate): + user_data = user.as_dict() + else: + user_data = user + + try: + headers = {"Content-Type": "application/json"} + response = self.http_client.patch( + f"/rest/security/users/{username}", headers=headers, json=user_data + ) + response.raise_for_status() + except httpx.HTTPStatusError as err: + if err.response.status_code == 403: + raise ForbiddenError("Request is forbidden.") from err + elif err.response.status_code == 412: + raise PreconditionFailedError("Precondition failed.") from err + raise + + def custom_roles(self, username: str) -> t.List[str]: + """ + Retrieve custom roles associated with the user. + + Parameters: + username: The username of the user. + + Returns: + list[str]: The custom roles for the user. + + Raises: + TypeError: if username is not a string. + ForbiddenError: If the request is forbidden. + NotFoundError: If the user is not found. + InternalServerError: If the request fails. + """ + if not isinstance(username, str): + raise TypeError("Username must be a string.") + + try: + response = self.http_client.get( + f"/rest/security/users/{username}/custom-roles" + ) + response.raise_for_status() + return response.json() + except httpx.HTTPStatusError as err: + if err.response.status_code == 403: + raise ForbiddenError("Request is forbidden.") from err + elif err.response.status_code == 404: + raise NotFoundError("User not found.") from err + elif err.response.status_code == 500: + raise InternalServerError("Internal server error.") from err + raise + + +class GraphDBClient(RDF4JClient): + """GraphDB Client + + This client and its inner management objects perform HTTP requests via + httpx and may raise httpx-specific exceptions. Errors documented by GraphDB + in its OpenAPI specification are mapped to specific exceptions in this + library where applicable. Error mappings are documented on each management + method. The underlying httpx client is reused across + requests, and connection pooling is handled automatically by httpx. + + Parameters: + base_url: The base URL of the GraphDB server. + auth: Authentication credentials. Can be a tuple (username, password) for + basic auth, or a string for token-based auth (e.g., "GDB ") + which is added as the Authorization header. + timeout: Request timeout in seconds or an httpx.Timeout for fine-grained control (default: 30.0). + kwargs: Additional keyword arguments to pass to the httpx.Client. + """ + + def __init__( + self, + base_url: str, + auth: tuple[str, str] | str | None = None, + timeout: float | httpx.Timeout = 30.0, + **kwargs: t.Any, + ): + super().__init__(base_url, auth, timeout, **kwargs) + self._cluster_group = ClusterGroupManagement(self.http_client) + self._monitoring = MonitoringManagement(self.http_client) + self._recovery = RecoveryManagement(self.http_client) + self._graphdb_repository_manager = RepositoryManager(self.http_client) + self._graphdb_repositories = RepositoryManagement(self.http_client) + self._security = SecurityManagement(self.http_client) + self._users = UserManagement(self.http_client) + + @property + def cluster(self) -> ClusterGroupManagement: + return self._cluster_group + + @property + def monitoring(self) -> MonitoringManagement: + return self._monitoring + + @property + def recovery(self) -> RecoveryManagement: + return self._recovery + + @property + def repositories(self) -> RepositoryManager: + """Server-level repository management operations (GraphDB-specific).""" + return self._graphdb_repository_manager + + @property + def graphdb_repositories(self) -> RepositoryManagement: + return self._graphdb_repositories + + @property + def security(self) -> SecurityManagement: + return self._security + + @property + def users(self) -> UserManagement: + return self._users + + def login(self, username: str, password: str) -> AuthenticatedUser: + """Authenticate with GraphDB and obtain a GDB token. + + Parameters: + username: The username to authenticate with. + password: The password to authenticate with. + + Returns: + An AuthenticatedUser instance containing user details and the GDB token. + + Raises: + UnauthorisedError: If the credentials are invalid. + BadRequestError: If the request body is invalid. + ResponseFormatError: If the response cannot be parsed. + """ + try: + response = self.http_client.post( + "/rest/login", + json={"username": username, "password": password}, + ) + response.raise_for_status() + + auth_header = response.headers.get("Authorization", "") + if not auth_header.startswith("GDB "): + raise ResponseFormatError( + "Authorization header missing or invalid format" + ) + + try: + data = response.json() + except (ValueError, TypeError) as err: + raise ResponseFormatError( + f"Failed to parse login response: {err}" + ) from err + + try: + return AuthenticatedUser.from_response(data, auth_header) + except (ValueError, TypeError) as err: + raise ResponseFormatError( + f"Failed to parse authenticated user: {err}" + ) from err + + except httpx.HTTPStatusError as err: + status = err.response.status_code + if status == 400: + raise BadRequestError(f"Invalid request: {err.response.text}") from err + elif status == 401: + raise UnauthorisedError( + f"Invalid credentials: {err.response.text}" + ) from err + raise diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/graphdb/exceptions.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/graphdb/exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..96ffe68b5a2d5bdc05f52b671b32e8ef7ebafc65 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/graphdb/exceptions.py @@ -0,0 +1,53 @@ +"""GraphDB exceptions.""" + +import rdflib.contrib.rdf4j.exceptions as rdf4j_exceptions + + +class GraphDBError(Exception): + """Base class for GraphDB exceptions.""" + + +class ResponseFormatError(GraphDBError): + """Raised when the response format is invalid.""" + + +class RepositoryNotHealthyError( + GraphDBError, rdf4j_exceptions.RepositoryNotHealthyError +): + """Raised when the repository is not healthy.""" + + +class RepositoryNotFoundError(GraphDBError, rdf4j_exceptions.RepositoryNotFoundError): + """Raised when the repository is not found.""" + + +class BadRequestError(GraphDBError): + """Raised when the request is invalid.""" + + +class UnauthorisedError(GraphDBError): + """Raised when the user is unauthorised.""" + + +class ForbiddenError(GraphDBError): + """Raised when the user is forbidden.""" + + +class NotFoundError(GraphDBError): + """Raised when the resource is not found.""" + + +class ConflictError(GraphDBError): + """Raised when the request conflicts with the current state of the server.""" + + +class PreconditionFailedError(GraphDBError): + """Raised when the precondition is failed.""" + + +class InternalServerError(GraphDBError): + """Raised when the server returns an internal server error.""" + + +class ServiceUnavailableError(GraphDBError): + """Raised when the server is unavailable.""" diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/graphdb/models.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/graphdb/models.py new file mode 100644 index 0000000000000000000000000000000000000000..0c0728fc0d43ab2583aec72b468b100b74b48d96 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/graphdb/models.py @@ -0,0 +1,1613 @@ +from __future__ import annotations + +import typing as t +from dataclasses import asdict, dataclass, field +from enum import Enum + +from rdflib import Literal, URIRef +from rdflib.util import from_n3 + + +@dataclass(frozen=True) +class TopologyStatus: + state: str + primaryTags: dict[str, t.Any] # noqa: N815 + + def __post_init__(self) -> None: + invalid: list[tuple[str, t.Any, type]] = [] + state = t.cast(t.Any, self.state) + primary_tags = t.cast(t.Any, self.primaryTags) + + if not isinstance(state, str): + invalid.append(("state", state, type(state))) + if not isinstance(primary_tags, dict): + invalid.append(("primaryTags", primary_tags, type(primary_tags))) + else: + for key, value in primary_tags.items(): + if not isinstance(key, str): + invalid.append((f"primaryTags key '{key}'", key, type(key))) + + if invalid: + raise ValueError("Invalid TopologyStatus values: ", invalid) + + +@dataclass(frozen=True) +class RecoveryOperation: + name: str + message: str + + def __post_init__(self) -> None: + invalid: list[tuple[str, t.Any, type]] = [] + name = t.cast(t.Any, self.name) + message = t.cast(t.Any, self.message) + + if not isinstance(name, str): + invalid.append(("name", name, type(name))) + if not isinstance(message, str): + invalid.append(("message", message, type(message))) + + if invalid: + raise ValueError("Invalid RecoveryOperation values: ", invalid) + + +@dataclass(frozen=True) +class RecoveryStatus: + state: RecoveryOperation | None = None + message: str | None = None + affectedNodes: list[str] = field(default_factory=list) # noqa: N815 + + def __post_init__(self) -> None: + invalid: list[tuple[str, t.Any, type]] = [] + state = t.cast(t.Any, self.state) + message = t.cast(t.Any, self.message) + affected_nodes = t.cast(t.Any, self.affectedNodes) + + if state is not None and not isinstance(state, RecoveryOperation): + invalid.append(("state", state, type(state))) + if message is not None and not isinstance(message, str): + invalid.append(("message", message, type(message))) + if not isinstance(affected_nodes, list): + invalid.append(("affectedNodes", affected_nodes, type(affected_nodes))) + else: + for index, value in enumerate(affected_nodes): + if not isinstance(value, str): + invalid.append((f"affectedNodes[{index}]", value, type(value))) + + if invalid: + raise ValueError("Invalid RecoveryStatus values: ", invalid) + + @classmethod + def from_dict(cls, data: dict) -> RecoveryStatus: + """Create a RecoveryStatus instance from a dict. + + This is useful for converting JSON response data into the dataclass structure. + Handles empty dict {} by returning a RecoveryStatus with all None/default values. + The nested 'state' dict (if present) is automatically converted to + a RecoveryOperation instance. + + Parameters: + data: A dict containing the recovery status data, typically + parsed from a JSON response. Can be an empty dict. + + Returns: + A RecoveryStatus instance with nested dataclass objects. + + Raises: + KeyError: If required keys are missing from the input dict. + TypeError: If nested 'state' cannot be unpacked into RecoveryOperation. + ValueError: If field validation fails in RecoveryOperation or + RecoveryStatus (e.g., invalid types). + """ + # Handle empty dict case + if not data: + return cls() + + state = None + if "state" in data and data["state"] is not None: + state = RecoveryOperation(**data["state"]) + + return cls( + state=state, + message=data.get("message"), + affectedNodes=data.get("affectedNodes", []), + ) + + +@dataclass(frozen=True) +class NodeStatus: + address: str + nodeState: str # noqa: N815 + term: int + syncStatus: dict[str, str] # noqa: N815 + lastLogTerm: int # noqa: N815 + lastLogIndex: int # noqa: N815 + endpoint: str + recoveryStatus: RecoveryStatus | None # noqa: N815 + topologyStatus: TopologyStatus | None # noqa: N815 + clusterEnabled: bool | None # noqa: N815 + + def __post_init__(self) -> None: + invalid: list[tuple[str, t.Any, type]] = [] + address = t.cast(t.Any, self.address) + node_state = t.cast(t.Any, self.nodeState) + term = t.cast(t.Any, self.term) + sync_status = t.cast(t.Any, self.syncStatus) + last_log_term = t.cast(t.Any, self.lastLogTerm) + last_log_index = t.cast(t.Any, self.lastLogIndex) + endpoint = t.cast(t.Any, self.endpoint) + recovery_status = t.cast(t.Any, self.recoveryStatus) + topology_status = t.cast(t.Any, self.topologyStatus) + cluster_enabled = t.cast(t.Any, self.clusterEnabled) + + if not isinstance(address, str): + invalid.append(("address", address, type(address))) + if not isinstance(node_state, str): + invalid.append(("nodeState", node_state, type(node_state))) + if type(term) is not int: + invalid.append(("term", term, type(term))) + if not isinstance(sync_status, dict): + invalid.append(("syncStatus", sync_status, type(sync_status))) + else: + for key, value in sync_status.items(): + if not isinstance(key, str): + invalid.append((f"syncStatus key '{key}'", key, type(key))) + if not isinstance(value, str): + invalid.append((f"syncStatus['{key}']", value, type(value))) + if type(last_log_term) is not int: + invalid.append(("lastLogTerm", last_log_term, type(last_log_term))) + if type(last_log_index) is not int: + invalid.append(("lastLogIndex", last_log_index, type(last_log_index))) + if not isinstance(endpoint, str): + invalid.append(("endpoint", endpoint, type(endpoint))) + if recovery_status is not None and not isinstance( + recovery_status, RecoveryStatus + ): + invalid.append(("recoveryStatus", recovery_status, type(recovery_status))) + if topology_status is not None and not isinstance( + topology_status, TopologyStatus + ): + invalid.append(("topologyStatus", topology_status, type(topology_status))) + if cluster_enabled is not None and type(cluster_enabled) is not bool: + invalid.append(("clusterEnabled", cluster_enabled, type(cluster_enabled))) + + if invalid: + raise ValueError("Invalid NodeStatus values: ", invalid) + + @classmethod + def from_dict(cls, data: dict) -> NodeStatus: + """Create a NodeStatus instance from a dict. + + This is useful for converting JSON response data into the dataclass structure. + The nested 'recoveryStatus' and 'topologyStatus' dicts are automatically + converted to their respective dataclass instances. + + Parameters: + data: A dict containing the node status data, typically + parsed from a JSON response. + + Returns: + A NodeStatus instance with nested dataclass objects. + + Raises: + KeyError: If required keys are missing from the input dict. + TypeError: If nested dicts cannot be unpacked into their respective + dataclass instances. + ValueError: If field validation fails in TopologyStatus, RecoveryOperation, + RecoveryStatus, or NodeStatus (e.g., invalid types). + """ + # Handle recoveryStatus - can be empty dict or actual data + recovery_status = None + if "recoveryStatus" in data and data["recoveryStatus"]: + recovery_status = RecoveryStatus.from_dict(data["recoveryStatus"]) + elif "recoveryStatus" in data: + # Empty dict case + recovery_status = RecoveryStatus.from_dict({}) + + # Handle topologyStatus - optional field + topology_status = None + if "topologyStatus" in data and data["topologyStatus"]: + topology_status = TopologyStatus(**data["topologyStatus"]) + + return cls( + address=data["address"], + nodeState=data["nodeState"], + term=data["term"], + syncStatus=data["syncStatus"], + lastLogTerm=data["lastLogTerm"], + lastLogIndex=data["lastLogIndex"], + endpoint=data["endpoint"], + recoveryStatus=recovery_status, + topologyStatus=topology_status, + clusterEnabled=data.get("clusterEnabled"), + ) + + +@dataclass(frozen=True) +class ClusterRequest: + electionMinTimeout: int # noqa: N815 + electionRangeTimeout: int # noqa: N815 + heartbeatInterval: int # noqa: N815 + messageSizeKB: int # noqa: N815 + verificationTimeout: int # noqa: N815 + transactionLogMaximumSizeGB: int # noqa: N815 + batchUpdateInterval: int # noqa: N815 + nodes: list[str] + + def __post_init__(self) -> None: + invalid: list[tuple[str, t.Any, type]] = [] + election_min_timeout = t.cast(t.Any, self.electionMinTimeout) + election_range_timeout = t.cast(t.Any, self.electionRangeTimeout) + heartbeat_interval = t.cast(t.Any, self.heartbeatInterval) + message_size_kb = t.cast(t.Any, self.messageSizeKB) + verification_timeout = t.cast(t.Any, self.verificationTimeout) + transaction_log_maximum_size_gb = t.cast( + t.Any, self.transactionLogMaximumSizeGB + ) + batch_update_interval = t.cast(t.Any, self.batchUpdateInterval) + nodes = t.cast(t.Any, self.nodes) + + if type(election_min_timeout) is not int: + invalid.append( + ("electionMinTimeout", election_min_timeout, type(election_min_timeout)) + ) + if type(election_range_timeout) is not int: + invalid.append( + ( + "electionRangeTimeout", + election_range_timeout, + type(election_range_timeout), + ) + ) + if type(heartbeat_interval) is not int: + invalid.append( + ("heartbeatInterval", heartbeat_interval, type(heartbeat_interval)) + ) + if type(message_size_kb) is not int: + invalid.append(("messageSizeKB", message_size_kb, type(message_size_kb))) + if type(verification_timeout) is not int: + invalid.append( + ( + "verificationTimeout", + verification_timeout, + type(verification_timeout), + ) + ) + if type(transaction_log_maximum_size_gb) is not int: + invalid.append( + ( + "transactionLogMaximumSizeGB", + transaction_log_maximum_size_gb, + type(transaction_log_maximum_size_gb), + ) + ) + if type(batch_update_interval) is not int: + invalid.append( + ( + "batchUpdateInterval", + batch_update_interval, + type(batch_update_interval), + ) + ) + + if not isinstance(nodes, list): + invalid.append(("nodes", nodes, type(nodes))) + else: + for index, value in enumerate(nodes): + if not isinstance(value, str): + invalid.append((f"nodes[{index}]", value, type(value))) + + if invalid: + raise ValueError("Invalid ClusterRequest values: ", invalid) + + @classmethod + def from_dict(cls, data: dict) -> ClusterRequest: + """Create a ClusterRequest instance from a dict. + + This is useful for converting JSON response data into the dataclass structure. + + Parameters: + data: A dict containing the cluster request data, typically + parsed from a JSON response. + + Returns: + A ClusterRequest instance. + + Raises: + KeyError: If required keys are missing from the input dict. + TypeError: If the dict cannot be unpacked into ClusterRequest. + ValueError: If field validation fails in ClusterRequest + (e.g., invalid types for integer fields or nodes). + """ + return cls( + electionMinTimeout=data["electionMinTimeout"], + electionRangeTimeout=data["electionRangeTimeout"], + heartbeatInterval=data["heartbeatInterval"], + messageSizeKB=data["messageSizeKB"], + verificationTimeout=data["verificationTimeout"], + transactionLogMaximumSizeGB=data["transactionLogMaximumSizeGB"], + batchUpdateInterval=data["batchUpdateInterval"], + nodes=data["nodes"], + ) + + +@dataclass(frozen=True) +class SnapshotOptionsBean: + withRepositoryData: bool # noqa: N815 + withSystemData: bool # noqa: N815 + cleanDataDir: bool # noqa: N815 + repositories: list[str] | None = None + + def __post_init__(self) -> None: + invalid: list[tuple[str, t.Any, type]] = [] + with_repository_data = t.cast(t.Any, self.withRepositoryData) + with_system_data = t.cast(t.Any, self.withSystemData) + clean_data_dir = t.cast(t.Any, self.cleanDataDir) + repositories = t.cast(t.Any, self.repositories) + + if type(with_repository_data) is not bool: + invalid.append( + ("withRepositoryData", with_repository_data, type(with_repository_data)) + ) + if type(with_system_data) is not bool: + invalid.append(("withSystemData", with_system_data, type(with_system_data))) + if type(clean_data_dir) is not bool: + invalid.append(("cleanDataDir", clean_data_dir, type(clean_data_dir))) + + if repositories is not None: + if not isinstance(repositories, list): + invalid.append(("repositories", repositories, type(repositories))) + else: + for index, value in enumerate(repositories): + if not isinstance(value, str): + invalid.append((f"repositories[{index}]", value, type(value))) + + if invalid: + raise ValueError("Invalid SnapshotOptionsBean values: ", invalid) + + +@dataclass(frozen=True) +class BackupOperationBean: + id: str + username: str + operation: t.Literal[ + "CREATE_BACKUP_IN_PROGRESS", + "RESTORE_BACKUP_IN_PROGRESS", + "CREATE_CLOUD_BACKUP_IN_PROGRESS", + "RESTORE_CLOUD_BACKUP_IN_PROGRESS", + ] + affectedRepositories: list[str] # noqa: N815 + msSinceCreated: int # noqa: N815 + snapshotOptions: SnapshotOptionsBean # noqa: N815 + nodePerformingClusterBackup: str | None = None # noqa: N815 + + def __post_init__(self) -> None: + _allowed_operations = { + "CREATE_BACKUP_IN_PROGRESS", + "RESTORE_BACKUP_IN_PROGRESS", + "CREATE_CLOUD_BACKUP_IN_PROGRESS", + "RESTORE_CLOUD_BACKUP_IN_PROGRESS", + } + invalid: list[tuple[str, t.Any, type]] = [] + id_ = t.cast(t.Any, self.id) + username = t.cast(t.Any, self.username) + operation = t.cast(t.Any, self.operation) + affected_repositories = t.cast(t.Any, self.affectedRepositories) + ms_since_created = t.cast(t.Any, self.msSinceCreated) + snapshot_options = t.cast(t.Any, self.snapshotOptions) + node_performing_cluster_backup = t.cast(t.Any, self.nodePerformingClusterBackup) + + if not isinstance(id_, str): + invalid.append(("id", id_, type(id_))) + if not isinstance(username, str): + invalid.append(("username", username, type(username))) + if not isinstance(operation, str) or operation not in _allowed_operations: + invalid.append(("operation", operation, type(operation))) + if not isinstance(affected_repositories, list): + invalid.append( + ( + "affectedRepositories", + affected_repositories, + type(affected_repositories), + ) + ) + else: + for index, value in enumerate(affected_repositories): + if not isinstance(value, str): + invalid.append( + (f"affectedRepositories[{index}]", value, type(value)) + ) + if type(ms_since_created) is not int: + invalid.append(("msSinceCreated", ms_since_created, type(ms_since_created))) + if not isinstance(snapshot_options, SnapshotOptionsBean): + invalid.append( + ("snapshotOptions", snapshot_options, type(snapshot_options)) + ) + if node_performing_cluster_backup is not None and not isinstance( + node_performing_cluster_backup, str + ): + invalid.append( + ( + "nodePerformingClusterBackup", + node_performing_cluster_backup, + type(node_performing_cluster_backup), + ) + ) + + if invalid: + raise ValueError("Invalid BackupOperationBean values: ", invalid) + + @classmethod + def from_dict(cls, data: dict) -> BackupOperationBean: + """Create a BackupOperationBean instance from a dict. + + This is useful for converting JSON response data into the dataclass structure. + The nested 'snapshotOptions' dict is automatically converted to + a SnapshotOptionsBean instance. + + Parameters: + data: A dict containing the backup operation data, typically + parsed from a JSON response. + + Returns: + A BackupOperationBean instance with nested dataclass objects. + + Raises: + KeyError: If required keys are missing from the input dict. + TypeError: If nested 'snapshotOptions' cannot be unpacked into + SnapshotOptionsBean. + ValueError: If field validation fails in SnapshotOptionsBean or + BackupOperationBean (e.g., invalid types or operation values). + """ + snapshot_options = SnapshotOptionsBean(**data["snapshotOptions"]) + return cls( + id=data["id"], + username=data["username"], + operation=data["operation"], + affectedRepositories=data["affectedRepositories"], + msSinceCreated=data["msSinceCreated"], + snapshotOptions=snapshot_options, + nodePerformingClusterBackup=data.get("nodePerformingClusterBackup"), + ) + + +@dataclass(frozen=True) +class StructuresStatistics: + cacheHit: int # noqa: N815 + cacheMiss: int # noqa: N815 + + def __post_init__(self) -> None: + invalid: list[tuple[str, t.Any, type]] = [] + cache_hit = t.cast(t.Any, self.cacheHit) + cache_miss = t.cast(t.Any, self.cacheMiss) + + if type(cache_hit) is not int: + invalid.append(("cacheHit", cache_hit, type(cache_hit))) + if type(cache_miss) is not int: + invalid.append(("cacheMiss", cache_miss, type(cache_miss))) + + if invalid: + raise ValueError("Invalid StructuresStatistics values: ", invalid) + + +@dataclass(frozen=True) +class RepositoryStatisticsQueries: + slow: int + suboptimal: int + + def __post_init__(self) -> None: + invalid: list[tuple[str, t.Any, type]] = [] + slow = t.cast(t.Any, self.slow) + suboptimal = t.cast(t.Any, self.suboptimal) + + if type(slow) is not int: + invalid.append(("slow", slow, type(slow))) + if type(suboptimal) is not int: + invalid.append(("suboptimal", suboptimal, type(suboptimal))) + + if invalid: + raise ValueError("Invalid RepositoryStatisticsQueries values: ", invalid) + + +@dataclass(frozen=True) +class RepositoryStatisticsEntityPool: + epoolReads: int # noqa: N815 + epoolWrites: int # noqa: N815 + epoolSize: int # noqa: N815 + + def __post_init__(self) -> None: + invalid: list[tuple[str, t.Any, type]] = [] + epool_reads = t.cast(t.Any, self.epoolReads) + epool_writes = t.cast(t.Any, self.epoolWrites) + epool_size = t.cast(t.Any, self.epoolSize) + + if type(epool_reads) is not int: + invalid.append(("epoolReads", epool_reads, type(epool_reads))) + if type(epool_writes) is not int: + invalid.append(("epoolWrites", epool_writes, type(epool_writes))) + if type(epool_size) is not int: + invalid.append(("epoolSize", epool_size, type(epool_size))) + + if invalid: + raise ValueError("Invalid RepositoryStatisticsEntityPool values: ", invalid) + + +@dataclass(frozen=True) +class RepositoryStatistics: + queries: RepositoryStatisticsQueries + entityPool: RepositoryStatisticsEntityPool # noqa: N815 + activeTransactions: int # noqa: N815 + openConnections: int # noqa: N815 + + def __post_init__(self) -> None: + invalid: list[tuple[str, t.Any, type]] = [] + queries = t.cast(t.Any, self.queries) + entity_pool = t.cast(t.Any, self.entityPool) + active_transactions = t.cast(t.Any, self.activeTransactions) + open_connections = t.cast(t.Any, self.openConnections) + + if not isinstance(queries, RepositoryStatisticsQueries): + invalid.append(("queries", queries, type(queries))) + if not isinstance(entity_pool, RepositoryStatisticsEntityPool): + invalid.append(("entityPool", entity_pool, type(entity_pool))) + if type(active_transactions) is not int: + invalid.append( + ("activeTransactions", active_transactions, type(active_transactions)) + ) + if type(open_connections) is not int: + invalid.append( + ("openConnections", open_connections, type(open_connections)) + ) + + if invalid: + raise ValueError("Invalid RepositoryStatistics values: ", invalid) + + @classmethod + def from_dict(cls, data: dict) -> RepositoryStatistics: + """Create a RepositoryStatistics instance from a dict. + + This is useful for converting JSON response data into the dataclass structure. + The nested 'queries' and 'entityPool' dicts are automatically converted to + their respective dataclass instances. + + Parameters: + data: A dict containing the repository statistics data, typically + parsed from a JSON response. + + Returns: + A RepositoryStatistics instance with nested dataclass objects. + + Raises: + KeyError: If required keys are missing from the input dict. + TypeError: If nested dicts cannot be unpacked into their respective + dataclass instances. + ValueError: If field validation fails in RepositoryStatisticsQueries, + RepositoryStatisticsEntityPool, or RepositoryStatistics + (e.g., invalid types). + """ + queries = RepositoryStatisticsQueries(**data["queries"]) + entity_pool = RepositoryStatisticsEntityPool(**data["entityPool"]) + return cls( + queries=queries, + entityPool=entity_pool, + activeTransactions=data["activeTransactions"], + openConnections=data["openConnections"], + ) + + +@dataclass(frozen=True) +class InfrastructureMemoryUsage: + max: int + committed: int + init: int + used: int + + def __post_init__(self) -> None: + invalid: list[tuple[str, t.Any, type]] = [] + max_val = t.cast(t.Any, self.max) + committed = t.cast(t.Any, self.committed) + init = t.cast(t.Any, self.init) + used = t.cast(t.Any, self.used) + + if type(max_val) is not int: + invalid.append(("max", max_val, type(max_val))) + if type(committed) is not int: + invalid.append(("committed", committed, type(committed))) + if type(init) is not int: + invalid.append(("init", init, type(init))) + if type(used) is not int: + invalid.append(("used", used, type(used))) + + if invalid: + raise ValueError("Invalid InfrastructureMemoryUsage values: ", invalid) + + +@dataclass(frozen=True) +class InfrastructureStorageMemory: + dataDirUsed: int # noqa: N815 + workDirUsed: int # noqa: N815 + logsDirUsed: int # noqa: N815 + dataDirFree: int # noqa: N815 + workDirFree: int # noqa: N815 + logsDirFree: int # noqa: N815 + + def __post_init__(self) -> None: + invalid: list[tuple[str, t.Any, type]] = [] + data_dir_used = t.cast(t.Any, self.dataDirUsed) + work_dir_used = t.cast(t.Any, self.workDirUsed) + logs_dir_used = t.cast(t.Any, self.logsDirUsed) + data_dir_free = t.cast(t.Any, self.dataDirFree) + work_dir_free = t.cast(t.Any, self.workDirFree) + logs_dir_free = t.cast(t.Any, self.logsDirFree) + + if type(data_dir_used) is not int: + invalid.append(("dataDirUsed", data_dir_used, type(data_dir_used))) + if type(work_dir_used) is not int: + invalid.append(("workDirUsed", work_dir_used, type(work_dir_used))) + if type(logs_dir_used) is not int: + invalid.append(("logsDirUsed", logs_dir_used, type(logs_dir_used))) + if type(data_dir_free) is not int: + invalid.append(("dataDirFree", data_dir_free, type(data_dir_free))) + if type(work_dir_free) is not int: + invalid.append(("workDirFree", work_dir_free, type(work_dir_free))) + if type(logs_dir_free) is not int: + invalid.append(("logsDirFree", logs_dir_free, type(logs_dir_free))) + + if invalid: + raise ValueError("Invalid InfrastructureStorageMemory values: ", invalid) + + +@dataclass(frozen=True) +class InfrastructureStatistics: + heapMemoryUsage: InfrastructureMemoryUsage # noqa: N815 + nonHeapMemoryUsage: InfrastructureMemoryUsage # noqa: N815 + storageMemory: InfrastructureStorageMemory # noqa: N815 + threadCount: int # noqa: N815 + cpuLoad: float # noqa: N815 + classCount: int # noqa: N815 + gcCount: int # noqa: N815 + openFileDescriptors: int # noqa: N815 + maxFileDescriptors: int # noqa: N815 + + def __post_init__(self) -> None: + invalid: list[tuple[str, t.Any, type]] = [] + heap_memory_usage = t.cast(t.Any, self.heapMemoryUsage) + non_heap_memory_usage = t.cast(t.Any, self.nonHeapMemoryUsage) + storage_memory = t.cast(t.Any, self.storageMemory) + thread_count = t.cast(t.Any, self.threadCount) + cpu_load = t.cast(t.Any, self.cpuLoad) + class_count = t.cast(t.Any, self.classCount) + gc_count = t.cast(t.Any, self.gcCount) + open_file_descriptors = t.cast(t.Any, self.openFileDescriptors) + max_file_descriptors = t.cast(t.Any, self.maxFileDescriptors) + + if not isinstance(heap_memory_usage, InfrastructureMemoryUsage): + invalid.append( + ("heapMemoryUsage", heap_memory_usage, type(heap_memory_usage)) + ) + if not isinstance(non_heap_memory_usage, InfrastructureMemoryUsage): + invalid.append( + ( + "nonHeapMemoryUsage", + non_heap_memory_usage, + type(non_heap_memory_usage), + ) + ) + if not isinstance(storage_memory, InfrastructureStorageMemory): + invalid.append(("storageMemory", storage_memory, type(storage_memory))) + if type(thread_count) is not int: + invalid.append(("threadCount", thread_count, type(thread_count))) + if type(cpu_load) is not float and type(cpu_load) is not int: + invalid.append(("cpuLoad", cpu_load, type(cpu_load))) + if type(class_count) is not int: + invalid.append(("classCount", class_count, type(class_count))) + if type(gc_count) is not int: + invalid.append(("gcCount", gc_count, type(gc_count))) + if type(open_file_descriptors) is not int: + invalid.append( + ( + "openFileDescriptors", + open_file_descriptors, + type(open_file_descriptors), + ) + ) + if type(max_file_descriptors) is not int: + invalid.append( + ("maxFileDescriptors", max_file_descriptors, type(max_file_descriptors)) + ) + + if invalid: + raise ValueError("Invalid InfrastructureStatistics values: ", invalid) + + @classmethod + def from_dict(cls, data: dict) -> InfrastructureStatistics: + """Create an InfrastructureStatistics instance from a dict. + + This is useful for converting JSON response data into the dataclass structure. + The nested memory and storage dicts are automatically converted to their + respective dataclass instances. + + Parameters: + data: A dict containing the infrastructure statistics data, typically + parsed from a JSON response. + + Returns: + An InfrastructureStatistics instance with nested dataclass objects. + + Raises: + KeyError: If required keys are missing from the input dict. + TypeError: If nested dicts cannot be unpacked into their respective + dataclass instances. + ValueError: If field validation fails in InfrastructureMemoryUsage, + InfrastructureStorageMemory, or InfrastructureStatistics + (e.g., invalid types). + """ + heap_memory_usage = InfrastructureMemoryUsage(**data["heapMemoryUsage"]) + non_heap_memory_usage = InfrastructureMemoryUsage(**data["nonHeapMemoryUsage"]) + storage_memory = InfrastructureStorageMemory(**data["storageMemory"]) + return cls( + heapMemoryUsage=heap_memory_usage, + nonHeapMemoryUsage=non_heap_memory_usage, + storageMemory=storage_memory, + threadCount=data["threadCount"], + cpuLoad=float(data["cpuLoad"]), + classCount=data["classCount"], + gcCount=data["gcCount"], + openFileDescriptors=data["openFileDescriptors"], + maxFileDescriptors=data["maxFileDescriptors"], + ) + + +@dataclass(frozen=True) +class ParserSettings: + preserveBNodeIds: bool = False # noqa: N815 + failOnUnknownDataTypes: bool = False # noqa: N815 + verifyDataTypeValues: bool = False # noqa: N815 + normalizeDataTypeValues: bool = False # noqa: N815 + failOnUnknownLanguageTags: bool = False # noqa: N815 + verifyLanguageTags: bool = True # noqa: N815 + normalizeLanguageTags: bool = False # noqa: N815 + stopOnError: bool = True # noqa: N815 + contextLink: t.Any | None = None # noqa: N815 + + def __post_init__(self) -> None: + invalid: list[tuple[str, t.Any, type]] = [] + preserve_bnode_ids = t.cast(t.Any, self.preserveBNodeIds) + fail_on_unknown_data_types = t.cast(t.Any, self.failOnUnknownDataTypes) + verify_data_type_values = t.cast(t.Any, self.verifyDataTypeValues) + normalize_data_type_values = t.cast(t.Any, self.normalizeDataTypeValues) + fail_on_unknown_language_tags = t.cast(t.Any, self.failOnUnknownLanguageTags) + verify_language_tags = t.cast(t.Any, self.verifyLanguageTags) + normalize_language_tags = t.cast(t.Any, self.normalizeLanguageTags) + stop_on_error = t.cast(t.Any, self.stopOnError) + + if type(preserve_bnode_ids) is not bool: + invalid.append( + ("preserveBNodeIds", preserve_bnode_ids, type(preserve_bnode_ids)) + ) + if type(fail_on_unknown_data_types) is not bool: + invalid.append( + ( + "failOnUnknownDataTypes", + fail_on_unknown_data_types, + type(fail_on_unknown_data_types), + ) + ) + if type(verify_data_type_values) is not bool: + invalid.append( + ( + "verifyDataTypeValues", + verify_data_type_values, + type(verify_data_type_values), + ) + ) + if type(normalize_data_type_values) is not bool: + invalid.append( + ( + "normalizeDataTypeValues", + normalize_data_type_values, + type(normalize_data_type_values), + ) + ) + if type(fail_on_unknown_language_tags) is not bool: + invalid.append( + ( + "failOnUnknownLanguageTags", + fail_on_unknown_language_tags, + type(fail_on_unknown_language_tags), + ) + ) + if type(verify_language_tags) is not bool: + invalid.append( + ("verifyLanguageTags", verify_language_tags, type(verify_language_tags)) + ) + if type(normalize_language_tags) is not bool: + invalid.append( + ( + "normalizeLanguageTags", + normalize_language_tags, + type(normalize_language_tags), + ) + ) + if type(stop_on_error) is not bool: + invalid.append(("stopOnError", stop_on_error, type(stop_on_error))) + + # Note: don't check contextLink here since it's of type t.Any. + + if invalid: + raise ValueError("Invalid ParserSettings values: ", invalid) + + def as_dict(self) -> dict[str, t.Any]: + return asdict(self) + + +@dataclass(frozen=True) +class ImportSettings: + name: str + status: t.Literal["PENDING", "IMPORTING", "DONE", "ERROR", "NONE", "INTERRUPTING"] + size: str + lastModified: int # noqa: N815 + imported: int + addedStatements: int # noqa: N815 + removedStatements: int # noqa: N815 + numReplacedGraphs: int # noqa: N815 + message: str = "" + context: t.Any | None = None + replaceGraphs: t.List = field(default_factory=list) # noqa: N815 + baseURI: t.Any | None = None # noqa: N815 + forceSerial: bool = False # noqa: N815 + type: str = "file" + format: t.Any | None = None + data: t.Any | None = None + parserSettings: ParserSettings = field(default_factory=ParserSettings) # noqa: N815 + + def __post_init__(self) -> None: + _allowed_status = { + "PENDING", + "IMPORTING", + "DONE", + "ERROR", + "NONE", + "INTERRUPTING", + } + invalid: list[tuple[str, t.Any, type]] = [] + + name = t.cast(t.Any, self.name) + status = t.cast(t.Any, self.status) + message = t.cast(t.Any, self.message) + replace_graphs = t.cast(t.Any, self.replaceGraphs) + force_serial = t.cast(t.Any, self.forceSerial) + type_ = t.cast(t.Any, self.type) + parser_settings = t.cast(t.Any, self.parserSettings) + size = t.cast(t.Any, self.size) + last_modified = t.cast(t.Any, self.lastModified) + imported = t.cast(t.Any, self.imported) + added_statements = t.cast(t.Any, self.addedStatements) + removed_statements = t.cast(t.Any, self.removedStatements) + num_replaced_graphs = t.cast(t.Any, self.numReplacedGraphs) + + if not isinstance(name, str): + invalid.append(("name", name, type(name))) + if status not in _allowed_status: + invalid.append(("status", status, type(status))) + if not isinstance(message, str): + invalid.append(("message", message, type(message))) + if not isinstance(replace_graphs, list): + invalid.append(("replaceGraphs", replace_graphs, type(replace_graphs))) + if type(force_serial) is not bool: + invalid.append(("forceSerial", force_serial, type(force_serial))) + if not isinstance(type_, str): + invalid.append(("type", type_, type(type_))) + if not isinstance(parser_settings, ParserSettings): + invalid.append(("parserSettings", parser_settings, type(parser_settings))) + if not isinstance(size, str): + invalid.append(("size", size, type(size))) + if type(last_modified) is not int: + invalid.append(("lastModified", last_modified, type(last_modified))) + if type(imported) is not int: + invalid.append(("imported", imported, type(imported))) + if type(added_statements) is not int: + invalid.append( + ("addedStatements", added_statements, type(added_statements)) + ) + if type(removed_statements) is not int: + invalid.append( + ("removedStatements", removed_statements, type(removed_statements)) + ) + if type(num_replaced_graphs) is not int: + invalid.append( + ("numReplacedGraphs", num_replaced_graphs, type(num_replaced_graphs)) + ) + + # Note: don't check context, baseURI, format, or data here since they are of type t.Any. + + if invalid: + raise ValueError("Invalid ImportSettings values: ", invalid) + + def as_dict(self) -> dict[str, t.Any]: + return asdict(self) + + +@dataclass(frozen=True) +class ServerImportBody: + fileNames: list[str] # noqa: N815 + importSettings: ImportSettings | None = None # noqa: N815 + + def __post_init__(self) -> None: + invalid: list[tuple[str, t.Any, type]] = [] + import_settings = t.cast(t.Any, self.importSettings) + file_names = t.cast(t.Any, self.fileNames) + + if import_settings is not None and not isinstance( + import_settings, ImportSettings + ): + invalid.append(("importSettings", import_settings, type(import_settings))) + if not isinstance(file_names, list): + invalid.append(("fileNames", file_names, type(file_names))) + else: + for index, value in enumerate(file_names): + if not isinstance(value, str): + invalid.append((f"fileNames[{index}]", value, type(value))) + + if invalid: + raise ValueError("Invalid ServerImportBody values: ", invalid) + + def as_dict(self) -> dict[str, t.Any]: + result = asdict(self) + if self.importSettings is None: + result.pop("importSettings", None) + return result + + +@dataclass(frozen=True) +class UserUpdate: + password: str = field(default="") + appSettings: dict[str, t.Any] = field(default_factory=dict) # noqa: N815 + gptThreads: list[t.Any] = field(default_factory=list) # noqa: N815 + + def as_dict(self) -> dict[str, t.Any]: + return asdict(self) + + +@dataclass(frozen=True) +class UserCreate: + """Dataclass for creating a new user in GraphDB. + + Unlike `User`, this class does not include `dateCreated` since + GraphDB automatically assigns this value when the user is created. + """ + + username: str + password: str + grantedAuthorities: list[str] = field(default_factory=list) # noqa: N815 + appSettings: dict[str, t.Any] = field(default_factory=dict) # noqa: N815 + gptThreads: list[t.Any] = field(default_factory=list) # noqa: N815 + + def __post_init__(self) -> None: + invalid: list[tuple[str, t.Any, type]] = [] + username = t.cast(t.Any, self.username) + password = t.cast(t.Any, self.password) + granted_authorities = t.cast(t.Any, self.grantedAuthorities) + app_settings = t.cast(t.Any, self.appSettings) + gpt_threads = t.cast(t.Any, self.gptThreads) + + if not isinstance(username, str): + invalid.append(("username", username, type(username))) + if not isinstance(password, str): + invalid.append(("password", password, type(password))) + + if not isinstance(granted_authorities, list): + invalid.append( + ("grantedAuthorities", granted_authorities, type(granted_authorities)) + ) + else: + for index, value in enumerate(granted_authorities): + if not isinstance(value, str): + invalid.append((f"grantedAuthorities[{index}]", value, type(value))) + + if not isinstance(app_settings, dict): + invalid.append(("appSettings", app_settings, type(app_settings))) + else: + for key in app_settings.keys(): + if not isinstance(key, str): + invalid.append(("appSettings key", key, type(key))) + break + + if not isinstance(gpt_threads, list): + invalid.append(("gptThreads", gpt_threads, type(gpt_threads))) + + if invalid: + raise ValueError("Invalid UserCreate values: ", invalid) + + def as_dict(self) -> dict[str, t.Any]: + return asdict(self) + + +@dataclass(frozen=True) +class User: + username: str + password: str + dateCreated: int # noqa: N815 + grantedAuthorities: list[str] = field(default_factory=list) # noqa: N815 + appSettings: dict[str, t.Any] = field(default_factory=dict) # noqa: N815 + gptThreads: list[t.Any] = field(default_factory=list) # noqa: N815 + + def __post_init__(self) -> None: + # Normalize None values from API responses to empty collections + if self.grantedAuthorities is None: + object.__setattr__(self, "grantedAuthorities", []) # type: ignore[unreachable] + if self.appSettings is None: + object.__setattr__(self, "appSettings", {}) # type: ignore[unreachable] + if self.gptThreads is None: + object.__setattr__(self, "gptThreads", []) # type: ignore[unreachable] + + invalid: list[tuple[str, t.Any, type]] = [] + username = t.cast(t.Any, self.username) + password = t.cast(t.Any, self.password) + date_created = t.cast(t.Any, self.dateCreated) + granted_authorities = t.cast(t.Any, self.grantedAuthorities) + app_settings = t.cast(t.Any, self.appSettings) + gpt_threads = t.cast(t.Any, self.gptThreads) + + if not isinstance(username, str): + invalid.append(("username", username, type(username))) + if not isinstance(password, str): + invalid.append(("password", password, type(password))) + if not isinstance(date_created, int): + invalid.append(("dateCreated", date_created, type(date_created))) + + if not isinstance(granted_authorities, list): + invalid.append( + ("grantedAuthorities", granted_authorities, type(granted_authorities)) + ) + else: + for index, value in enumerate(granted_authorities): + if not isinstance(value, str): + invalid.append((f"grantedAuthorities[{index}]", value, type(value))) + + if not isinstance(app_settings, dict): + invalid.append(("appSettings", app_settings, type(app_settings))) + else: + for key in app_settings.keys(): + if not isinstance(key, str): + invalid.append(("appSettings key", key, type(key))) + break + + if not isinstance(gpt_threads, list): + invalid.append(("gptThreads", gpt_threads, type(gpt_threads))) + + if invalid: + raise ValueError("Invalid User values: ", invalid) + + def as_dict(self): + return asdict(self) + + +@dataclass(frozen=True) +class AuthenticatedUser: + """Represents an authenticated user returned from POST /rest/login. + + Attributes: + username: The username of the authenticated user. + authorities: List of granted authorities/roles (e.g., ["ROLE_USER", "ROLE_ADMIN"]). + appSettings: Application settings for the user. + external: Whether the user is external (e.g., from LDAP/OAuth). + token: The full Authorization header value (e.g., "GDB "). + Can be passed directly to GraphDBClient's auth parameter. + """ + + username: str + authorities: list[str] = field(default_factory=list) + appSettings: dict[str, t.Any] = field(default_factory=dict) # noqa: N815 + external: bool = False + token: str = "" + + def __post_init__(self) -> None: + # Normalize None values from API responses to empty collections + if self.authorities is None: + object.__setattr__(self, "authorities", []) # type: ignore[unreachable] + if self.appSettings is None: + object.__setattr__(self, "appSettings", {}) # type: ignore[unreachable] + + invalid: list[tuple[str, t.Any, type]] = [] + username = t.cast(t.Any, self.username) + authorities = t.cast(t.Any, self.authorities) + app_settings = t.cast(t.Any, self.appSettings) + external = t.cast(t.Any, self.external) + token = t.cast(t.Any, self.token) + + if not isinstance(username, str): + invalid.append(("username", username, type(username))) + if not isinstance(authorities, list): + invalid.append(("authorities", authorities, type(authorities))) + else: + for index, value in enumerate(authorities): + if not isinstance(value, str): + invalid.append((f"authorities[{index}]", value, type(value))) + if not isinstance(app_settings, dict): + invalid.append(("appSettings", app_settings, type(app_settings))) + else: + for key in app_settings.keys(): + if not isinstance(key, str): + invalid.append(("appSettings key", key, type(key))) + break + if type(external) is not bool: + invalid.append(("external", external, type(external))) + if not isinstance(token, str): + invalid.append(("token", token, type(token))) + + if invalid: + raise ValueError("Invalid AuthenticatedUser values: ", invalid) + + @classmethod + def from_response(cls, data: dict[str, t.Any], token: str) -> AuthenticatedUser: + """Create an AuthenticatedUser from API response data and token. + + Parameters: + data: The JSON response body from POST /rest/login. + token: The GDB token extracted from the Authorization header. + + Returns: + An AuthenticatedUser instance. + + Raises: + ValueError: If required fields are missing or invalid. + TypeError: If data is not a dict. + """ + if not isinstance(data, dict): + raise TypeError("Response data must be a dict") + if "username" not in data: + raise ValueError("Response data must contain 'username'") + + return cls( + username=data["username"], + authorities=data.get("authorities", []), + appSettings=data.get("appSettings", {}), + external=data.get("external", False), + token=token, + ) + + +@dataclass(frozen=True) +class FreeAccessSettings: + enabled: bool + authorities: list[str] = field(default_factory=list) + appSettings: dict[str, t.Any] = field(default_factory=dict) # noqa: N815 + + def __post_init__(self) -> None: + invalid: list[tuple[str, t.Any, type]] = [] + enabled = t.cast(t.Any, self.enabled) + authorities = t.cast(t.Any, self.authorities) + app_settings = t.cast(t.Any, self.appSettings) + if type(enabled) is not bool: + invalid.append(("enabled", enabled, type(enabled))) + if not isinstance(authorities, list): + invalid.append(("authorities", authorities, type(authorities))) + else: + for index, value in enumerate(authorities): + if not isinstance(value, str): + invalid.append((f"authorities[{index}]", value, type(value))) + if not isinstance(app_settings, dict): + invalid.append(("appSettings", app_settings, type(app_settings))) + else: + for key in app_settings.keys(): + if not isinstance(key, str): + invalid.append(("appSettings key", key, type(key))) + break + + if invalid: + raise ValueError("Invalid FreeAccessSettings values: ", invalid) + + def as_dict(self): + return asdict(self) + + +@dataclass(frozen=True) +class RepositorySizeInfo: + inferred: int + total: int + explicit: int + + def __post_init__(self): + invalid = [] + if type(self.inferred) is not int: + invalid.append("inferred") + if type(self.total) is not int: + invalid.append("total") + if type(self.explicit) is not int: + invalid.append("explicit") + + if invalid: + raise ValueError( + "Invalid RepositorySizeInfo values: ", + [(x, self.__dict__[x], type(self.__dict__[x])) for x in invalid], + ) + + +@dataclass(frozen=True) +class OWLimParameter: + name: str + label: str + value: str + + +@dataclass(frozen=True) +class RepositoryConfigBean: + id: str + title: str + type: str + sesameType: str # noqa: N815 + location: str + params: dict[str, OWLimParameter] = field(default_factory=dict) + + +@dataclass(frozen=True) +class RepositoryConfigBeanCreate: + id: str + title: str + type: str + sesameType: str # noqa: N815 + location: str + params: dict[str, OWLimParameter] = field(default_factory=dict) + missingDefaults: dict[str, OWLimParameter] = field( # noqa: N815 + default_factory=dict + ) + + def as_dict(self) -> dict: + """Serialize the dataclass to a Python dict. + + Returns: + dict: A dictionary representation of the dataclass suitable for use + with httpx POST requests (e.g., via the `json` parameter). + + Examples: + >>> config = RepositoryConfigBeanCreate( + ... id="test-repo", + ... title="Test Repository", + ... type="graphdb:FreeSailRepository", + ... sesameType="graphdb:FreeSailRepository", + ... location="", + ... ) + >>> config_dict = config.as_dict() + >>> isinstance(config_dict, dict) + True + """ + return asdict(self) + + +class RepositoryState(str, Enum): + """Enumeration for repository state values.""" + + INACTIVE = "INACTIVE" + STARTING = "STARTING" + RUNNING = "RUNNING" + RESTARTING = "RESTARTING" + STOPPING = "STOPPING" + + +@dataclass +class GraphDBRepository: + id: t.Optional[str] = None + title: t.Optional[str] = None + uri: t.Optional[str] = None + externalUrl: t.Optional[str] = None # noqa: N815 + local: t.Optional[bool] = None + type: t.Optional[str] = None + sesameType: t.Optional[str] = None # noqa: N815 + location: t.Optional[str] = None + readable: t.Optional[bool] = None + writable: t.Optional[bool] = None + unsupported: t.Optional[bool] = None + state: t.Optional[RepositoryState] = None + + @classmethod + def from_dict(cls, data: dict) -> GraphDBRepository: + """Create a GraphDBRepository instance from a dict. + + Parameters: + data: A dict containing the repository data, typically + parsed from a JSON response. + + Returns: + A GraphDBRepository instance. + + Raises: + TypeError: If the dict contains keys that do not match + GraphDBRepository fields. + ValueError: If the 'state' value is not a valid RepositoryState. + """ + data_copy = dict(data) + if "state" in data_copy and data_copy["state"] is not None: + data_copy["state"] = RepositoryState(data_copy["state"]) + return cls(**data_copy) + + +@dataclass +class AccessControlEntry: + scope: t.Literal["statement", "clear_graph", "plugin", "system"] + policy: t.Literal["allow", "deny", "abstain"] + role: str + + def as_dict(self) -> dict[str, t.Any]: + raise NotImplementedError("Use a concrete AccessControlEntry subclass.") + + @classmethod + def from_dict( + cls, data: dict + ) -> ( + SystemAccessControlEntry + | StatementAccessControlEntry + | PluginAccessControlEntry + | ClearGraphAccessControlEntry + ): + """Create an AccessControlEntry subclass instance from raw GraphDB data. + + Note: we perform parse validation essentially twice (here and in the + subclass's __post_init__) to ensure mypy is satisfied with the value's type. + + Parameters: + data: A dict containing the access control entry data, typically + parsed from a JSON response. + + Returns: + An AccessControlEntry subclass instance (SystemAccessControlEntry, + StatementAccessControlEntry, PluginAccessControlEntry, or + ClearGraphAccessControlEntry) depending on the 'scope' field. + + Raises: + TypeError: If data is not a dict. + ValueError: If 'scope' is not a supported value ('system', 'statement', + 'plugin', 'clear_graph'), or if any field fails validation + (e.g., invalid policy, operation, role, plugin, subject, + predicate, object, or graph values). + """ + if not isinstance(data, dict): + raise TypeError("ACL entry must be a mapping.") + + scope = data.get("scope") + if scope == "system": + policy = _parse_policy(data.get("policy")) + role = _parse_role(data.get("role")) + operation = _parse_operation(data.get("operation")) + return SystemAccessControlEntry( + scope="system", + policy=policy, + role=role, + operation=operation, + ) + if scope == "statement": + policy = _parse_policy(data.get("policy")) + role = _parse_role(data.get("role")) + operation = _parse_operation(data.get("operation")) + subject = _parse_subject(data.get("subject")) + predicate = _parse_predicate(data.get("predicate")) + obj = _parse_object(data.get("object")) + graph = _parse_graph(data.get("context")) + return StatementAccessControlEntry( + scope="statement", + policy=policy, + role=role, + operation=operation, + subject=subject, + predicate=predicate, + object=obj, + graph=graph, + ) + if scope == "plugin": + policy = _parse_policy(data.get("policy")) + role = _parse_role(data.get("role")) + operation = _parse_operation(data.get("operation")) + plugin = _parse_plugin(data.get("plugin")) + return PluginAccessControlEntry( + scope="plugin", + policy=policy, + role=role, + operation=operation, + plugin=plugin, + ) + if scope == "clear_graph": + policy = _parse_policy(data.get("policy")) + role = _parse_role(data.get("role")) + graph = _parse_graph(data.get("context")) + return ClearGraphAccessControlEntry( + scope="clear_graph", + policy=policy, + role=role, + graph=graph, + ) + + raise ValueError(f"Unsupported FGAC scope: {scope!r}") + + +@dataclass +class SystemAccessControlEntry(AccessControlEntry): + scope: t.Literal["system"] + policy: t.Literal["allow", "deny", "abstain"] + role: str + operation: t.Literal["read", "write", "*"] + + def __post_init__(self) -> None: + self.policy = _parse_policy(self.policy) + self.role = _parse_role(self.role) + self.operation = _parse_operation(self.operation) + + def as_dict(self) -> dict[str, t.Any]: + return { + "scope": self.scope, + "policy": self.policy, + "role": self.role, + "operation": self.operation, + } + + +@dataclass +class StatementAccessControlEntry(AccessControlEntry): + scope: t.Literal["statement"] + policy: t.Literal["allow", "deny", "abstain"] + role: str + operation: t.Literal["read", "write", "*"] + subject: t.Literal["*"] | URIRef + predicate: t.Literal["*"] | URIRef + object: t.Literal["*"] | URIRef | Literal + graph: t.Literal["*", "named", "default"] | URIRef + + def __post_init__(self) -> None: + self.policy = _parse_policy(self.policy) + self.role = _parse_role(self.role) + self.operation = _parse_operation(self.operation) + self.subject = _parse_subject(self.subject) + self.predicate = _parse_predicate(self.predicate) + self.object = _parse_object(self.object) + self.graph = _parse_graph(self.graph) + + def as_dict(self) -> dict[str, t.Any]: + return { + "scope": self.scope, + "policy": self.policy, + "role": self.role, + "operation": self.operation, + "subject": _format_term(self.subject), + "predicate": _format_term(self.predicate), + "object": _format_term(self.object), + "context": _format_term(self.graph), + } + + +@dataclass +class PluginAccessControlEntry(AccessControlEntry): + scope: t.Literal["plugin"] + policy: t.Literal["allow", "deny", "abstain"] + role: str + operation: t.Literal["read", "write", "*"] + plugin: str + + def __post_init__(self) -> None: + self.policy = _parse_policy(self.policy) + self.role = _parse_role(self.role) + self.operation = _parse_operation(self.operation) + self.plugin = _parse_plugin(self.plugin) + + def as_dict(self) -> dict[str, t.Any]: + return { + "scope": self.scope, + "policy": self.policy, + "role": self.role, + "operation": self.operation, + "plugin": self.plugin, + } + + +@dataclass +class ClearGraphAccessControlEntry(AccessControlEntry): + scope: t.Literal["clear_graph"] + policy: t.Literal["allow", "deny", "abstain"] + role: str + graph: t.Literal["*", "named", "default"] | URIRef + + def __post_init__(self) -> None: + self.policy = _parse_policy(self.policy) + self.role = _parse_role(self.role) + self.graph = _parse_graph(self.graph) + + def as_dict(self) -> dict[str, t.Any]: + return { + "scope": self.scope, + "policy": self.policy, + "role": self.role, + "context": _format_term(self.graph), + } + + +_ALLOWED_POLICIES = {"allow", "deny", "abstain"} +_ALLOWED_OPERATIONS = {"read", "write", "*"} +_ALLOWED_GRAPHS = {"*", "named", "default"} + + +def _parse_policy(policy: t.Any) -> t.Literal["allow", "deny", "abstain"]: + if policy not in _ALLOWED_POLICIES: + raise ValueError(f"Invalid FGAC policy: {policy!r}") + return t.cast(t.Literal["allow", "deny", "abstain"], policy) + + +def _parse_operation(operation: t.Any) -> t.Literal["read", "write", "*"]: + if operation not in _ALLOWED_OPERATIONS: + raise ValueError(f"Invalid FGAC operation: {operation!r}") + return t.cast(t.Literal["read", "write", "*"], operation) + + +def _parse_role(role: t.Any) -> str: + if not isinstance(role, str): + raise ValueError(f"Invalid FGAC role: {role!r}") + return role + + +def _parse_plugin(plugin: t.Any) -> str: + if not isinstance(plugin, str): + raise ValueError(f"Invalid FGAC plugin: {plugin!r}") + return plugin + + +def _parse_subject(subject: t.Any) -> t.Literal["*"] | URIRef: + if subject == "*": + return "*" + if isinstance(subject, URIRef): + return subject + if isinstance(subject, str): + parsed = _parse_with_n3(subject) + if isinstance(parsed, URIRef): + return parsed + raise ValueError(f"Invalid FGAC subject: {subject!r}") + + +def _parse_predicate(predicate: t.Any) -> t.Literal["*"] | URIRef: + if predicate == "*": + return "*" + if isinstance(predicate, URIRef): + return predicate + if isinstance(predicate, str): + parsed = _parse_with_n3(predicate) + if isinstance(parsed, URIRef): + return parsed + raise ValueError(f"Invalid FGAC predicate: {predicate!r}") + + +def _parse_object(obj: t.Any) -> t.Literal["*"] | URIRef | Literal: + if obj == "*": + return "*" + if isinstance(obj, (URIRef, Literal)): + return obj + if isinstance(obj, str): + parsed = _parse_with_n3(obj) + if isinstance(parsed, (URIRef, Literal)): + return parsed + raise ValueError(f"Invalid FGAC object: {obj!r}") + + +def _parse_graph(graph: t.Any) -> t.Literal["*", "named", "default"] | URIRef: + if graph in _ALLOWED_GRAPHS: + return t.cast(t.Literal["*", "named", "default"], graph) + if isinstance(graph, URIRef): + return graph + if isinstance(graph, str): + parsed = _parse_with_n3(graph) + if isinstance(parsed, URIRef): + return parsed + raise ValueError(f"Invalid FGAC graph: {graph!r}") + + +def _parse_with_n3(value: str) -> URIRef | Literal: + try: + parsed = from_n3(value) + except Exception: + parsed = None + if isinstance(parsed, (URIRef, Literal)): + return parsed + try: + return URIRef(value) + except Exception as err: # pragma: no cover - defensive + raise ValueError(f"Unable to parse value {value!r} into an RDF term.") from err + + +def _format_term(value: t.Any) -> str: + if isinstance(value, (URIRef, Literal)): + return value.n3() + return t.cast(str, value) diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/graphdb/util.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/graphdb/util.py new file mode 100644 index 0000000000000000000000000000000000000000..d072a88b08f58ea6192684ba56b0622da1d1f541 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/graphdb/util.py @@ -0,0 +1,62 @@ +from __future__ import annotations + +import typing as t +import urllib.parse + + +def sanitize_filename(filename: str) -> str | None: + filename = filename.strip().strip("\"'") + if not filename: + return None + filename = filename.replace("\\", "/").split("/")[-1] + if not filename or filename in {".", ".."}: + return None + return filename + + +def extract_filename_from_content_disposition(header: str) -> str | None: + """Extract filename from Content-Disposition header. + + Supports both ``filename=`` and RFC 5987 ``filename*=``; prefers ``filename*=`` + when present. Returned filenames are sanitized to prevent path traversal. + """ + if not header: + return None + + filename_star: str | None = None + filename_plain: str | None = None + + for part in header.split(";"): + part = part.strip() + lower = part.lower() + if lower.startswith("filename*="): + value = part[len("filename*=") :].strip() + value = value.strip().strip("\"'") + try: + charset, rest = value.split("'", 1) + _language, encoded = rest.split("'", 1) + except ValueError: + charset = "utf-8" + encoded = value + try: + raw = urllib.parse.unquote_to_bytes(encoded) + decoded = raw.decode(charset, errors="replace") + except LookupError: + raw = urllib.parse.unquote_to_bytes(encoded) + decoded = raw.decode("utf-8", errors="replace") + filename_star = sanitize_filename(decoded) + elif lower.startswith("filename="): + value = part[len("filename=") :].strip() + filename_plain = sanitize_filename(value) + + return filename_star or filename_plain + + +def infer_filename_from_fileobj(file_obj: t.Any, fallback: str) -> str: + """Infer a safe filename from a file-like object's ``.name`` attribute.""" + name = getattr(file_obj, "name", None) + if isinstance(name, str) and name: + inferred = sanitize_filename(name) + if inferred: + return inferred + return fallback diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/rdf4j/__init__.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/rdf4j/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f0a2e8cf91b0a4c8d01e5cdb27098a203f4db259 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/rdf4j/__init__.py @@ -0,0 +1,10 @@ +from importlib.util import find_spec + +has_httpx = find_spec("httpx") is not None + +if has_httpx: + from .client import RDF4JClient + + __all__ = ["RDF4JClient", "has_httpx"] +else: + __all__ = ["has_httpx"] diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/rdf4j/__pycache__/__init__.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/rdf4j/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c3bc8b311e38f4430a1673d8a9be09be61f42f3b Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/rdf4j/__pycache__/__init__.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/rdf4j/__pycache__/client.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/rdf4j/__pycache__/client.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ca81bcb9668b274f68ba98a0c16c548d8c06f294 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/rdf4j/__pycache__/client.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/rdf4j/__pycache__/exceptions.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/rdf4j/__pycache__/exceptions.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..615bcd8a17eafd9729bfaba1cc1cb9777657179a Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/rdf4j/__pycache__/exceptions.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/rdf4j/__pycache__/util.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/rdf4j/__pycache__/util.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ae2349e22b854be26685a42bb2d6f271d6e8c77a Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/rdf4j/__pycache__/util.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/rdf4j/client.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/rdf4j/client.py new file mode 100644 index 0000000000000000000000000000000000000000..6c4b3361be0fc18c9f92e31cb615ded0e645bab1 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/rdf4j/client.py @@ -0,0 +1,1265 @@ +"""RDF4J client module.""" + +from __future__ import annotations + +import contextlib +import io +import typing as t +from dataclasses import dataclass +from typing import Any, BinaryIO, Iterable + +import httpx + +from rdflib import BNode +from rdflib.contrib.rdf4j.exceptions import ( + RDF4JUnsupportedProtocolError, + RDFLibParserError, + RepositoryAlreadyExistsError, + RepositoryError, + RepositoryNotFoundError, + RepositoryNotHealthyError, + RepositoryResponseFormatError, + TransactionClosedError, + TransactionCommitError, + TransactionPingError, + TransactionRollbackError, +) +from rdflib.contrib.rdf4j.util import ( + build_context_param, + build_infer_param, + build_sparql_query_accept_header, + build_spo_param, + rdf_payload_to_stream, + validate_graph_name, + validate_no_bnodes, +) +from rdflib.graph import DATASET_DEFAULT_GRAPH_ID, Dataset, Graph +from rdflib.query import Result +from rdflib.term import IdentifiedNode, Literal, URIRef + +SubjectType = t.Union[URIRef, None] +PredicateType = t.Union[URIRef, None] +ObjectType = t.Union[URIRef, Literal, None] + + +@dataclass(frozen=True) +class NamespaceListingResult: + """RDF4J namespace and prefix name result.""" + + prefix: str + namespace: str + + +class RDF4JNamespaceManager: + """A namespace manager for RDF4J repositories. + + Parameters: + identifier: The identifier of the repository. + http_client: The httpx.Client instance. + """ + + def __init__(self, identifier: str, http_client: httpx.Client): + self._identifier = identifier + self._http_client = http_client + + @property + def http_client(self): + return self._http_client + + @property + def identifier(self): + """Repository identifier.""" + return self._identifier + + def list(self) -> list[NamespaceListingResult]: + """List all namespace declarations in the repository. + + Returns: + list[NamespaceListingResult]: List of namespace and prefix name results. + + Raises: + RepositoryResponseFormatError: If the response format is unrecognized. + """ + headers = { + "Accept": "application/sparql-results+json", + } + response = self.http_client.get( + f"/repositories/{self.identifier}/namespaces", headers=headers + ) + response.raise_for_status() + + try: + data = response.json() + results = data["results"]["bindings"] + return [ + NamespaceListingResult( + prefix=row["prefix"]["value"], + namespace=row["namespace"]["value"], + ) + for row in results + ] + except (KeyError, ValueError) as err: + raise RepositoryResponseFormatError(f"Unrecognised response format: {err}") + + def clear(self): + """Clear all namespace declarations in the repository.""" + headers = { + "Accept": "application/sparql-results+json", + } + response = self.http_client.delete( + f"/repositories/{self.identifier}/namespaces", headers=headers + ) + response.raise_for_status() + + def get(self, prefix: str) -> str | None: + """Get the namespace URI for a given prefix. + + Parameters: + prefix: The prefix to lookup. + + Returns: + The namespace URI or `None` if not found. + """ + if not prefix: + raise ValueError("Prefix cannot be empty.") + headers = { + "Accept": "text/plain", + } + try: + response = self.http_client.get( + f"/repositories/{self.identifier}/namespaces/{prefix}", headers=headers + ) + response.raise_for_status() + return response.text + except httpx.HTTPStatusError as err: + if err.response.status_code == 404: + return None + raise + + def set(self, prefix: str, namespace: str): + """Set the namespace URI for a given prefix. + + !!! note + If the prefix was previously mapped to a different namespace, this will be + overwritten. + + Parameters: + prefix: The prefix to set. + namespace: The namespace URI to set. + """ + if not prefix: + raise ValueError("Prefix cannot be empty.") + if not namespace: + raise ValueError("Namespace cannot be empty.") + headers = { + "Content-Type": "text/plain", + } + response = self.http_client.put( + f"/repositories/{self.identifier}/namespaces/{prefix}", + headers=headers, + content=namespace, + ) + response.raise_for_status() + + def remove(self, prefix: str): + """Remove the namespace declaration for a given prefix. + + Parameters: + prefix: The prefix to remove. + """ + if not prefix: + raise ValueError("Prefix cannot be empty.") + response = self.http_client.delete( + f"/repositories/{self.identifier}/namespaces/{prefix}" + ) + response.raise_for_status() + + +class GraphStoreManager: + """An RDF4J Graph Store Protocol Client. + + Parameters: + identifier: The identifier of the repository. + http_client: The httpx.Client instance. + """ + + def __init__(self, identifier: str, http_client: httpx.Client): + self._identifier = identifier + self._http_client = http_client + self._content_type = "application/n-triples" + + @property + def http_client(self): + return self._http_client + + @property + def identifier(self): + """Repository identifier.""" + return self._identifier + + @staticmethod + def _build_graph_name_params(graph_name: URIRef | str): + params = {} + if ( + isinstance(graph_name, URIRef) + and graph_name == DATASET_DEFAULT_GRAPH_ID + or isinstance(graph_name, str) + and graph_name == str(DATASET_DEFAULT_GRAPH_ID) + ): + # Do nothing; GraphDB does not work with `?default=` + # (note the trailing equal character), which is the default + # behavior of httpx when setting the param value to an empty string. + # httpx completely omits query parameters whose values are `None`, so that's + # not an option either. + # The workaround is to construct our own query parameter URL when we target + # the default graph. + pass + else: + params["graph"] = str(graph_name) + return params + + def _build_url(self, graph_name: URIRef | str): + url = f"/repositories/{self.identifier}/rdf-graphs/service" + if isinstance(graph_name, URIRef) and graph_name == DATASET_DEFAULT_GRAPH_ID: + url += "?default" + return url + + def get(self, graph_name: URIRef | str) -> Graph: + """Fetch all statements in the specified graph. + + Parameters: + graph_name: The graph name of the graph. + + For the default graph, use + [`DATASET_DEFAULT_GRAPH_ID`][rdflib.graph.DATASET_DEFAULT_GRAPH_ID]. + + Returns: + A [`Graph`][rdflib.graph.Graph] object containing all statements in the + graph. + """ + if not graph_name: + raise ValueError("Graph name must be provided.") + validate_graph_name(graph_name) + headers = { + "Accept": self._content_type, + } + params = self._build_graph_name_params(graph_name) or None + + response = self.http_client.get( + self._build_url(graph_name), + headers=headers, + params=params, + ) + response.raise_for_status() + + return Graph(identifier=graph_name).parse( + data=response.text, format=self._content_type + ) + + def add(self, graph_name: URIRef | str, data: str | bytes | BinaryIO | Graph): + """Add statements to the specified graph. + + Parameters: + graph_name: The graph name of the graph. + + For the default graph, use + [`DATASET_DEFAULT_GRAPH_ID`][rdflib.graph.DATASET_DEFAULT_GRAPH_ID]. + + data: The RDF data to add. + """ + if not graph_name: + raise ValueError("Graph name must be provided.") + validate_graph_name(graph_name) + stream, should_close = rdf_payload_to_stream(data) + headers = { + "Content-Type": self._content_type, + } + params = self._build_graph_name_params(graph_name) or None + try: + response = self.http_client.post( + self._build_url(graph_name), + headers=headers, + params=params, + content=stream, + ) + response.raise_for_status() + finally: + if should_close: + stream.close() + + def overwrite(self, graph_name: URIRef | str, data: str | bytes | BinaryIO | Graph): + """Overwrite statements in the specified graph. + + Parameters: + graph_name: The graph name of the graph. + + For the default graph, use + [`DATASET_DEFAULT_GRAPH_ID`][rdflib.graph.DATASET_DEFAULT_GRAPH_ID]. + + data: The RDF data to overwrite with. + """ + if not graph_name: + raise ValueError("Graph name must be provided.") + validate_graph_name(graph_name) + stream, should_close = rdf_payload_to_stream(data) + headers = { + "Content-Type": self._content_type, + } + params = self._build_graph_name_params(graph_name) or None + try: + response = self.http_client.put( + self._build_url(graph_name), + headers=headers, + params=params, + content=stream, + ) + response.raise_for_status() + finally: + if should_close: + stream.close() + + def clear(self, graph_name: URIRef | str): + """Clear all statements in the specified graph. + + Parameters: + graph_name: The graph name of the graph. + + For the default graph, use + [`DATASET_DEFAULT_GRAPH_ID`][rdflib.graph.DATASET_DEFAULT_GRAPH_ID]. + """ + if not graph_name: + raise ValueError("Graph name must be provided.") + validate_graph_name(graph_name) + params = self._build_graph_name_params(graph_name) or None + response = self.http_client.delete(self._build_url(graph_name), params=params) + response.raise_for_status() + + +@dataclass(frozen=True) +class RepositoryListingResult: + """RDF4J repository listing result. + + Parameters: + identifier: Repository identifier. + uri: Repository URI. + readable: Whether the repository is readable by the client. + writable: Whether the repository is writable by the client. + title: Repository title. + """ + + identifier: str + uri: str + readable: bool + writable: bool + title: str | None = None + + +class Repository: + """RDF4J repository client. + + Parameters: + identifier: The identifier of the repository. + http_client: The httpx.Client instance. + """ + + def __init__(self, identifier: str, http_client: httpx.Client): + self._identifier = identifier + self._http_client = http_client + self._namespace_manager: RDF4JNamespaceManager | None = None + self._graph_store_manager: GraphStoreManager | None = None + + @property + def http_client(self): + return self._http_client + + @property + def identifier(self): + """Repository identifier.""" + return self._identifier + + @property + def namespaces(self) -> RDF4JNamespaceManager: + """Namespace manager for the repository.""" + if self._namespace_manager is None: + self._namespace_manager = RDF4JNamespaceManager( + self.identifier, self.http_client + ) + return self._namespace_manager + + @property + def graphs(self) -> GraphStoreManager: + """Graph store manager for the repository.""" + if self._graph_store_manager is None: + self._graph_store_manager = GraphStoreManager( + self.identifier, self.http_client + ) + return self._graph_store_manager + + def health(self) -> bool: + """Repository health check. + + Returns: + bool: True if the repository is healthy, otherwise an error is raised. + + Raises: + RepositoryNotFoundError: If the repository is not found. + RepositoryNotHealthyError: If the repository is not healthy. + """ + headers = { + "Content-Type": "application/sparql-query", + "Accept": "application/sparql-results+json", + } + try: + response = self.http_client.post( + f"/repositories/{self._identifier}", headers=headers, content="ASK {}" + ) + response.raise_for_status() + return True + except httpx.HTTPStatusError as err: + if err.response.status_code == 404: + raise RepositoryNotFoundError( + f"Repository {self._identifier} not found." + ) + raise RepositoryNotHealthyError( + f"Repository {self._identifier} is not healthy. {err.response.status_code} - {err.response.text}" + ) + + def size(self, graph_name: URIRef | Iterable[URIRef] | str | None = None) -> int: + """The number of statements in the repository or in the specified graph name. + + Parameters: + graph_name: Graph name(s) to restrict to. + + The default value `None` queries all graphs. + + To query just the default graph, use + [`DATASET_DEFAULT_GRAPH_ID`][rdflib.graph.DATASET_DEFAULT_GRAPH_ID]. + + Returns: + The number of statements. + + Raises: + RepositoryResponseFormatError: Fails to parse the repository size. + """ + validate_graph_name(graph_name) + params: dict[str, str] = {} + build_context_param(params, graph_name) + response = self.http_client.get( + f"/repositories/{self.identifier}/size", params=params + ) + response.raise_for_status() + return self._to_size(response.text) + + @staticmethod + def _to_size(size: str): + try: + value = int(size) + if value >= 0: + return value + raise ValueError(f"Invalid repository size: {value}") + except ValueError as err: + raise RepositoryResponseFormatError( + f"Failed to parse repository size: {err}" + ) from err + + def query(self, query: str, **kwargs): + """Execute a SPARQL query against the repository. + + !!! note + A POST request is used by default. If any keyword arguments are provided, + a GET request is used instead, and the arguments are passed as query parameters. + + Parameters: + query: The SPARQL query to execute. + **kwargs: Additional keyword arguments to include as query parameters + in the request. See + [RDF4J REST API - Execute SPARQL query](https://rdf4j.org/documentation/reference/rest-api/#tag/SPARQL/paths/~1repositories~1%7BrepositoryID%7D/get) + for the list of supported query parameters. + """ + headers = {"Content-Type": "application/sparql-query"} + build_sparql_query_accept_header(query, headers) + + if not kwargs: + response = self.http_client.post( + f"/repositories/{self.identifier}", headers=headers, content=query + ) + else: + response = self.http_client.get( + f"/repositories/{self.identifier}", + headers=headers, + params={"query": query, **kwargs}, + ) + response.raise_for_status() + try: + return Result.parse( + io.BytesIO(response.content), + content_type=response.headers["Content-Type"].split(";")[0], + ) + except KeyError as err: + raise RDFLibParserError( + f"Failed to parse SPARQL query result {response.headers.get('Content-Type')}: {err}" + ) from err + + def update(self, query: str): + """Execute a SPARQL update operation on the repository. + + Parameters: + query: The SPARQL update query to execute. + """ + headers = {"Content-Type": "application/sparql-update"} + response = self.http_client.post( + f"/repositories/{self.identifier}/statements", + headers=headers, + content=query, + ) + response.raise_for_status() + + def graph_names(self) -> list[IdentifiedNode]: + """Get a list of all graph names in the repository. + + Returns: + A list of graph names. + + Raises: + RepositoryResponseFormatError: Fails to parse the repository graph names. + """ + headers = { + "Accept": "application/sparql-results+json", + } + response = self.http_client.get( + f"/repositories/{self.identifier}/contexts", headers=headers + ) + response.raise_for_status() + try: + values: list[IdentifiedNode] = [] + for row in response.json()["results"]["bindings"]: + value = row["contextID"]["value"] + value_type = row["contextID"]["type"] + if value_type == "uri": + values.append(URIRef(value)) + elif value_type == "bnode": + values.append(BNode(value)) + else: + raise ValueError(f"Invalid graph name type: {value_type}") + return values + except Exception as err: + raise RepositoryResponseFormatError( + f"Failed to parse repository graph names: {err}" + ) from err + + def get( + self, + subj: SubjectType = None, + pred: PredicateType = None, + obj: ObjectType = None, + graph_name: URIRef | Iterable[URIRef] | str | None = None, + infer: bool = True, + content_type: str | None = None, + ) -> Graph | Dataset: + """Get RDF statements from the repository matching the filtering parameters. + + !!! Note + The terms for `subj`, `pred`, `obj` or `graph_name` cannot be + [`BNodes`][rdflib.term.BNode]. + + Parameters: + subj: Subject of the statement to filter by, or `None` to match all. + pred: Predicate of the statement to filter by, or `None` to match all. + obj: Object of the statement to filter by, or `None` to match all. + graph_name: Graph name(s) to restrict to. + + The default value `None` queries all graphs. + + To query just the default graph, use + [`DATASET_DEFAULT_GRAPH_ID`][rdflib.graph.DATASET_DEFAULT_GRAPH_ID]. + + infer: Specifies whether inferred statements should be included in the + result. + content_type: The content type of the response. + A triple-based format returns a [Graph][rdflib.graph.Graph], while a + quad-based format returns a [`Dataset`][rdflib.graph.Dataset]. + + Returns: + A [`Graph`][rdflib.graph.Graph] or [`Dataset`][rdflib.graph.Dataset] object + with the repository namespace prefixes bound to it. + """ + validate_no_bnodes(subj, pred, obj, graph_name) + if content_type is None: + content_type = "application/n-quads" + headers = {"Accept": content_type} + params: dict[str, str] = {} + build_context_param(params, graph_name) + build_spo_param(params, subj, pred, obj) + build_infer_param(params, infer=infer) + + response = self.http_client.get( + f"/repositories/{self.identifier}/statements", + headers=headers, + params=params, + ) + response.raise_for_status() + triple_formats = [ + "application/n-triples", + "text/turtle", + "application/rdf+xml", + ] + try: + if content_type in triple_formats: + retval = Graph().parse(data=response.text, format=content_type) + else: + retval = Dataset().parse(data=response.text, format=content_type) + for result in self.namespaces.list(): + retval.bind(result.prefix, result.namespace, replace=True) + return retval + except Exception as err: + raise RDFLibParserError(f"Error parsing RDF: {err}") from err + + def upload( + self, + data: str | bytes | BinaryIO | Graph | Dataset, + base_uri: str | None = None, + content_type: str | None = None, + ): + """Upload and append statements to the repository. + + Parameters: + data: The RDF data to upload. + base_uri: The base URI to resolve against for any relative URIs in the data. + content_type: The content type of the data. Defaults to + `application/n-quads` when the value is `None`. + """ + stream, should_close = rdf_payload_to_stream(data) + try: + headers = {"Content-Type": content_type or "application/n-quads"} + params = {} + if base_uri is not None: + params["baseURI"] = base_uri + response = self.http_client.post( + f"/repositories/{self.identifier}/statements", + headers=headers, + params=params, + content=stream, + ) + response.raise_for_status() + finally: + if should_close: + stream.close() + + def overwrite( + self, + data: str | bytes | BinaryIO | Graph | Dataset, + graph_name: URIRef | Iterable[URIRef] | str | None = None, + base_uri: str | None = None, + content_type: str | None = None, + ): + """Upload and overwrite statements in the repository. + + Parameters: + data: The RDF data to upload. + graph_name: Graph name(s) to restrict to. + + The default value `None` applies to all graphs. + + To apply to just the default graph, use + [`DATASET_DEFAULT_GRAPH_ID`][rdflib.graph.DATASET_DEFAULT_GRAPH_ID]. + + base_uri: The base URI to resolve against for any relative URIs in the data. + content_type: The content type of the data. Defaults to + `application/n-quads` when the value is `None`. + """ + stream, should_close = rdf_payload_to_stream(data) + validate_graph_name(graph_name) + try: + headers = {"Content-Type": content_type or "application/n-quads"} + params: dict[str, str] = {} + build_context_param(params, graph_name) + if base_uri is not None: + params["baseURI"] = base_uri + response = self.http_client.put( + f"/repositories/{self.identifier}/statements", + headers=headers, + params=params, + content=stream, + ) + response.raise_for_status() + finally: + if should_close: + stream.close() + + def delete( + self, + subj: SubjectType = None, + pred: PredicateType = None, + obj: ObjectType = None, + graph_name: URIRef | Iterable[URIRef] | str | None = None, + ) -> None: + """Deletes statements from the repository matching the filtering parameters. + + !!! Note + The terms for `subj`, `pred`, `obj` or `graph_name` cannot be + [`BNodes`][rdflib.term.BNode]. + + Parameters: + subj: Subject of the statement to filter by, or `None` to match all. + pred: Predicate of the statement to filter by, or `None` to match all. + obj: Object of the statement to filter by, or `None` to match all. + graph_name: Graph name(s) to restrict to. + + The default value `None` queries all graphs. + + To query just the default graph, use + [`DATASET_DEFAULT_GRAPH_ID`][rdflib.graph.DATASET_DEFAULT_GRAPH_ID]. + """ + validate_no_bnodes(subj, pred, obj, graph_name) + params: dict[str, str] = {} + build_context_param(params, graph_name) + build_spo_param(params, subj, pred, obj) + + response = self.http_client.delete( + f"/repositories/{self.identifier}/statements", + params=params, + ) + response.raise_for_status() + + @contextlib.contextmanager + def transaction(self): + """Create a new transaction for the repository. + + !!! warning + + Transaction instances are not thread-safe. Do not share a single + Transaction instance across multiple threads. Each thread should create + its own transaction, or use appropriate synchronization if sharing is + required. + """ + with Transaction.create(self) as txn: + yield txn + + +class Transaction: + """An RDF4J transaction. + + !!! warning + + Transaction instances are not thread-safe. Do not share a single + Transaction instance across multiple threads. Each thread should create + its own transaction, or use appropriate synchronization if sharing is + required. + + Parameters: + repo: The repository instance. + """ + + def __init__(self, repo: Repository, url: str): + self._repo = repo + self._url: str = url + self._closed: bool = False + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + if not self.is_closed: + if exc_type is None: + self.commit() + else: + try: + self.rollback() + except Exception: + pass + + # Propagate errors. + return False + + @property + def repo(self): + """The repository instance.""" + return self._repo + + @property + def url(self): + """The transaction URL.""" + return self._url + + @property + def is_closed(self) -> bool: + """Whether the transaction is closed.""" + return self._closed + + def _raise_for_closed(self): + if self.is_closed: + raise TransactionClosedError("The transaction has been closed.") + + @classmethod + def create(cls, repo: Repository) -> Transaction: + """Create a new transaction for the repository. + + Parameters: + repo: The repository instance. + + Returns: + A new Transaction instance. + """ + response = repo.http_client.post( + f"/repositories/{repo.identifier}/transactions" + ) + response.raise_for_status() + url = response.headers["Location"] + return cls(repo, url) + + def commit(self): + """Commit the transaction. + + Raises: + TransactionCommitError: If the transaction commit fails. + TransactionClosedError: If the transaction is closed. + """ + self._raise_for_closed() + params = {"action": "COMMIT"} + response = self.repo.http_client.put(self.url, params=params) + if response.status_code != 200: + raise TransactionCommitError( + f"Transaction commit failed: {response.status_code} - {response.text}" + ) + self._closed = True + + def rollback(self): + """Roll back the transaction. + + Raises: + TransactionRollbackError: If the transaction rollback fails. + TransactionClosedError: If the transaction is closed. + """ + self._raise_for_closed() + response = self.repo.http_client.delete(self.url) + if response.status_code != 204: + raise TransactionRollbackError( + f"Transaction rollback failed: {response.status_code} - {response.text}" + ) + self._closed = True + + def ping(self): + """Ping the transaction. + + Raises: + RepositoryTransactionPingError: If the transaction ping fails. + TransactionClosedError: If the transaction is closed. + """ + self._raise_for_closed() + params = {"action": "PING"} + response = self.repo.http_client.put(self.url, params=params) + if response.status_code != 200: + raise TransactionPingError( + f"Transaction ping failed: {response.status_code} - {response.text}" + ) + + def size(self, graph_name: URIRef | Iterable[URIRef] | str | None = None): + """The number of statements in the repository or in the specified graph name. + + Parameters: + graph_name: Graph name(s) to restrict to. + + The default value `None` queries all graphs. + + To query just the default graph, use + [`DATASET_DEFAULT_GRAPH_ID`][rdflib.graph.DATASET_DEFAULT_GRAPH_ID]. + + Returns: + The number of statements. + + Raises: + RepositoryResponseFormatError: Fails to parse the repository size. + """ + self._raise_for_closed() + validate_graph_name(graph_name) + params = {"action": "SIZE"} + build_context_param(params, graph_name) + response = self.repo.http_client.put(self.url, params=params) + response.raise_for_status() + return self.repo._to_size(response.text) + + def query(self, query: str, **kwargs): + """Execute a SPARQL query against the repository. + + Parameters: + query: The SPARQL query to execute. + **kwargs: Additional keyword arguments to include as query parameters + in the request. See + [RDF4J REST API - Execute SPARQL query](https://rdf4j.org/documentation/reference/rest-api/#tag/SPARQL/paths/~1repositories~1%7BrepositoryID%7D/get) + for the list of supported query parameters. + """ + self._raise_for_closed() + headers: dict[str, str] = {} + build_sparql_query_accept_header(query, headers) + params = {"action": "QUERY", "query": query} + response = self.repo.http_client.put( + self.url, headers=headers, params={**params, **kwargs} + ) + response.raise_for_status() + try: + return Result.parse( + io.BytesIO(response.content), + content_type=response.headers["Content-Type"].split(";")[0], + ) + except KeyError as err: + raise RDFLibParserError( + f"Failed to parse SPARQL query result {response.headers.get('Content-Type')}: {err}" + ) from err + + def update(self, query: str, **kwargs): + """Execute a SPARQL update operation on the repository. + + Parameters: + query: The SPARQL update query to execute. + **kwargs: Additional keyword arguments to include as query parameters + See [RDF4J REST API - Execute a transaction action](https://rdf4j.org/documentation/reference/rest-api/#tag/Transactions/paths/~1repositories~1%7BrepositoryID%7D~1transactions~1%7BtransactionID%7D/put) + for the list of supported query parameters. + """ + self._raise_for_closed() + params = {"action": "UPDATE", "update": query} + response = self.repo.http_client.put( + self.url, + params={**params, **kwargs}, + ) + response.raise_for_status() + + def upload( + self, + data: str | bytes | BinaryIO | Graph | Dataset, + base_uri: str | None = None, + content_type: str | None = None, + ): + """Upload and append statements to the repository. + + Parameters: + data: The RDF data to upload. + base_uri: The base URI to resolve against for any relative URIs in the data. + content_type: The content type of the data. Defaults to + `application/n-quads` when the value is `None`. + """ + self._raise_for_closed() + stream, should_close = rdf_payload_to_stream(data) + headers = {"Content-Type": content_type or "application/n-quads"} + params = {"action": "ADD"} + if base_uri is not None: + params["baseURI"] = base_uri + try: + response = self.repo.http_client.put( + self.url, + headers=headers, + params=params, + content=stream, + ) + response.raise_for_status() + finally: + if should_close: + stream.close() + + def get( + self, + subj: SubjectType = None, + pred: PredicateType = None, + obj: ObjectType = None, + graph_name: URIRef | Iterable[URIRef] | str | None = None, + infer: bool = True, + content_type: str | None = None, + ) -> Graph | Dataset: + """Get RDF statements from the repository matching the filtering parameters. + + !!! Note + The terms for `subj`, `pred`, `obj` or `graph_name` cannot be + [`BNodes`][rdflib.term.BNode]. + + Parameters: + subj: Subject of the statement to filter by, or `None` to match all. + pred: Predicate of the statement to filter by, or `None` to match all. + obj: Object of the statement to filter by, or `None` to match all. + graph_name: Graph name(s) to restrict to. + + The default value `None` queries all graphs. + + To query just the default graph, use + [`DATASET_DEFAULT_GRAPH_ID`][rdflib.graph.DATASET_DEFAULT_GRAPH_ID]. + + infer: Specifies whether inferred statements should be included in the + result. + content_type: The content type of the response. + A triple-based format returns a [Graph][rdflib.graph.Graph], while a + quad-based format returns a [`Dataset`][rdflib.graph.Dataset]. + + Returns: + A [`Graph`][rdflib.graph.Graph] or [`Dataset`][rdflib.graph.Dataset] object + with the repository namespace prefixes bound to it. + """ + self._raise_for_closed() + validate_no_bnodes(subj, pred, obj, graph_name) + if content_type is None: + content_type = "application/n-quads" + headers = {"Accept": content_type} + params: dict[str, str] = {"action": "GET"} + build_context_param(params, graph_name) + build_spo_param(params, subj, pred, obj) + build_infer_param(params, infer=infer) + + response = self.repo.http_client.put( + self.url, + headers=headers, + params=params, + ) + response.raise_for_status() + triple_formats = [ + "application/n-triples", + "text/turtle", + "application/rdf+xml", + ] + try: + if content_type in triple_formats: + retval = Graph().parse(data=response.text, format=content_type) + else: + retval = Dataset().parse(data=response.text, format=content_type) + for result in self.repo.namespaces.list(): + retval.bind(result.prefix, result.namespace, replace=True) + return retval + except Exception as err: + raise RDFLibParserError(f"Error parsing RDF: {err}") from err + + def delete( + self, + data: str | bytes | BinaryIO | Graph | Dataset, + base_uri: str | None = None, + content_type: str | None = None, + ) -> None: + """Delete statements from the repository. + + !!! Note + This function operates differently to + [`Repository.delete`][rdflib.contrib.rdf4j.client.Repository.delete] + as it does not use filter parameters. Instead, it expects a data payload. + See the notes from + [graphdb.js#Deleting](https://github.com/Ontotext-AD/graphdb.js?tab=readme-ov-file#deleting-1) + for more information. + + Parameters: + data: The RDF data to upload. + base_uri: The base URI to resolve against for any relative URIs in the data. + content_type: The content type of the data. Defaults to + `application/n-quads` when the value is `None`. + """ + self._raise_for_closed() + params: dict[str, str] = {"action": "DELETE"} + stream, should_close = rdf_payload_to_stream(data) + headers = {"Content-Type": content_type or "application/n-quads"} + if base_uri is not None: + params["baseURI"] = base_uri + try: + response = self.repo.http_client.put( + self.url, + headers=headers, + params=params, + content=stream, + ) + response.raise_for_status() + finally: + if should_close: + stream.close() + + +class RepositoryManager: + """A client to manage server-level repository operations. + + Parameters: + http_client: The httpx.Client instance. + """ + + def __init__(self, http_client: httpx.Client): + self._http_client = http_client + + @property + def http_client(self): + return self._http_client + + def list(self) -> list[RepositoryListingResult]: + """List all available repositories. + + Returns: + list[RepositoryListingResult]: List of repository results. + + Raises: + RepositoryResponseFormatError: If the response format is unrecognized. + """ + headers = { + "Accept": "application/sparql-results+json", + } + response = self.http_client.get("/repositories", headers=headers) + response.raise_for_status() + + try: + data = response.json() + results = data["results"]["bindings"] + return [ + RepositoryListingResult( + identifier=repo["id"]["value"], + uri=repo["uri"]["value"], + readable=repo["readable"]["value"], + writable=repo["writable"]["value"], + title=repo.get("title", {}).get("value"), + ) + for repo in results + ] + except (KeyError, ValueError) as err: + raise RepositoryResponseFormatError(f"Unrecognised response format: {err}") + + def get(self, repository_id: str) -> Repository: + """Get a repository by ID. + + !!! Note + This performs a health check before returning the repository object. + + Parameters: + repository_id: The identifier of the repository. + + Returns: + Repository: The repository instance. + + Raises: + RepositoryNotFoundError: If the repository is not found. + RepositoryNotHealthyError: If the repository is not healthy. + """ + repo = Repository(repository_id, self.http_client) + repo.health() + return repo + + def create( + self, repository_id: str, data: str, content_type: str = "text/turtle" + ) -> Repository: + """Create a new repository. + + Parameters: + repository_id: The identifier of the repository. + data: The repository configuration in RDF. + content_type: The repository configuration content type. + + Raises: + RepositoryAlreadyExistsError: If the repository already exists. + RepositoryNotHealthyError: If the repository is not healthy. + """ + try: + headers = {"Content-Type": content_type} + response = self.http_client.put( + f"/repositories/{repository_id}", headers=headers, content=data + ) + response.raise_for_status() + return self.get(repository_id) + except httpx.HTTPStatusError as err: + if err.response.status_code == 409: + raise RepositoryAlreadyExistsError( + f"Repository {repository_id} already exists." + ) + raise + + def delete(self, repository_id: str) -> None: + """Delete a repository. + + Parameters: + repository_id: The identifier of the repository. + + Raises: + RepositoryNotFoundError: If the repository is not found. + RepositoryError: If the repository is not deleted successfully. + """ + try: + response = self.http_client.delete(f"/repositories/{repository_id}") + response.raise_for_status() + if response.status_code != 204: + raise RepositoryError( + f"Unexpected response status code when deleting repository {repository_id}: {response.status_code} - {response.text.strip()}" + ) + except httpx.HTTPStatusError as err: + if err.response.status_code == 404: + raise RepositoryNotFoundError(f"Repository {repository_id} not found.") + raise + + +class RDF4JClient: + """RDF4J client. + + This client and its inner management objects perform HTTP requests via + httpx and may raise httpx-specific exceptions. Errors documented by RDF4J + in its protocol specification are mapped to specific exceptions in this + library where applicable. Error mappings are documented on each management + method. The underlying httpx client is reused across requests, and + connection pooling is handled automatically by httpx. + + Parameters: + base_url: The base URL of the RDF4J server. + auth: Authentication credentials. Can be a tuple (username, password) for + basic auth, or a string for token-based auth (e.g., "GDB ") + which is added as the Authorization header. + timeout: Request timeout in seconds or an httpx.Timeout for fine-grained control (default: 30.0). + kwargs: Additional keyword arguments to pass to the httpx.Client. + """ + + def __init__( + self, + base_url: str, + auth: tuple[str, str] | str | None = None, + timeout: float | httpx.Timeout = 30.0, + **kwargs: Any, + ): + if not base_url.endswith("/"): + base_url += "/" + + httpx_auth: tuple[str, str] | None = None + if isinstance(auth, tuple): + httpx_auth = auth + elif isinstance(auth, str): + headers = kwargs.get("headers", {}) + headers["Authorization"] = auth + kwargs["headers"] = headers + + self._http_client = httpx.Client( + base_url=base_url, auth=httpx_auth, timeout=timeout, **kwargs + ) + self._repository_manager = RepositoryManager(self.http_client) + try: + protocol_version = self.protocol + except httpx.RequestError as err: + self.close() + raise RDF4JUnsupportedProtocolError( + f"Failed to check protocol version: {err}" + ) from err + if protocol_version < 12: + self.close() + raise RDF4JUnsupportedProtocolError( + f"RDF4J server protocol version {protocol_version} is not supported. Minimum required version is 12." + ) + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + self.close() + + @property + def http_client(self): + return self._http_client + + @property + def repositories(self) -> RepositoryManager: + """Server-level repository management operations.""" + return self._repository_manager + + @property + def protocol(self) -> float: + """The RDF4J REST API protocol version. + + Returns: + The protocol version number. + """ + response = self.http_client.get("/protocol", headers={"Accept": "text/plain"}) + response.raise_for_status() + return float(response.text.strip()) + + def close(self): + """Close the underlying httpx.Client.""" + self.http_client.close() diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/rdf4j/exceptions.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/rdf4j/exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..3592c46eb683b1d848018955ede920bc47d64edc --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/rdf4j/exceptions.py @@ -0,0 +1,53 @@ +"""RDF4J exceptions.""" + + +class RDF4JError(Exception): + """Base class for RDF4J exceptions.""" + + +class RepositoryError(RDF4JError): + """Raised when interactions on a repository result in an error.""" + + +class RepositoryResponseFormatError(RepositoryError): + """Raised when the repository response format is invalid.""" + + +class RepositoryNotFoundError(RepositoryError): + """Raised when the repository is not found.""" + + +class RepositoryNotHealthyError(RepositoryError): + """Raised when the repository is not healthy.""" + + +class RepositoryAlreadyExistsError(RepositoryError): + """Raised when the repository already exists.""" + + +class RDF4JUnsupportedProtocolError(RDF4JError): + """Raised when the server does not support the protocol version.""" + + +class RDFLibParserError(RDF4JError): + """Raised when there is an error parsing the RDF document.""" + + +class RepositoryTransactionError(RDF4JError): + """Raised when there is an error with the transaction.""" + + +class TransactionClosedError(RepositoryTransactionError): + """Raised when the transaction has been closed.""" + + +class TransactionPingError(RepositoryTransactionError): + """Raised when there is an error pinging the transaction.""" + + +class TransactionCommitError(RepositoryTransactionError): + """Raised when there is an error committing the transaction.""" + + +class TransactionRollbackError(RepositoryTransactionError): + """Raised when there is an error rolling back the transaction.""" diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/rdf4j/util.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/rdf4j/util.py new file mode 100644 index 0000000000000000000000000000000000000000..9d99a80074399daa8de6965c653d64a2ce95c9a5 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/contrib/rdf4j/util.py @@ -0,0 +1,182 @@ +"""RDF4J utility functions.""" + +from __future__ import annotations + +import io +import typing as t + +from rdflib.graph import DATASET_DEFAULT_GRAPH_ID, Dataset, Graph +from rdflib.plugins.sparql.processor import prepareQuery +from rdflib.term import BNode, IdentifiedNode, URIRef + +if t.TYPE_CHECKING: + from rdflib.contrib.rdf4j.client import ObjectType, PredicateType, SubjectType + + +def build_context_param( + params: dict[str, str], + graph_name: IdentifiedNode | t.Iterable[IdentifiedNode] | str | None = None, +) -> None: + """Build the RDF4J http context query parameters dictionary. + + !!! Note + This mutates the params dictionary key `context`. + + Parameters: + params: The `httpx.Request` parameter dictionary. + graph_name: The graph name or iterable of graph names. + + This is the `context` query parameter value. + """ + if graph_name is not None and isinstance(graph_name, IdentifiedNode): + if graph_name == DATASET_DEFAULT_GRAPH_ID: + # Special RDF4J null value for context-less statements. + params["context"] = "null" + else: + params["context"] = graph_name.n3() + elif graph_name is not None and isinstance(graph_name, str): + params["context"] = URIRef(graph_name).n3() + elif graph_name is not None and isinstance(graph_name, t.Iterable): + # type error: "str" has no attribute "n3" + graph_names = ",".join([x.n3() for x in graph_name]) # type: ignore[attr-defined] + params["context"] = graph_names + + +def build_spo_param( + params: dict[str, str], + subj: SubjectType = None, + pred: PredicateType = None, + obj: ObjectType = None, +) -> None: + """Build the RDF4J http subj, predicate, and object query parameters dictionary. + + !!! Note + This mutates the params dictionary key `subj`, `pred`, and `obj`. + + Parameters: + params: The `httpx.Request` parameter dictionary. + subj: The `subj` query parameter value. + pred: The `pred` query parameter value. + obj: The `obj` query parameter value. + """ + if subj is not None: + params["subj"] = subj.n3() + if pred is not None: + params["pred"] = pred.n3() + if obj is not None: + params["obj"] = obj.n3() + + +def build_infer_param( + params: dict[str, str], + infer: bool = True, +) -> None: + """Build the RDF4J http infer query parameters dictionary. + + !!! Note + This mutates the params dictionary key `infer`. + + Parameters: + params: The `httpx.Request` parameter dictionary. + infer: The `infer` query parameter value. + """ + if not infer: + params["infer"] = "false" + + +def rdf_payload_to_stream( + data: str | bytes | t.BinaryIO | Graph | Dataset, +) -> tuple[t.BinaryIO, bool]: + """Convert an RDF payload into a file-like object. + + Parameters: + data: The RDF payload. + + This can be a python `str`, `bytes`, `BinaryIO`, or a + [`Graph`][rdflib.graph.Graph] or [`Dataset`][rdflib.graph.Dataset]. + + Returns: + A tuple containing the file-like object and a boolean indicating whether the + immediate caller should close the stream. + """ + stream: t.BinaryIO + if isinstance(data, str): + # Check if it looks like a file path. Assumes file path length is less than 260. + if "\n" not in data and len(data) < 260: + try: + stream = open(data, "rb") + should_close = True + except (FileNotFoundError, OSError): + # Treat as raw string content + stream = io.BytesIO(data.encode("utf-8")) + should_close = False + else: + # Treat as raw string content + stream = io.BytesIO(data.encode("utf-8")) + should_close = False + elif isinstance(data, bytes): + stream = io.BytesIO(data) + should_close = False + elif isinstance(data, (Graph, Dataset)): + if data.context_aware: + stream = io.BytesIO( + data.serialize(format="application/n-quads", encoding="utf-8") + ) + else: + stream = io.BytesIO( + data.serialize(format="application/n-triples", encoding="utf-8") + ) + should_close = True + else: + # Assume it's already a file-like object + stream = data + should_close = False + + return stream, should_close + + +def build_sparql_query_accept_header(query: str, headers: dict[str, str]): + """Build the SPARQL query accept header. + + !!! Note + This mutates the headers dictionary key `Accept`. + + Parameters: + query: The SPARQL query. + """ + prepared_query = prepareQuery(query) + if prepared_query.algebra.name in ("SelectQuery", "AskQuery"): + headers["Accept"] = "application/sparql-results+json" + elif prepared_query.algebra.name in ("ConstructQuery", "DescribeQuery"): + headers["Accept"] = "application/n-triples" + else: + raise ValueError(f"Unsupported query type: {prepared_query.algebra.name}") + + +def validate_graph_name(graph_name: URIRef | t.Iterable[URIRef] | str | None): + if ( + isinstance(graph_name, BNode) + or isinstance(graph_name, t.Iterable) + and any(isinstance(x, BNode) for x in graph_name) + ): + raise ValueError("Graph name must not be a BNode.") + + +def validate_no_bnodes( + subj: SubjectType, + pred: PredicateType, + obj: ObjectType, + graph_name: URIRef | t.Iterable[URIRef] | str | None, +) -> None: + """Validate that the subject, predicate, and object are not BNodes.""" + if ( + isinstance(subj, BNode) + or isinstance(pred, BNode) + or isinstance(obj, BNode) + or isinstance(graph_name, BNode) + ): + raise ValueError( + "Subject, predicate, and object must not be a BNode: " + f"{subj}, {pred}, {obj}" + ) + validate_graph_name(graph_name) diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/extras/__init__.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/extras/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/extras/__pycache__/__init__.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/extras/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8dc3298fc61a2ba0a2a8def0e19f629b27f08205 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/extras/__pycache__/__init__.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/extras/__pycache__/cmdlineutils.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/extras/__pycache__/cmdlineutils.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1f9a5611b4239e24dedbc6029228f26f84d219ab Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/extras/__pycache__/cmdlineutils.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/extras/__pycache__/describer.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/extras/__pycache__/describer.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c2d4cfbe889fe0e10faceed0e6e34260520279f7 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/extras/__pycache__/describer.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/extras/__pycache__/external_graph_libs.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/extras/__pycache__/external_graph_libs.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..92f48668fd742fd582445234895ec418a7a390f6 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/extras/__pycache__/external_graph_libs.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/extras/__pycache__/shacl.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/extras/__pycache__/shacl.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..32f167df02b5587273a52db4f22c866263c1dc43 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/extras/__pycache__/shacl.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/extras/cmdlineutils.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/extras/cmdlineutils.py new file mode 100644 index 0000000000000000000000000000000000000000..85fd85fbc432b1dd694cc6820839789157de87c2 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/extras/cmdlineutils.py @@ -0,0 +1,77 @@ +from __future__ import annotations + +import codecs +import getopt +import sys +import time +from typing import TextIO, Union + +import rdflib +from rdflib.util import guess_format + + +def _help(): + sys.stderr.write( + """ +program.py [-f ] [-o ] [files...] +Read RDF files given on STDOUT - does something to the resulting graph +If no files are given, read from stdin +-o specifies file for output, if not given stdout is used +-f specifies parser to use, if not given it is guessed from extension + +""" + ) + + +def main(target, _help=_help, options="", stdin=True): + """ + A main function for tools that read RDF from files given on commandline + or from STDIN (if stdin parameter is true) + """ + + args, files = getopt.getopt(sys.argv[1:], "hf:o:" + options) + dargs = dict(args) + + if "-h" in dargs: + _help() + sys.exit(-1) + + g = rdflib.Graph() + + if "-f" in dargs: + f = dargs["-f"] + else: + f = None + + out: Union[TextIO, codecs.StreamReaderWriter] + if "-o" in dargs: + sys.stderr.write("Output to %s\n" % dargs["-o"]) + out = codecs.open(dargs["-o"], "w", "utf-8") + else: + out = sys.stdout + + start = time.time() + if len(files) == 0 and stdin: + sys.stderr.write("Reading from stdin as %s..." % f) + g.parse(sys.stdin, format=f) + sys.stderr.write("[done]\n") + else: + size = 0 + for x in files: + if f is None: + f = guess_format(x) + start1 = time.time() + sys.stderr.write("Loading %s as %s... " % (x, f)) + g.parse(x, format=f) + sys.stderr.write( + "done.\t(%d triples\t%.2f seconds)\n" + % (len(g) - size, time.time() - start1) + ) + size = len(g) + + sys.stderr.write( + "Loaded a total of %d triples in %.2f seconds.\n" + % (len(g), time.time() - start) + ) + + target(g, out, args) diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/extras/describer.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/extras/describer.py new file mode 100644 index 0000000000000000000000000000000000000000..27780baf901afd40db178fff341ab2d342f269a4 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/extras/describer.py @@ -0,0 +1,264 @@ +""" +A Describer is a stateful utility for creating RDF statements in a +semi-declarative manner. It has methods for creating literal values, rel and +rev resource relations (somewhat resembling RDFa). + +The `Describer.rel` and `Describer.rev` methods return a context manager which sets the current +about to the referenced resource for the context scope (for use with the +`with` statement). + +Full example in the `to_rdf` method below: + +```python +>>> import datetime +>>> from rdflib.graph import Graph +>>> from rdflib.namespace import Namespace, RDFS, FOAF + +>>> ORG_URI = "http://example.org/" + +>>> CV = Namespace("http://purl.org/captsolo/resume-rdf/0.2/cv#") + +>>> class Person: +... def __init__(self): +... self.first_name = "Some" +... self.last_name = "Body" +... self.username = "some1" +... self.presentation = "Just a Python & RDF hacker." +... self.image = "/images/persons/" + self.username + ".jpg" +... self.site = "http://example.net/" +... self.start_date = datetime.date(2009, 9, 4) +... def get_full_name(self): +... return " ".join([self.first_name, self.last_name]) +... def get_absolute_url(self): +... return "/persons/" + self.username +... def get_thumbnail_url(self): +... return self.image.replace('.jpg', '-thumb.jpg') +... +... def to_rdf(self): +... graph = Graph() +... graph.bind('foaf', FOAF) +... graph.bind('cv', CV) +... lang = 'en' +... d = Describer(graph, base=ORG_URI) +... d.about(self.get_absolute_url()+'#person') +... d.rdftype(FOAF.Person) +... d.value(FOAF.name, self.get_full_name()) +... d.value(FOAF.givenName, self.first_name) +... d.value(FOAF.familyName, self.last_name) +... d.rel(FOAF.homepage, self.site) +... d.value(RDFS.comment, self.presentation, lang=lang) +... with d.rel(FOAF.depiction, self.image): +... d.rdftype(FOAF.Image) +... d.rel(FOAF.thumbnail, self.get_thumbnail_url()) +... with d.rev(CV.aboutPerson): +... d.rdftype(CV.CV) +... with d.rel(CV.hasWorkHistory): +... d.value(CV.startDate, self.start_date) +... d.rel(CV.employedIn, ORG_URI+"#company") +... return graph +... +>>> person_graph = Person().to_rdf() +>>> expected = Graph().parse(data=''' +... +... +... Some Body +... Some +... Body +... +... +... +... +... +... +... Just a Python & RDF hacker. +... +... +... +... +... +... +... +... +... 2009-09-04 +... +... +... +... +... +... ''', format="xml") + +>>> from rdflib.compare import isomorphic +>>> isomorphic(person_graph, expected) #doctest: +SKIP +True + +``` +""" + +from contextlib import contextmanager + +from rdflib.graph import Graph +from rdflib.namespace import RDF +from rdflib.term import BNode, Identifier, Literal, URIRef + + +class Describer: + def __init__(self, graph=None, about=None, base=None): + if graph is None: + graph = Graph() + self.graph = graph + self.base = base + self._subjects = [] + self.about(about or None) + + def about(self, subject, **kws): + """ + Sets the current subject. Will convert the given object into an + `URIRef` if it's not an `Identifier`. + + Example: + ```python + >>> d = Describer() + >>> d._current() #doctest: +ELLIPSIS + rdflib.term.BNode(...) + >>> d.about("http://example.org/") + >>> d._current() + rdflib.term.URIRef('http://example.org/') + + ``` + """ + kws.setdefault("base", self.base) + subject = cast_identifier(subject, **kws) + if self._subjects: + self._subjects[-1] = subject + else: + self._subjects.append(subject) + + def value(self, p, v, **kws): + """ + Set a literal value for the given property. Will cast the value to an + `Literal` if a plain literal is given. + + Example: + ```python + >>> from rdflib import URIRef + >>> from rdflib.namespace import RDF, RDFS + >>> d = Describer(about="http://example.org/") + >>> d.value(RDFS.label, "Example") + >>> d.graph.value(URIRef('http://example.org/'), RDFS.label) + rdflib.term.Literal('Example') + + ``` + """ + v = cast_value(v, **kws) + self.graph.add((self._current(), p, v)) + + def rel(self, p, o=None, **kws): + """Set an object for the given property. Will convert the given object + into an `URIRef` if it's not an `Identifier`. If none is given, a + new `BNode` is used. + + Returns a context manager for use in a `with` block, within which the + given object is used as current subject. + + Example: + ```python + >>> from rdflib import URIRef + >>> from rdflib.namespace import RDF, RDFS + >>> d = Describer(about="/", base="http://example.org/") + >>> _ctxt = d.rel(RDFS.seeAlso, "/about") + >>> d.graph.value(URIRef('http://example.org/'), RDFS.seeAlso) + rdflib.term.URIRef('http://example.org/about') + + >>> with d.rel(RDFS.seeAlso, "/more"): + ... d.value(RDFS.label, "More") + >>> (URIRef('http://example.org/'), RDFS.seeAlso, + ... URIRef('http://example.org/more')) in d.graph + True + >>> d.graph.value(URIRef('http://example.org/more'), RDFS.label) + rdflib.term.Literal('More') + + ``` + """ + + kws.setdefault("base", self.base) + p = cast_identifier(p) + o = cast_identifier(o, **kws) + self.graph.add((self._current(), p, o)) + return self._subject_stack(o) + + def rev(self, p, s=None, **kws): + """ + Same as `rel`, but uses current subject as *object* of the relation. + The given resource is still used as subject in the returned context + manager. + + Example: + ```python + >>> from rdflib import URIRef + >>> from rdflib.namespace import RDF, RDFS + >>> d = Describer(about="http://example.org/") + >>> with d.rev(RDFS.seeAlso, "http://example.net/"): + ... d.value(RDFS.label, "Net") + >>> (URIRef('http://example.net/'), RDFS.seeAlso, + ... URIRef('http://example.org/')) in d.graph + True + >>> d.graph.value(URIRef('http://example.net/'), RDFS.label) + rdflib.term.Literal('Net') + + ``` + """ + kws.setdefault("base", self.base) + p = cast_identifier(p) + s = cast_identifier(s, **kws) + self.graph.add((s, p, self._current())) + return self._subject_stack(s) + + def rdftype(self, t): + """Shorthand for setting rdf:type of the current subject. + + Example: + ```python + >>> from rdflib import URIRef + >>> from rdflib.namespace import RDF, RDFS + >>> d = Describer(about="http://example.org/") + >>> d.rdftype(RDFS.Resource) + >>> (URIRef('http://example.org/'), + ... RDF.type, RDFS.Resource) in d.graph + True + + ``` + """ + self.graph.add((self._current(), RDF.type, t)) + + def _current(self): + return self._subjects[-1] + + @contextmanager + def _subject_stack(self, subject): + self._subjects.append(subject) + yield None + self._subjects.pop() + + +def cast_value(v, **kws): + if not isinstance(v, Literal): + v = Literal(v, **kws) + return v + + +def cast_identifier(ref, **kws): + ref = ref or BNode() + if not isinstance(ref, Identifier): + ref = URIRef(ref, **kws) + return ref diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/extras/external_graph_libs.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/extras/external_graph_libs.py new file mode 100644 index 0000000000000000000000000000000000000000..cd7acbb0b8fadb048e5357125461654a4608f7ac --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/extras/external_graph_libs.py @@ -0,0 +1,362 @@ +"""Convert (to and) from rdflib graphs to other well known graph libraries. + +Currently the following libraries are supported: + +- networkx: MultiDiGraph, DiGraph, Graph +- graph_tool: Graph + +Doctests in this file are all skipped, as we can't run them conditionally if +networkx or graph_tool are available and they would err otherwise. +see `../../test/test_extras_external_graph_libs.py` for conditional tests +""" + +from __future__ import annotations + +import logging +from typing import TYPE_CHECKING, Any, Dict, List + +if TYPE_CHECKING: + from rdflib.graph import Graph + + +logger = logging.getLogger(__name__) + + +def _identity(x): + return x + + +def _rdflib_to_networkx_graph( + graph: Graph, + nxgraph, + calc_weights: bool, + edge_attrs, + transform_s=_identity, + transform_o=_identity, +): + """Helper method for multidigraph, digraph and graph. + + Modifies nxgraph in-place! + + Args: + graph: an rdflib.Graph. + nxgraph: a networkx.Graph/DiGraph/MultiDigraph. + calc_weights: If True adds a 'weight' attribute to each edge according + to the count of s,p,o triples between s and o, which is meaningful + for Graph/DiGraph. + edge_attrs: Callable to construct edge data from s, p, o. + 'triples' attribute is handled specially to be merged. + 'weight' should not be generated if calc_weights==True. + (see invokers below!) + transform_s: Callable to transform node generated from s. + transform_o: Callable to transform node generated from o. + """ + assert callable(edge_attrs) + assert callable(transform_s) + assert callable(transform_o) + import networkx as nx + + for s, p, o in graph: + ts, to = transform_s(s), transform_o(o) # apply possible transformations + data = nxgraph.get_edge_data(ts, to) + if data is None or isinstance(nxgraph, nx.MultiDiGraph): + # no edge yet, set defaults + data = edge_attrs(s, p, o) + if calc_weights: + data["weight"] = 1 + nxgraph.add_edge(ts, to, **data) + else: + # already have an edge, just update attributes + if calc_weights: + data["weight"] += 1 + if "triples" in data: + d = edge_attrs(s, p, o) + data["triples"].extend(d["triples"]) + + +def rdflib_to_networkx_multidigraph( + graph: Graph, edge_attrs=lambda s, p, o: {"key": p}, **kwds +): + r"""Converts the given graph into a networkx.MultiDiGraph. + + The subjects and objects are the later nodes of the MultiDiGraph. + The predicates are used as edge keys (to identify multi-edges). + + Args: + graph: a rdflib.Graph. + edge_attrs: Callable to construct later edge_attributes. It receives + 3 variables (s, p, o) and should construct a dictionary that is + passed to networkx's add_edge(s, o, \*\*attrs) function. + + By default this will include setting the MultiDiGraph key=p here. + If you don't want to be able to re-identify the edge later on, you + can set this to `lambda s, p, o: {}`. In this case MultiDiGraph's + default (increasing ints) will be used. + + Returns: + networkx.MultiDiGraph + + Example: + ```python + >>> from rdflib import Graph, URIRef, Literal + >>> g = Graph() + >>> a, b, l = URIRef('a'), URIRef('b'), Literal('l') + >>> p, q = URIRef('p'), URIRef('q') + >>> edges = [(a, p, b), (a, q, b), (b, p, a), (b, p, l)] + >>> for t in edges: + ... g.add(t) + ... + >>> mdg = rdflib_to_networkx_multidigraph(g) + >>> len(mdg.edges()) + 4 + >>> mdg.has_edge(a, b) + True + >>> mdg.has_edge(a, b, key=p) + True + >>> mdg.has_edge(a, b, key=q) + True + + >>> mdg = rdflib_to_networkx_multidigraph(g, edge_attrs=lambda s,p,o: {}) + >>> mdg.has_edge(a, b, key=0) + True + >>> mdg.has_edge(a, b, key=1) + True + ``` + """ + import networkx as nx + + mdg = nx.MultiDiGraph() + _rdflib_to_networkx_graph(graph, mdg, False, edge_attrs, **kwds) + return mdg + + +def rdflib_to_networkx_digraph( + graph: Graph, + calc_weights: bool = True, + edge_attrs=lambda s, p, o: {"triples": [(s, p, o)]}, + **kwds, +): + r"""Converts the given graph into a networkx.DiGraph. + + As an rdflib.Graph() can contain multiple edges between nodes, by default + adds the a 'triples' attribute to the single DiGraph edge with a list of + all triples between s and o. + Also by default calculates the edge weight as the length of triples. + + Args: + graph: a rdflib.Graph. + calc_weights: If true calculate multi-graph edge-count as edge 'weight' + edge_attrs: Callable to construct later edge_attributes. It receives + 3 variables (s, p, o) and should construct a dictionary that is passed to + networkx's add_edge(s, o, \*\*attrs) function. + + By default this will include setting the 'triples' attribute here, + which is treated specially by us to be merged. Other attributes of + multi-edges will only contain the attributes of the first edge. + If you don't want the 'triples' attribute for tracking, set this to + `lambda s, p, o: {}`. + + Returns: networkx.DiGraph + + Example: + ```python + >>> from rdflib import Graph, URIRef, Literal + >>> g = Graph() + >>> a, b, l = URIRef('a'), URIRef('b'), Literal('l') + >>> p, q = URIRef('p'), URIRef('q') + >>> edges = [(a, p, b), (a, q, b), (b, p, a), (b, p, l)] + >>> for t in edges: + ... g.add(t) + ... + >>> dg = rdflib_to_networkx_digraph(g) + >>> dg[a][b]['weight'] + 2 + >>> sorted(dg[a][b]['triples']) == [(a, p, b), (a, q, b)] + True + >>> len(dg.edges()) + 3 + >>> dg.size() + 3 + >>> dg.size(weight='weight') + 4.0 + + >>> dg = rdflib_to_networkx_graph(g, False, edge_attrs=lambda s,p,o:{}) + >>> 'weight' in dg[a][b] + False + >>> 'triples' in dg[a][b] + False + ``` + """ + import networkx as nx + + dg = nx.DiGraph() + _rdflib_to_networkx_graph(graph, dg, calc_weights, edge_attrs, **kwds) + return dg + + +def rdflib_to_networkx_graph( + graph: Graph, + calc_weights: bool = True, + edge_attrs=lambda s, p, o: {"triples": [(s, p, o)]}, + **kwds, +): + r"""Converts the given graph into a networkx.Graph. + + As an [`rdflib.Graph()`][rdflib.Graph] can contain multiple directed edges between nodes, by + default adds the a 'triples' attribute to the single DiGraph edge with a list of triples between s and o in graph. + Also by default calculates the edge weight as the `len(triples)`. + + Args: + graph: a rdflib.Graph. + calc_weights: If true calculate multi-graph edge-count as edge 'weight' + edge_attrs: Callable to construct later edge_attributes. It receives + 3 variables (s, p, o) and should construct a dictionary that is + passed to networkx's add_edge(s, o, \*\*attrs) function. + + By default this will include setting the 'triples' attribute here, + which is treated specially by us to be merged. Other attributes of + multi-edges will only contain the attributes of the first edge. + If you don't want the 'triples' attribute for tracking, set this to + `lambda s, p, o: {}`. + + Returns: + networkx.Graph + + Example: + ```python + >>> from rdflib import Graph, URIRef, Literal + >>> g = Graph() + >>> a, b, l = URIRef('a'), URIRef('b'), Literal('l') + >>> p, q = URIRef('p'), URIRef('q') + >>> edges = [(a, p, b), (a, q, b), (b, p, a), (b, p, l)] + >>> for t in edges: + ... g.add(t) + ... + >>> ug = rdflib_to_networkx_graph(g) + >>> ug[a][b]['weight'] + 3 + >>> sorted(ug[a][b]['triples']) == [(a, p, b), (a, q, b), (b, p, a)] + True + >>> len(ug.edges()) + 2 + >>> ug.size() + 2 + >>> ug.size(weight='weight') + 4.0 + + >>> ug = rdflib_to_networkx_graph(g, False, edge_attrs=lambda s,p,o:{}) + >>> 'weight' in ug[a][b] + False + >>> 'triples' in ug[a][b] + False + ``` + """ + import networkx as nx + + g = nx.Graph() + _rdflib_to_networkx_graph(graph, g, calc_weights, edge_attrs, **kwds) + return g + + +def rdflib_to_graphtool( + graph: Graph, + v_prop_names: List[str] = ["term"], + e_prop_names: List[str] = ["term"], + transform_s=lambda s, p, o: {"term": s}, + transform_p=lambda s, p, o: {"term": p}, + transform_o=lambda s, p, o: {"term": o}, +): + """Converts the given graph into a graph_tool.Graph(). + + The subjects and objects are the later vertices of the Graph. + The predicates become edges. + + Args: + graph: a rdflib.Graph. + v_prop_names: a list of names for the vertex properties. The default is set + to ['term'] (see transform_s, transform_o below). + e_prop_names: a list of names for the edge properties. + transform_s: callable with s, p, o input. Should return a dictionary + containing a value for each name in v_prop_names. By default is set + to {'term': s} which in combination with v_prop_names = ['term'] + adds s as 'term' property to the generated vertex for s. + transform_p: similar to transform_s, but wrt. e_prop_names. By default + returns {'term': p} which adds p as a property to the generated + edge between the vertex for s and the vertex for o. + transform_o: similar to transform_s. + + Returns: graph_tool.Graph() + + Example: + ```python + >>> from rdflib import Graph, URIRef, Literal + >>> g = Graph() + >>> a, b, l = URIRef('a'), URIRef('b'), Literal('l') + >>> p, q = URIRef('p'), URIRef('q') + >>> edges = [(a, p, b), (a, q, b), (b, p, a), (b, p, l)] + >>> for t in edges: + ... g.add(t) + ... + >>> mdg = rdflib_to_graphtool(g) + >>> len(list(mdg.edges())) + 4 + >>> from graph_tool import util as gt_util + >>> vpterm = mdg.vertex_properties['term'] + >>> va = gt_util.find_vertex(mdg, vpterm, a)[0] + >>> vb = gt_util.find_vertex(mdg, vpterm, b)[0] + >>> vl = gt_util.find_vertex(mdg, vpterm, l)[0] + >>> (va, vb) in [(e.source(), e.target()) for e in list(mdg.edges())] + True + >>> epterm = mdg.edge_properties['term'] + >>> len(list(gt_util.find_edge(mdg, epterm, p))) == 3 + True + >>> len(list(gt_util.find_edge(mdg, epterm, q))) == 1 + True + + >>> mdg = rdflib_to_graphtool( + ... g, + ... e_prop_names=[str('name')], + ... transform_p=lambda s, p, o: {str('name'): unicode(p)}) + >>> epterm = mdg.edge_properties['name'] + >>> len(list(gt_util.find_edge(mdg, epterm, unicode(p)))) == 3 + True + >>> len(list(gt_util.find_edge(mdg, epterm, unicode(q)))) == 1 + True + ``` + """ + # pytype error: Can't find module 'graph_tool'. + import graph_tool as gt # pytype: disable=import-error + + g = gt.Graph() + + vprops = [(vpn, g.new_vertex_property("object")) for vpn in v_prop_names] + for vpn, vprop in vprops: + g.vertex_properties[vpn] = vprop + eprops = [(epn, g.new_edge_property("object")) for epn in e_prop_names] + for epn, eprop in eprops: + g.edge_properties[epn] = eprop + node_to_vertex: Dict[Any, Any] = {} + for s, p, o in graph: + sv = node_to_vertex.get(s) + if sv is None: + v = g.add_vertex() + node_to_vertex[s] = v + tmp_props = transform_s(s, p, o) + for vpn, vprop in vprops: + vprop[v] = tmp_props[vpn] + sv = v + + ov = node_to_vertex.get(o) + if ov is None: + v = g.add_vertex() + node_to_vertex[o] = v + tmp_props = transform_o(s, p, o) + for vpn, vprop in vprops: + vprop[v] = tmp_props[vpn] + ov = v + + e = g.add_edge(sv, ov) + tmp_props = transform_p(s, p, o) + for epn, eprop in eprops: + eprop[e] = tmp_props[epn] + return g diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/extras/infixowl.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/extras/infixowl.py new file mode 100644 index 0000000000000000000000000000000000000000..bb60de383427227799ad773ad77dd816e2233697 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/extras/infixowl.py @@ -0,0 +1,2407 @@ +"""RDFLib Python binding for OWL Abstract Syntax + +| OWL Constructor | DL Syntax | Manchester OWL Syntax | Example | +|------------------|---------------|------------------------|----------------------------------| +| `intersectionOf` | C ∩ D | C AND D | Human AND Male | +| `unionOf` | C ∪ D | C OR D | Man OR Woman | +| `complementOf` | ¬C | NOT C | NOT Male | +| `oneOf` | {a} ∪ {b}... | {a b ...} | {England Italy Spain} | +| `someValuesFrom` | ∃ R C | R SOME C | hasColleague SOME Professor | +| `allValuesFrom` | ∀ R C | R ONLY C | hasColleague ONLY Professor | +| `minCardinality` | ≥ N R | R MIN 3 | hasColleague MIN 3 | +| `maxCardinality` | ≤ N R | R MAX 3 | hasColleague MAX 3 | +| `cardinality` | = N R | R EXACTLY 3 | hasColleague EXACTLY 3 | +| `hasValue` | ∃ R.{a} | R VALUE a | hasColleague VALUE Matthew | + +See: +- http://www.w3.org/TR/owl-semantics/syntax.html +- http://owl-workshop.man.ac.uk/acceptedLong/submission_9.pdf + +3.2.3 Axioms for complete classes without using owl:equivalentClass + +Named class description of type 2 (with owl:oneOf) or type 4-6 +(with owl:intersectionOf, owl:unionOf or owl:complementOf + +Uses Manchester Syntax for `__repr__` + +```python +>>> exNs = Namespace("http://example.com/") +>>> g = Graph() +>>> g.bind("ex", exNs, override=False) + +``` + +Now we have an empty graph, we can construct OWL classes in it +using the Python classes defined in this module + +```python +>>> a = Class(exNs.Opera, graph=g) + +``` + +Now we can assert rdfs:subClassOf and owl:equivalentClass relationships +(in the underlying graph) with other classes using the 'subClassOf' +and 'equivalentClass' descriptors which can be set to a list +of objects for the corresponding predicates. + +```python +>>> a.subClassOf = [exNs.MusicalWork] + +``` + +We can then access the rdfs:subClassOf relationships + +```python +>>> print(list(a.subClassOf)) +[Class: ex:MusicalWork ] + +``` + +This can also be used against already populated graphs: + +```python +>>> owlGraph = Graph().parse(str(OWL)) +>>> list(Class(OWL.Class, graph=owlGraph).subClassOf) +[Class: rdfs:Class ] + +``` + +Operators are also available. For instance we can add ex:Opera to the extension +of the ex:CreativeWork class via the '+=' operator + +```python +>>> a +Class: ex:Opera SubClassOf: ex:MusicalWork +>>> b = Class(exNs.CreativeWork, graph=g) +>>> b += a +>>> print(sorted(a.subClassOf, key=lambda c:c.identifier)) +[Class: ex:CreativeWork , Class: ex:MusicalWork ] + +``` + +And we can then remove it from the extension as well + +```python +>>> b -= a +>>> a +Class: ex:Opera SubClassOf: ex:MusicalWork + +``` + +Boolean class constructions can also be created with Python operators. +For example, The | operator can be used to construct a class consisting of a +owl:unionOf the operands: + +```python +>>> c = a | b | Class(exNs.Work, graph=g) +>>> c +( ex:Opera OR ex:CreativeWork OR ex:Work ) + +``` + +Boolean class expressions can also be operated as lists (using python list +operators) + +```python +>>> del c[c.index(Class(exNs.Work, graph=g))] +>>> c +( ex:Opera OR ex:CreativeWork ) + +``` + +The '&' operator can be used to construct class intersection: + +```python +>>> woman = Class(exNs.Female, graph=g) & Class(exNs.Human, graph=g) +>>> woman.identifier = exNs.Woman +>>> woman +( ex:Female AND ex:Human ) +>>> len(woman) +2 + +``` + +Enumerated classes can also be manipulated + +```python +>>> contList = [Class(exNs.Africa, graph=g), Class(exNs.NorthAmerica, graph=g)] +>>> EnumeratedClass(members=contList, graph=g) +{ ex:Africa ex:NorthAmerica } + +``` + +owl:Restrictions can also be instantiated: + +```python +>>> Restriction(exNs.hasParent, graph=g, allValuesFrom=exNs.Human) +( ex:hasParent ONLY ex:Human ) + +``` + +Restrictions can also be created using Manchester OWL syntax in 'colloquial' Python + +```python +>>> exNs.hasParent @ some @ Class(exNs.Physician, graph=g) +( ex:hasParent SOME ex:Physician ) +>>> Property(exNs.hasParent, graph=g) @ max @ Literal(1) +( ex:hasParent MAX 1 ) +>>> print(g.serialize(format='pretty-xml')) # doctest: +SKIP +``` +""" + +from __future__ import annotations + +import itertools +import logging +from typing import Iterable, Union + +from rdflib.collection import Collection +from rdflib.graph import Graph, _ObjectType +from rdflib.namespace import OWL, RDF, RDFS, XSD, Namespace, NamespaceManager +from rdflib.term import BNode, Identifier, Literal, URIRef, Variable +from rdflib.util import first + +logger = logging.getLogger(__name__) + + +""" +From: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/384122 + +Python has the wonderful "in" operator and it would be nice to have additional +infix operator like this. This recipe shows how (almost) arbitrary infix +operators can be defined. +""" + +__all__ = [ + "ACE_NS", + "AllClasses", + "AllDifferent", + "AllProperties", + "AnnotatableTerms", + "BooleanClass", + "CLASS_RELATIONS", + "Callable", + "CastClass", + "Class", + "ClassNamespaceFactory", + "CommonNSBindings", + "ComponentTerms", + "DeepClassClear", + "EnumeratedClass", + "GetIdentifiedClasses", + "Individual", + "Infix", + "MalformedClass", + "MalformedClassError", + "OWLRDFListProxy", + "Ontology", + "Property", + "PropertyAbstractSyntax", + "Restriction", + "classOrIdentifier", + "classOrTerm", + "exactly", + "generateQName", + "manchesterSyntax", + "max", + "min", + "nsBinds", + "only", + "propertyOrIdentifier", + "some", + "value", +] + +# definition of an Infix operator class +# this recipe also works in jython +# calling sequence for the infix is: +# x @ op @ y + + +class Infix: + def __init__(self, function): + self.function = function + + def __rlshift__(self, other): + return Infix(lambda x, self=self, other=other: self.function(other, x)) + + def __rshift__(self, other): + return self.function(other) + + def __rmatmul__(self, other): + return Infix(lambda x, self=self, other=other: self.function(other, x)) + + def __matmul__(self, other): + return self.function(other) + + def __call__(self, value1, value2): + return self.function(value1, value2) # pragma: no cover + + +nsBinds = { # noqa: N816 + "skos": "http://www.w3.org/2004/02/skos/core#", + "rdf": RDF, + "rdfs": RDFS, + "owl": OWL, + "list": URIRef("http://www.w3.org/2000/10/swap/list#"), + "dc": "http://purl.org/dc/elements/1.1/", +} + + +def generateQName(graph, uri): # noqa: N802 + prefix, uri, localname = graph.compute_qname(classOrIdentifier(uri)) + return ":".join([prefix, localname]) + + +def classOrTerm(thing): # noqa: N802 + if isinstance(thing, Class): + return thing.identifier + else: + assert isinstance(thing, (URIRef, BNode, Literal)) + return thing + + +def classOrIdentifier(thing): # noqa: N802 + if isinstance(thing, (Property, Class)): + return thing.identifier + else: + assert isinstance(thing, (URIRef, BNode)), ( + "Expecting a Class, Property, URIRef, or BNode.. not a %s" % thing + ) + return thing + + +def propertyOrIdentifier(thing): # noqa: N802 + if isinstance(thing, Property): + return thing.identifier + else: + assert isinstance(thing, URIRef) + return thing + + +def manchesterSyntax( # noqa: N802 + thing, store, boolean=None, transientList=False # noqa: N803 +): + """ + Core serialization + thing is a Class and is processed as a subject + store is an RDFLib Graph to be queried about thing + """ + assert thing is not None + if boolean: + if transientList: + livechildren = iter(thing) + children = [manchesterSyntax(child, store) for child in thing] + else: + livechildren = iter(Collection(store, thing)) + children = [ + manchesterSyntax(child, store) for child in Collection(store, thing) + ] + if boolean == OWL.intersectionOf: + childlist = [] + named = [] + for child in livechildren: + if isinstance(child, URIRef): + named.append(child) + else: + childlist.append(child) + if named: + + def castToQName(x): # noqa: N802 + prefix, uri, localname = store.compute_qname(x) + return ":".join([prefix, localname]) + + if len(named) > 1: + prefix = "( " + " AND ".join(map(castToQName, named)) + " )" + else: + prefix = manchesterSyntax(named[0], store) + if childlist: + return ( + str(prefix) + + " THAT " + + " AND ".join( + [str(manchesterSyntax(x, store)) for x in childlist] + ) + ) + else: + return prefix + else: + return "( " + " AND ".join([str(c) for c in children]) + " )" + elif boolean == OWL.unionOf: + return "( " + " OR ".join([str(c) for c in children]) + " )" + elif boolean == OWL.oneOf: + return "{ " + " ".join([str(c) for c in children]) + " }" + else: + assert boolean == OWL.complementOf + elif OWL.Restriction in store.objects(subject=thing, predicate=RDF.type): + prop = list(store.objects(subject=thing, predicate=OWL.onProperty))[0] + prefix, uri, localname = store.compute_qname(prop) + propstring = ":".join([prefix, localname]) + label = first(store.objects(subject=prop, predicate=RDFS.label)) + if label: + propstring = "'%s'" % label + for onlyclass in store.objects(subject=thing, predicate=OWL.allValuesFrom): + return "( %s ONLY %s )" % (propstring, manchesterSyntax(onlyclass, store)) + for val in store.objects(subject=thing, predicate=OWL.hasValue): + return "( %s VALUE %s )" % (propstring, manchesterSyntax(val, store)) + for someclass in store.objects(subject=thing, predicate=OWL.someValuesFrom): + return "( %s SOME %s )" % (propstring, manchesterSyntax(someclass, store)) + cardlookup = { + OWL.maxCardinality: "MAX", + OWL.minCardinality: "MIN", + OWL.cardinality: "EQUALS", + } + for _s, p, o in store.triples_choices((thing, list(cardlookup.keys()), None)): + return "( %s %s %s )" % (propstring, cardlookup[p], o) + # is thing a complement of anything + compl = list(store.objects(subject=thing, predicate=OWL.complementOf)) + if compl: + return "( NOT %s )" % (manchesterSyntax(compl[0], store)) + else: + prolog = "\n".join(["PREFIX %s: <%s>" % (k, nsBinds[k]) for k in nsBinds]) + qstr = ( + prolog + + "\nSELECT ?p ?bool WHERE {?class a owl:Class; ?p ?bool ." + + "?bool rdf:first ?foo }" + ) + initb = {Variable("?class"): thing} + for boolprop, col in store.query(qstr, processor="sparql", initBindings=initb): + if not isinstance(thing, URIRef): + return manchesterSyntax(col, store, boolean=boolprop) + try: + prefix, uri, localname = store.compute_qname(thing) + qname = ":".join([prefix, localname]) + except Exception: + if isinstance(thing, BNode): + return thing.n3() + # Expect the unexpected + return thing.identifier if not isinstance(thing, str) else thing + label = first(Class(thing, graph=store).label) + if label: + return label + else: + return qname + + +def GetIdentifiedClasses(graph): # noqa: N802 + for c in graph.subjects(predicate=RDF.type, object=OWL.Class): + if isinstance(c, URIRef): + yield Class(c) + + +class TermDeletionHelper: + def __init__(self, prop): + self.prop = prop + + def __call__(self, f): + def _remover(inst): + inst.graph.remove((inst.identifier, self.prop, None)) + + return _remover + + +class Individual: + """ + A typed individual, the base class of the InfixOWL classes. + """ + + factoryGraph = Graph() # noqa: N815 + + def serialize(self, graph): + for fact in self.factoryGraph.triples((self.identifier, None, None)): + graph.add(fact) + + def __init__(self, identifier=None, graph=None): + self.__identifier = identifier is not None and identifier or BNode() + if graph is None: + self.graph = self.factoryGraph + else: + self.graph = graph + self.qname = None + if not isinstance(self.identifier, BNode): + try: + prefix, uri, localname = self.graph.compute_qname(self.identifier) + self.qname = ":".join([prefix, localname]) + except Exception: # pragma: no cover + pass # pragma: no cover + + def clearInDegree(self): # noqa: N802 + """ + Remove references to this individual as an object in the + backing store. + """ + self.graph.remove((None, None, self.identifier)) + + def clearOutDegree(self): # noqa: N802 + """ + Remove all statements to this individual as a subject in the + backing store. Note that this only removes the statements + themselves, not the blank node closure so there is a chance + that this will cause orphaned blank nodes to remain in the + graph. + """ + self.graph.remove((self.identifier, None, None)) + + def delete(self): + """ + Delete the individual from the graph, clearing the in and + out degrees. + """ + self.clearInDegree() + self.clearOutDegree() + + def replace(self, other): + """ + Replace the individual in the graph with the given other, + causing all triples that refer to it to be changed and then + delete the individual. + + ```python + >>> g = Graph() + >>> b = Individual(OWL.Restriction, g) + >>> b.type = RDFS.Resource + >>> len(list(b.type)) + 1 + >>> del b.type + >>> len(list(b.type)) + 0 + + ``` + """ + for s, p, _o in self.graph.triples((None, None, self.identifier)): + self.graph.add((s, p, classOrIdentifier(other))) + self.delete() + + def _get_type(self) -> Iterable[_ObjectType]: + for _t in self.graph.objects(subject=self.identifier, predicate=RDF.type): + yield _t + + def _set_type(self, kind: Union[Individual, Identifier, Iterable[_ObjectType]]): + if not kind: + return + if isinstance(kind, (Individual, Identifier)): + self.graph.add((self.identifier, RDF.type, classOrIdentifier(kind))) + else: + for c in kind: + assert isinstance(c, (Individual, Identifier)) + self.graph.add((self.identifier, RDF.type, classOrIdentifier(c))) + + @TermDeletionHelper(RDF.type) + def _delete_type(self): + """ + ```python + >>> g = Graph() + >>> b = Individual(OWL.Restriction, g) + >>> b.type = RDFS.Resource + >>> len(list(b.type)) + 1 + >>> del b.type + >>> len(list(b.type)) + 0 + + ``` + """ + pass # pragma: no cover + + type = property(_get_type, _set_type, _delete_type) + + def _get_identifier(self) -> Identifier: + return self.__identifier + + def _set_identifier(self, i: Identifier): + assert i + if i != self.__identifier: + oldstatements_out = [ + (p, o) + for s, p, o in self.graph.triples((self.__identifier, None, None)) + ] + oldstatements_in = [ + (s, p) + for s, p, o in self.graph.triples((None, None, self.__identifier)) + ] + for p1, o1 in oldstatements_out: + self.graph.remove((self.__identifier, p1, o1)) + for s1, p1 in oldstatements_in: + self.graph.remove((s1, p1, self.__identifier)) + self.__identifier = i + self.graph.addN([(i, p1, o1, self.graph) for p1, o1 in oldstatements_out]) + self.graph.addN([(s1, p1, i, self.graph) for s1, p1 in oldstatements_in]) + if not isinstance(i, BNode): + try: + prefix, uri, localname = self.graph.compute_qname(i) + self.qname = ":".join([prefix, localname]) + except Exception: # pragma: no cover + pass # pragma: no cover + + identifier = property(_get_identifier, _set_identifier) + + def _get_sameAs(self) -> Iterable[_ObjectType]: # noqa: N802 + for _t in self.graph.objects(subject=self.identifier, predicate=OWL.sameAs): + yield _t + + def _set_sameAs( # noqa: N802 + self, term: Union[Individual, Identifier, Iterable[_ObjectType]] + ): + # if not kind: + # return + if isinstance(term, (Individual, Identifier)): + self.graph.add((self.identifier, OWL.sameAs, classOrIdentifier(term))) + else: + for c in term: + assert isinstance(c, (Individual, Identifier)) + self.graph.add((self.identifier, OWL.sameAs, classOrIdentifier(c))) + + @TermDeletionHelper(OWL.sameAs) + def _delete_sameAs(self): # noqa: N802 + pass # pragma: no cover + + sameAs = property(_get_sameAs, _set_sameAs, _delete_sameAs) # noqa: N815 + + +ACE_NS = Namespace("http://attempto.ifi.uzh.ch/ace_lexicon#") + + +class AnnotatableTerms(Individual): + """Terms in an OWL ontology with rdfs:label and rdfs:comment + + Interface with ATTEMPTO (http://attempto.ifi.uzh.ch/site) + + ## Verbalisation of OWL entity IRIS + + ### How are OWL entity IRIs verbalized? + + The OWL verbalizer maps OWL entity IRIs to ACE content words such + that + + - OWL individuals map to ACE proper names (PN) + - OWL classes map to ACE common nouns (CN) + - OWL properties map to ACE transitive verbs (TV) + + There are 6 morphological categories that determine the surface form + of an IRI: + + - singular form of a proper name (e.g. John) + - singular form of a common noun (e.g. man) + - plural form of a common noun (e.g. men) + - singular form of a transitive verb (e.g. mans) + - plural form of a transitive verb (e.g. man) + - past participle form a transitive verb (e.g. manned) + + The user has full control over the eventual surface forms of the IRIs + but has to choose them in terms of the above categories. + Furthermore, + + - the surface forms must be legal ACE content words (e.g. they + should not contain punctuation symbols); + - the mapping of IRIs to surface forms must be bidirectional + within the same word class, in order to be able to (if needed) + parse the verbalization back into OWL in a semantics preserving + way. + + ### Using the lexicon + + It is possible to specify the mapping of IRIs to surface forms using + the following annotation properties: + + ``` + http://attempto.ifi.uzh.ch/ace_lexicon#PN_sg + http://attempto.ifi.uzh.ch/ace_lexicon#CN_sg + http://attempto.ifi.uzh.ch/ace_lexicon#CN_pl + http://attempto.ifi.uzh.ch/ace_lexicon#TV_sg + http://attempto.ifi.uzh.ch/ace_lexicon#TV_pl + http://attempto.ifi.uzh.ch/ace_lexicon#TV_vbg + ``` + + For example, the following axioms state that if the IRI "#man" is used + as a plural common noun, then the wordform men must be used by the + verbalizer. If, however, it is used as a singular transitive verb, + then mans must be used. + + ```xml + + + #man + men + + + + + #man + mans + + ``` + """ + + def __init__( + self, + identifier, + graph=None, + nameAnnotation=None, # noqa: N803 + nameIsLabel=False, # noqa: N803 + ): + super(AnnotatableTerms, self).__init__(identifier, graph) + if nameAnnotation: + self.setupACEAnnotations() + self.PN_sgprop.extent = [ + (self.identifier, self.handleAnnotation(nameAnnotation)) + ] + if nameIsLabel: + self.label = [nameAnnotation] + + def handleAnnotation(self, val): # noqa: N802 + return val if isinstance(val, Literal) else Literal(val) + + def setupACEAnnotations(self): # noqa: N802 + self.graph.bind("ace", ACE_NS, override=False) + + # PN_sg singular form of a proper name () + self.PN_sgprop = Property( + ACE_NS.PN_sg, baseType=OWL.AnnotationProperty, graph=self.graph + ) + + # CN_sg singular form of a common noun + self.CN_sgprop = Property( + ACE_NS.CN_sg, baseType=OWL.AnnotationProperty, graph=self.graph + ) + + # CN_pl plural form of a common noun + self.CN_plprop = Property( + ACE_NS.CN_pl, baseType=OWL.AnnotationProperty, graph=self.graph + ) + + # singular form of a transitive verb + self.tv_sgprop = Property( + ACE_NS.TV_sg, baseType=OWL.AnnotationProperty, graph=self.graph + ) + + # plural form of a transitive verb + self.tv_plprop = Property( + ACE_NS.TV_pl, baseType=OWL.AnnotationProperty, graph=self.graph + ) + + # past participle form a transitive verb + self.tv_vbgprop = Property( + ACE_NS.TV_vbg, baseType=OWL.AnnotationProperty, graph=self.graph + ) + + def _get_comment(self): + for comment in self.graph.objects( + subject=self.identifier, predicate=RDFS.comment + ): + yield comment + + def _set_comment(self, comment): + if not comment: + return + if isinstance(comment, Identifier): + self.graph.add((self.identifier, RDFS.comment, comment)) + else: + for c in comment: + self.graph.add((self.identifier, RDFS.comment, c)) + + @TermDeletionHelper(RDFS.comment) + def _del_comment(self): + pass # pragma: no cover + + comment = property(_get_comment, _set_comment, _del_comment) + + def _get_seealso(self): + for seealso in self.graph.objects( + subject=self.identifier, predicate=RDFS.seeAlso + ): + yield seealso + + def _set_seealso(self, seealsos): + if not seealsos: + return + for s in seealsos: + self.graph.add((self.identifier, RDFS.seeAlso, s)) + + @TermDeletionHelper(RDFS.seeAlso) + def _del_seealso(self): + pass # pragma: no cover + + seeAlso = property(_get_seealso, _set_seealso, _del_seealso) # noqa: N815 + + def _get_label(self): + for label in self.graph.objects(subject=self.identifier, predicate=RDFS.label): + yield label + + def _set_label(self, label): + if not label: + return + if isinstance(label, Identifier): + self.graph.add((self.identifier, RDFS.label, label)) + else: + for l_ in label: + self.graph.add((self.identifier, RDFS.label, l_)) + + @TermDeletionHelper(RDFS.label) + def _delete_label(self): + """ + ```python + >>> g = Graph() + >>> b = Individual(OWL.Restriction,g) + >>> b.label = Literal('boo') + >>> len(list(b.label)) + 1 + >>> del b.label + >>> len(list(b.label)) + 0 + + ``` + """ + pass # pragma: no cover + + label = property(_get_label, _set_label, _delete_label) + + +class Ontology(AnnotatableTerms): + """The owl ontology metadata""" + + def __init__(self, identifier=None, imports=None, comment=None, graph=None): + super(Ontology, self).__init__(identifier, graph) + self.imports = [] if imports is None else imports + self.comment = [] if comment is None else comment + if (self.identifier, RDF.type, OWL.Ontology) not in self.graph: + self.graph.add((self.identifier, RDF.type, OWL.Ontology)) + + def setVersion(self, version): # noqa: N802 + self.graph.set((self.identifier, OWL.versionInfo, version)) + + def _get_imports(self): + for owl in self.graph.objects( + subject=self.identifier, predicate=OWL["imports"] + ): + yield owl + + def _set_imports(self, other): + if not other: + return + for o in other: + self.graph.add((self.identifier, OWL["imports"], o)) + + @TermDeletionHelper(OWL["imports"]) + def _del_imports(self): + pass # pragma: no cover + + imports = property(_get_imports, _set_imports, _del_imports) + + +def AllClasses(graph): # noqa: N802 + for c in set(graph.subjects(predicate=RDF.type, object=OWL.Class)): + yield Class(c) + + +def AllProperties(graph): # noqa: N802 + prevprops = set() + for s, _p, o in graph.triples_choices( + ( + None, + RDF.type, + [ + OWL.SymmetricProperty, + OWL.FunctionalProperty, + OWL.InverseFunctionalProperty, + OWL.TransitiveProperty, + OWL.DatatypeProperty, + OWL.ObjectProperty, + OWL.AnnotationProperty, + ], + ) + ): + if o in [ + OWL.SymmetricProperty, + OWL.InverseFunctionalProperty, + OWL.TransitiveProperty, + OWL.ObjectProperty, + ]: + bType = OWL.ObjectProperty # noqa: N806 + else: + bType = OWL.DatatypeProperty # noqa: N806 + if s not in prevprops: + prevprops.add(s) + yield Property(s, graph=graph, baseType=bType) + + +class ClassNamespaceFactory(Namespace): + def term(self, name): + return Class(URIRef(self + name)) + + def __getitem__(self, key, default=None): + return self.term(key) + + def __getattr__(self, name): + if name.startswith("__"): # ignore any special Python names! + raise AttributeError + else: + return self.term(name) + + +CLASS_RELATIONS = set( + Namespace("http://www.w3.org/2002/07/owl#resourceProperties") +).difference( + [ + OWL.onProperty, + OWL.allValuesFrom, + OWL.hasValue, + OWL.someValuesFrom, + OWL.inverseOf, + OWL.imports, + OWL.versionInfo, + OWL.backwardCompatibleWith, + OWL.incompatibleWith, + OWL.unionOf, + OWL.intersectionOf, + OWL.oneOf, + ] +) + + +def ComponentTerms(cls): # noqa: N802 + """ + Takes a Class instance and returns a generator over the classes that + are involved in its definition, ignoring unnamed classes + """ + if OWL.Restriction in cls.type: + try: + cls = CastClass(cls, Individual.factoryGraph) + for _s, _p, inner_class_id in cls.factoryGraph.triples_choices( + (cls.identifier, [OWL.allValuesFrom, OWL.someValuesFrom], None) + ): + inner_class = Class(inner_class_id, skipOWLClassMembership=True) + if isinstance(inner_class_id, BNode): + for _c in ComponentTerms(inner_class): + yield _c + else: + yield inner_class + except Exception: # pragma: no cover + pass # pragma: no cover + else: + cls = CastClass(cls, Individual.factoryGraph) + if isinstance(cls, BooleanClass): + for _cls in cls: + _cls = Class(_cls, skipOWLClassMembership=True) + if isinstance(_cls.identifier, BNode): + for _c in ComponentTerms(_cls): + yield _c + else: + yield _cls + else: + for inner_class in cls.subClassOf: + if isinstance(inner_class.identifier, BNode): + for _c in ComponentTerms(inner_class): + yield _c + else: + yield inner_class + for _s, _p, o in cls.factoryGraph.triples_choices( + (classOrIdentifier(cls), CLASS_RELATIONS, None) + ): + if isinstance(o, BNode): + for _c in ComponentTerms(CastClass(o, Individual.factoryGraph)): + yield _c + else: + yield inner_class + + +def DeepClassClear(class_to_prune): # noqa: N802 + """ + Recursively clear the given class, continuing + where any related class is an anonymous class + + ```python + >>> EX = Namespace("http://example.com/") + >>> g = Graph() + >>> g.bind("ex", EX, override=False) + >>> Individual.factoryGraph = g + >>> classB = Class(EX.B) + >>> classC = Class(EX.C) + >>> classD = Class(EX.D) + >>> classE = Class(EX.E) + >>> classF = Class(EX.F) + >>> anonClass = EX.someProp @ some @ classD + >>> classF += anonClass + >>> list(anonClass.subClassOf) + [Class: ex:F ] + >>> classA = classE | classF | anonClass + >>> classB += classA + >>> classA.equivalentClass = [Class()] + >>> classB.subClassOf = [EX.someProp @ some @ classC] + >>> classA + ( ex:E OR ex:F OR ( ex:someProp SOME ex:D ) ) + >>> DeepClassClear(classA) + >>> classA + ( ) + >>> list(anonClass.subClassOf) + [] + >>> classB + Class: ex:B SubClassOf: ( ex:someProp SOME ex:C ) + + >>> otherClass = classD | anonClass + >>> otherClass + ( ex:D OR ( ex:someProp SOME ex:D ) ) + >>> DeepClassClear(otherClass) + >>> otherClass + ( ) + >>> otherClass.delete() + >>> list(g.triples((otherClass.identifier, None, None))) + [] + + ``` + """ + + def deepClearIfBNode(_class): # noqa: N802 + if isinstance(classOrIdentifier(_class), BNode): + DeepClassClear(_class) + + class_to_prune = CastClass(class_to_prune, Individual.factoryGraph) + for c in class_to_prune.subClassOf: + deepClearIfBNode(c) + class_to_prune.graph.remove((class_to_prune.identifier, RDFS.subClassOf, None)) + for c in class_to_prune.equivalentClass: + deepClearIfBNode(c) + class_to_prune.graph.remove((class_to_prune.identifier, OWL.equivalentClass, None)) + inverse_class = class_to_prune.complementOf + if inverse_class: + class_to_prune.graph.remove((class_to_prune.identifier, OWL.complementOf, None)) + deepClearIfBNode(inverse_class) + if isinstance(class_to_prune, BooleanClass): + for c in class_to_prune: + deepClearIfBNode(c) + class_to_prune.clear() + class_to_prune.graph.remove( + (class_to_prune.identifier, class_to_prune._operator, None) + ) + + +class MalformedClass(ValueError): # noqa: N818 + """ + !!! warning "Deprecated" + This class will be removed in version `7.0.0`. + """ + + pass + + +class MalformedClassError(MalformedClass): + def __init__(self, msg): + self.msg = msg + + def __repr__(self): + return self.msg + + +def CastClass(c, graph=None): # noqa: N802 + graph = graph is None and c.factoryGraph or graph + for kind in graph.objects(subject=classOrIdentifier(c), predicate=RDF.type): + if kind == OWL.Restriction: + kwargs = {"identifier": classOrIdentifier(c), "graph": graph} + for _s, p, o in graph.triples((classOrIdentifier(c), None, None)): + if p != RDF.type: + if p == OWL.onProperty: + kwargs["onProperty"] = o + else: + if p not in Restriction.restrictionKinds: + continue + kwargs[str(p.split(str(OWL))[-1])] = o + if not set( + [str(i.split(str(OWL))[-1]) for i in Restriction.restrictionKinds] + ).intersection(kwargs): + raise MalformedClassError("Malformed owl:Restriction") + return Restriction(**kwargs) + else: + for _s, p, _o in graph.triples_choices( + ( + classOrIdentifier(c), + [OWL.intersectionOf, OWL.unionOf, OWL.oneOf], + None, + ) + ): + if p == OWL.oneOf: + return EnumeratedClass(classOrIdentifier(c), graph=graph) + else: + return BooleanClass(classOrIdentifier(c), operator=p, graph=graph) + # assert (classOrIdentifier(c),RDF.type,OWL.Class) in graph + return Class(classOrIdentifier(c), graph=graph, skipOWLClassMembership=True) + + +class Class(AnnotatableTerms): + """'General form' for classes: + + The Manchester Syntax (supported in Protege) is used as the basis for the + form of this class + + See: http://owl-workshop.man.ac.uk/acceptedLong/submission_9.pdf: + + ``` + [Annotation] + ‘Class:’ classID {Annotation + ( (‘SubClassOf:’ ClassExpression) + | (‘EquivalentTo’ ClassExpression) + | (’DisjointWith’ ClassExpression)) } + ``` + + Appropriate excerpts from OWL Reference: + + ".. Subclass axioms provide us with partial definitions: they represent + necessary but not sufficient conditions for establishing class + membership of an individual." + + ".. A class axiom may contain (multiple) owl:equivalentClass statements" + + "..A class axiom may also contain (multiple) owl:disjointWith statements.." + + "..An owl:complementOf property links a class to precisely one class + description." + """ + + def _serialize(self, graph): + for cl in self.subClassOf: + CastClass(cl, self.graph).serialize(graph) + for cl in self.equivalentClass: + CastClass(cl, self.graph).serialize(graph) + for cl in self.disjointWith: + CastClass(cl, self.graph).serialize(graph) + if self.complementOf: + CastClass(self.complementOf, self.graph).serialize(graph) + + def serialize(self, graph): + for fact in self.graph.triples((self.identifier, None, None)): + graph.add(fact) + self._serialize(graph) + + def setupNounAnnotations(self, noun_annotations): # noqa: N802 + if isinstance(noun_annotations, tuple): + cn_sgprop, cn_plprop = noun_annotations + else: + cn_sgprop = noun_annotations + cn_plprop = noun_annotations + + if cn_sgprop: + self.CN_sgprop.extent = [ + (self.identifier, self.handleAnnotation(cn_sgprop)) + ] + if cn_plprop: + self.CN_plprop.extent = [ + (self.identifier, self.handleAnnotation(cn_plprop)) + ] + + def __init__( + self, + identifier=None, + subClassOf=None, # noqa: N803 + equivalentClass=None, # noqa: N803 + disjointWith=None, # noqa: N803 + complementOf=None, # noqa: N803 + graph=None, + skipOWLClassMembership=False, # noqa: N803 + comment=None, + nounAnnotations=None, # noqa: N803 + nameAnnotation=None, # noqa: N803 + nameIsLabel=False, # noqa: N803 + ): + super(Class, self).__init__(identifier, graph, nameAnnotation, nameIsLabel) + + if nounAnnotations: + self.setupNounAnnotations(nounAnnotations) + if ( + not skipOWLClassMembership + and (self.identifier, RDF.type, OWL.Class) not in self.graph + and (self.identifier, RDF.type, OWL.Restriction) not in self.graph + ): + self.graph.add((self.identifier, RDF.type, OWL.Class)) + + self.subClassOf = [] if subClassOf is None else subClassOf + self.equivalentClass = [] if equivalentClass is None else equivalentClass + self.disjointWith = [] if disjointWith is None else disjointWith + if complementOf: + self.complementOf = complementOf + self.comment = [] if comment is None else comment + + def _get_extent(self, graph=None): + for member in (graph is None and self.graph or graph).subjects( + predicate=RDF.type, object=self.identifier + ): + yield member + + def _set_extent(self, other): + if not other: + return + for m in other: + self.graph.add((classOrIdentifier(m), RDF.type, self.identifier)) + + @TermDeletionHelper(RDF.type) + def _del_type(self): + pass # pragma: no cover + + extent = property(_get_extent, _set_extent, _del_type) + + def _get_annotation(self, term=RDFS.label): + for annotation in self.graph.objects(subject=self.identifier, predicate=term): + yield annotation + + annotation = property(_get_annotation, lambda x: x) # type: ignore[arg-type,misc] + + def _get_extentquery(self): + return (Variable("CLASS"), RDF.type, self.identifier) + + def _set_extentquery(self, other): + pass # pragma: no cover + + extentQuery = property(_get_extentquery, _set_extentquery) # noqa: N815 + + def __hash__(self): + """ + >>> b = Class(OWL.Restriction) + >>> c = Class(OWL.Restriction) + >>> len(set([b,c])) + 1 + """ + return hash(self.identifier) + + def __eq__(self, other): + assert isinstance(other, Class), repr(other) + return self.identifier == other.identifier + + def __iadd__(self, other): + assert isinstance(other, Class) + other.subClassOf = [self] + return self + + def __isub__(self, other): + assert isinstance(other, Class) + self.graph.remove((classOrIdentifier(other), RDFS.subClassOf, self.identifier)) + return self + + def __invert__(self): + """ + Shorthand for Manchester syntax's not operator + """ + return Class(complementOf=self) + + def __or__(self, other): + """ + Construct an anonymous class description consisting of the union of + this class and 'other' and return it + """ + return BooleanClass( + operator=OWL.unionOf, members=[self, other], graph=self.graph + ) + + def __and__(self, other): + """ + Construct an anonymous class description consisting of the + intersection of this class and 'other' and return it + + Chaining 3 intersections + + ```python + >>> exNs = Namespace("http://example.com/") + >>> g = Graph() + >>> g.bind("ex", exNs, override=False) + >>> female = Class(exNs.Female, graph=g) + >>> human = Class(exNs.Human, graph=g) + >>> youngPerson = Class(exNs.YoungPerson, graph=g) + >>> youngWoman = female & human & youngPerson + >>> youngWoman # doctest: +SKIP + ex:YoungPerson THAT ( ex:Female AND ex:Human ) + >>> isinstance(youngWoman, BooleanClass) + True + >>> isinstance(youngWoman.identifier, BNode) + True + + ``` + """ + return BooleanClass( + operator=OWL.intersectionOf, members=[self, other], graph=self.graph + ) + + def _get_subclassof(self): + for anc in self.graph.objects( + subject=self.identifier, predicate=RDFS.subClassOf + ): + yield Class(anc, graph=self.graph, skipOWLClassMembership=True) + + def _set_subclassof(self, other): + if not other: + return + for sc in other: + self.graph.add((self.identifier, RDFS.subClassOf, classOrIdentifier(sc))) + + @TermDeletionHelper(RDFS.subClassOf) + def _del_subclassof(self): + pass # pragma: no cover + + subClassOf = property( # noqa: N815 + _get_subclassof, _set_subclassof, _del_subclassof + ) + + def _get_equivalentclass(self): + for ec in self.graph.objects( + subject=self.identifier, predicate=OWL.equivalentClass + ): + yield Class(ec, graph=self.graph) + + def _set_equivalentclass(self, other): + if not other: + return + for sc in other: + self.graph.add( + (self.identifier, OWL.equivalentClass, classOrIdentifier(sc)) + ) + + @TermDeletionHelper(OWL.equivalentClass) + def _del_equivalentclass(self): + pass # pragma: no cover + + equivalentClass = property( # noqa: N815 + _get_equivalentclass, _set_equivalentclass, _del_equivalentclass + ) + + def _get_disjointwith(self): + for dc in self.graph.objects( + subject=self.identifier, predicate=OWL.disjointWith + ): + yield Class(dc, graph=self.graph) + + def _set_disjointwith(self, other): + if not other: + return + for c in other: + self.graph.add((self.identifier, OWL.disjointWith, classOrIdentifier(c))) + + @TermDeletionHelper(OWL.disjointWith) + def _del_disjointwith(self): + pass # pragma: no cover + + disjointWith = property( # noqa: N815 + _get_disjointwith, _set_disjointwith, _del_disjointwith + ) + + def _get_complementof(self): + comp = list( + self.graph.objects(subject=self.identifier, predicate=OWL.complementOf) + ) + if not comp: + return None + elif len(comp) == 1: + return Class(comp[0], graph=self.graph) + else: + raise Exception(len(comp)) + + def _set_complementof(self, other): + if not other: + return + self.graph.add((self.identifier, OWL.complementOf, classOrIdentifier(other))) + + @TermDeletionHelper(OWL.complementOf) + def _del_complementof(self): + pass # pragma: no cover + + complementOf = property( # noqa: N815 + _get_complementof, _set_complementof, _del_complementof + ) + + def _get_parents(self): + """ + computed attributes that returns a generator over taxonomic 'parents' + by disjunction, conjunction, and subsumption + + ```python + >>> from rdflib.util import first + >>> exNs = Namespace('http://example.com/') + >>> g = Graph() + >>> g.bind("ex", exNs, override=False) + >>> Individual.factoryGraph = g + >>> brother = Class(exNs.Brother) + >>> sister = Class(exNs.Sister) + >>> sibling = brother | sister + >>> sibling.identifier = exNs.Sibling + >>> sibling + ( ex:Brother OR ex:Sister ) + >>> first(brother.parents) + Class: ex:Sibling EquivalentTo: ( ex:Brother OR ex:Sister ) + >>> parent = Class(exNs.Parent) + >>> male = Class(exNs.Male) + >>> father = parent & male + >>> father.identifier = exNs.Father + >>> list(father.parents) + [Class: ex:Parent , Class: ex:Male ] + + ``` + """ + for parent in itertools.chain(self.subClassOf, self.equivalentClass): + yield parent + + link = first(self.factoryGraph.subjects(RDF.first, self.identifier)) + if link: + siblingslist = list(self.factoryGraph.transitive_subjects(RDF.rest, link)) + if siblingslist: + collectionhead = siblingslist[-1] + else: + collectionhead = link + for disjointclass in self.factoryGraph.subjects( + OWL.unionOf, collectionhead + ): + if isinstance(disjointclass, URIRef): + yield Class(disjointclass, skipOWLClassMembership=True) + for rdf_list in self.factoryGraph.objects(self.identifier, OWL.intersectionOf): + for member in OWLRDFListProxy([rdf_list], graph=self.factoryGraph): + if isinstance(member, URIRef): + yield Class(member, skipOWLClassMembership=True) + + parents = property(_get_parents) + + def isPrimitive(self): # noqa: N802 + if (self.identifier, RDF.type, OWL.Restriction) in self.graph: + return False + # sc = list(self.subClassOf) + ec = list(self.equivalentClass) + for _boolclass, p, rdf_list in self.graph.triples_choices( + # type error: Argument 1 to "triples_choices" of "Graph" has incompatible type "Tuple[Any, List[URIRef], None]"; expected "Union[Tuple[List[Node], Node, Node], Tuple[Node, List[Node], Node], Tuple[Node, Node, List[Node]]]" + (self.identifier, [OWL.intersectionOf, OWL.unionOf], None) # type: ignore[arg-type] + ): + ec.append(manchesterSyntax(rdf_list, self.graph, boolean=p)) + for _e in ec: + return False + if self.complementOf: + return False + return True + + def subSumpteeIds(self): # noqa: N802 + for s in self.graph.subjects(predicate=RDFS.subClassOf, object=self.identifier): + yield s + + # def __iter__(self): + # for s in self.graph.subjects( + # predicate=RDFS.subClassOf,object=self.identifier): + # yield Class(s,skipOWLClassMembership=True) + + def __repr__(self): + return self.manchesterClass(full=False, normalization=True) + + def manchesterClass(self, full=False, normalization=True): # noqa: N802 + """ + Returns the Manchester Syntax equivalent for this class + """ + exprs = [] + sc = list(self.subClassOf) + ec = list(self.equivalentClass) + for _boolclass, p, rdf_list in self.graph.triples_choices( + # type error: Argument 1 to "triples_choices" of "Graph" has incompatible type "Tuple[Any, List[URIRef], None]"; expected "Union[Tuple[List[Node], Node, Node], Tuple[Node, List[Node], Node], Tuple[Node, Node, List[Node]]]" + (self.identifier, [OWL.intersectionOf, OWL.unionOf], None) # type: ignore[arg-type] + ): + ec.append(manchesterSyntax(rdf_list, self.graph, boolean=p)) + dc = list(self.disjointWith) + c = self.complementOf + if c: + dc.append(c) + klasskind = "" + label = list(self.graph.objects(self.identifier, RDFS.label)) + # type error: Incompatible types in assignment (expression has type "str", variable has type "List[Node]") + # type error: Unsupported operand types for + ("str" and "Node") + label = label and "(" + label[0] + ")" or "" # type: ignore[assignment, operator] + if sc: + if full: + scjoin = "\n " + else: + scjoin = ", " + nec_statements = [ + isinstance(s, Class) + and isinstance(self.identifier, BNode) + and repr(CastClass(s, self.graph)) + or + # repr(BooleanClass(classOrIdentifier(s), + # operator=None, + # graph=self.graph)) or + manchesterSyntax(classOrIdentifier(s), self.graph) + for s in sc + ] + if nec_statements: + klasskind = "Primitive Type %s" % label + exprs.append( + "SubClassOf: %s" % scjoin.join([str(n) for n in nec_statements]) + ) + if full: + exprs[-1] = "\n " + exprs[-1] + if ec: + nec_suff_statements = [ + isinstance(s, str) + and s + or manchesterSyntax(classOrIdentifier(s), self.graph) + for s in ec + ] + if nec_suff_statements: + klasskind = "A Defined Class %s" % label + exprs.append("EquivalentTo: %s" % ", ".join(nec_suff_statements)) + if full: + exprs[-1] = "\n " + exprs[-1] + if dc: + exprs.append( + "DisjointWith %s\n" + % "\n ".join( + [manchesterSyntax(classOrIdentifier(s), self.graph) for s in dc] + ) + ) + if full: + exprs[-1] = "\n " + exprs[-1] + descr = list(self.graph.objects(self.identifier, RDFS.comment)) + if full and normalization: + klassdescr = ( + klasskind + and "\n ## %s ##" % klasskind + + (descr and "\n %s" % descr[0] or "") + + " . ".join(exprs) + or " . ".join(exprs) + ) + else: + klassdescr = ( + full + and (descr and "\n %s" % descr[0] or "") + or "" + " . ".join(exprs) + ) + return ( + isinstance(self.identifier, BNode) + and "Some Class " + or "Class: %s " % self.qname + ) + klassdescr + + +class OWLRDFListProxy: + def __init__(self, rdf_list, members=None, graph=None): + if graph: + self.graph = graph + members = [] if members is None else members + if rdf_list: + self._rdfList = Collection(self.graph, rdf_list[0]) + for member in members: + if member not in self._rdfList: + self._rdfList.append(classOrIdentifier(member)) + else: + self._rdfList = Collection( + self.graph, BNode(), [classOrIdentifier(m) for m in members] + ) + # type error: "OWLRDFListProxy" has no attribute "identifier" + # type error: "OWLRDFListProxy" has no attribute "_operator" + self.graph.add((self.identifier, self._operator, self._rdfList.uri)) # type: ignore[attr-defined] + + def __eq__(self, other): + """ + Equivalence of boolean class constructors is determined by + equivalence of its members + """ + assert isinstance(other, Class), repr(other) + repr(type(other)) + if isinstance(other, BooleanClass): + length = len(self) + if length != len(other): + return False + else: + for idx in range(length): + if self[idx] != other[idx]: + return False + return True + else: + # type error: "OWLRDFListProxy" has no attribute "identifier" + return self.identifier == other.identifier # type: ignore[attr-defined] + + # Redirect python list accessors to the underlying Collection instance + def __len__(self): + return len(self._rdfList) + + def index(self, item): + return self._rdfList.index(classOrIdentifier(item)) + + def __getitem__(self, key): + return self._rdfList[key] + + def __setitem__(self, key, value): + self._rdfList[key] = classOrIdentifier(value) + + def __delitem__(self, key): + del self._rdfList[key] + + def clear(self): + self._rdfList.clear() + + def __iter__(self): + for item in self._rdfList: + yield item + + def __contains__(self, item): + for i in self._rdfList: + if i == classOrIdentifier(item): + return 1 + return 0 + + def append(self, item): + self._rdfList.append(item) + + def __iadd__(self, other): + self._rdfList.append(classOrIdentifier(other)) + return self + + +class EnumeratedClass(OWLRDFListProxy, Class): + """Class for owl:oneOf forms: + + OWL Abstract Syntax is used + + axiom ::= 'EnumeratedClass(' + classID ['Deprecated'] { annotation } { individualID } ')' + + ```python + >>> exNs = Namespace("http://example.com/") + >>> g = Graph() + >>> g.bind("ex", exNs, override=False) + >>> Individual.factoryGraph = g + >>> ogbujiBros = EnumeratedClass(exNs.ogbujicBros, + ... members=[exNs.chime, + ... exNs.uche, + ... exNs.ejike]) + >>> ogbujiBros # doctest: +SKIP + { ex:chime ex:uche ex:ejike } + >>> col = Collection(g, first( + ... g.objects(predicate=OWL.oneOf, subject=ogbujiBros.identifier))) + >>> sorted([g.qname(item) for item in col]) + ['ex:chime', 'ex:ejike', 'ex:uche'] + >>> print(g.serialize(format='n3')) # doctest: +SKIP + @prefix ex: . + @prefix owl: . + @prefix rdf: . + + ex:ogbujicBros a owl:Class; + owl:oneOf ( ex:chime ex:uche ex:ejike ) . + + + + ``` + """ + + _operator = OWL.oneOf + + def isPrimitive(self): # noqa: N802 + return False + + def __init__(self, identifier=None, members=None, graph=None): + Class.__init__(self, identifier, graph=graph) + members = [] if members is None else members + rdfList = list( # noqa: N806 + self.graph.objects(predicate=OWL.oneOf, subject=self.identifier) + ) + OWLRDFListProxy.__init__(self, rdfList, members) + + def __repr__(self): + """ + Returns the Manchester Syntax equivalent for this class + """ + return manchesterSyntax(self._rdfList.uri, self.graph, boolean=self._operator) + + def serialize(self, graph): + clonedlist = Collection(graph, BNode()) + for cl in self._rdfList: + clonedlist.append(cl) + CastClass(cl, self.graph).serialize(graph) + + graph.add((self.identifier, self._operator, clonedlist.uri)) + for s, p, o in self.graph.triples((self.identifier, None, None)): + if p != self._operator: + graph.add((s, p, o)) + self._serialize(graph) + + +BooleanPredicates = [OWL.intersectionOf, OWL.unionOf] + + +class BooleanClassExtentHelper: + """ + ```python + >>> testGraph = Graph() + >>> Individual.factoryGraph = testGraph + >>> EX = Namespace("http://example.com/") + >>> testGraph.bind("ex", EX, override=False) + >>> fire = Class(EX.Fire) + >>> water = Class(EX.Water) + >>> testClass = BooleanClass(members=[fire, water]) + >>> testClass2 = BooleanClass( + ... operator=OWL.unionOf, members=[fire, water]) + >>> for c in BooleanClass.getIntersections(): + ... print(c) # doctest: +SKIP + ( ex:Fire AND ex:Water ) + >>> for c in BooleanClass.getUnions(): + ... print(c) #doctest: +SKIP + ( ex:Fire OR ex:Water ) + + ``` + """ + + def __init__(self, operator): + self.operator = operator + + def __call__(self, f): + def _getExtent(): # noqa: N802 + for c in Individual.factoryGraph.subjects(self.operator): + yield BooleanClass(c, operator=self.operator) + + return _getExtent + + +class Callable: + def __init__(self, anycallable): + self._callfn = anycallable + + def __call__(self, *args, **kwargs): + return self._callfn(*args, **kwargs) + + +class BooleanClass(OWLRDFListProxy, Class): + """ + See: http://www.w3.org/TR/owl-ref/#Boolean + + owl:complementOf is an attribute of Class, however + """ + + @BooleanClassExtentHelper(OWL.intersectionOf) + @Callable + def getIntersections(): # type: ignore[misc] # noqa: N802 + pass # pragma: no cover + + getIntersections = Callable(getIntersections) # noqa: N815 + + @BooleanClassExtentHelper(OWL.unionOf) + @Callable + def getUnions(): # type: ignore[misc] # noqa: N802 + pass # pragma: no cover + + getUnions = Callable(getUnions) # noqa: N815 + + def __init__( + self, identifier=None, operator=OWL.intersectionOf, members=None, graph=None + ): + if operator is None: + props = [] + for _s, p, _o in graph.triples_choices( + (identifier, [OWL.intersectionOf, OWL.unionOf], None) + ): + props.append(p) + operator = p + assert len(props) == 1, repr(props) + Class.__init__(self, identifier, graph=graph) + assert operator in [OWL.intersectionOf, OWL.unionOf], str(operator) + self._operator = operator + rdf_list = list(self.graph.objects(predicate=operator, subject=self.identifier)) + assert ( + not members or not rdf_list + ), "This is a previous boolean class description." + OWLRDFListProxy.__init__(self, rdf_list, members) + + def copy(self): + """ + Create a copy of this class + """ + copy_of_class = BooleanClass( + operator=self._operator, members=list(self), graph=self.graph + ) + return copy_of_class + + def serialize(self, graph): + clonedlist = Collection(graph, BNode()) + for cl in self._rdfList: + clonedlist.append(cl) + CastClass(cl, self.graph).serialize(graph) + + graph.add((self.identifier, self._operator, clonedlist.uri)) + + for s, p, o in self.graph.triples((self.identifier, None, None)): + if p != self._operator: + graph.add((s, p, o)) + self._serialize(graph) + + def isPrimitive(self): # noqa: N802 + return False + + def changeOperator(self, newOperator): # noqa: N802, N803 + """ + Converts a unionOf / intersectionOf class expression into one + that instead uses the given operator + + ```python + >>> testGraph = Graph() + >>> Individual.factoryGraph = testGraph + >>> EX = Namespace("http://example.com/") + >>> testGraph.bind("ex", EX, override=False) + >>> fire = Class(EX.Fire) + >>> water = Class(EX.Water) + >>> testClass = BooleanClass(members=[fire,water]) + >>> testClass + ( ex:Fire AND ex:Water ) + >>> testClass.changeOperator(OWL.unionOf) + >>> testClass + ( ex:Fire OR ex:Water ) + >>> try: + ... testClass.changeOperator(OWL.unionOf) + ... except Exception as e: + ... print(e) # doctest: +SKIP + The new operator is already being used! + + ``` + """ + assert newOperator != self._operator, "The new operator is already being used!" + self.graph.remove((self.identifier, self._operator, self._rdfList.uri)) + self.graph.add((self.identifier, newOperator, self._rdfList.uri)) + self._operator = newOperator + + def __repr__(self): + """ + Returns the Manchester Syntax equivalent for this class + """ + return manchesterSyntax( + self._rdfList.uri if isinstance(self._rdfList, Collection) else BNode(), + self.graph, + boolean=self._operator, + ) + + def __or__(self, other): + """ + Adds other to the list and returns self + """ + assert self._operator == OWL.unionOf + self._rdfList.append(classOrIdentifier(other)) + return self + + +def AllDifferent(members): # noqa: N802 + """ + TODO: implement this function + + DisjointClasses(' description description { description } ')' + """ + pass # pragma: no cover + + +class Restriction(Class): + """ + ``` + restriction ::= 'restriction(' + datavaluedPropertyID dataRestrictionComponent + { dataRestrictionComponent } ')' + | 'restriction(' individualvaluedPropertyID + individualRestrictionComponent + { individualRestrictionComponent } ')' + ``` + """ + + restrictionKinds = [ # noqa: N815 + OWL.allValuesFrom, + OWL.someValuesFrom, + OWL.hasValue, + OWL.cardinality, + OWL.maxCardinality, + OWL.minCardinality, + ] + + def __init__( + self, + onProperty, # noqa: N803 + graph=None, + allValuesFrom=None, # noqa: N803 + someValuesFrom=None, # noqa: N803 + value=None, + cardinality=None, + maxCardinality=None, # noqa: N803 + minCardinality=None, # noqa: N803 + identifier=None, + ): + graph = Graph() if graph is None else graph + super(Restriction, self).__init__( + identifier, graph=graph, skipOWLClassMembership=True + ) + if ( + self.identifier, + OWL.onProperty, + propertyOrIdentifier(onProperty), + ) not in graph: + graph.add( + (self.identifier, OWL.onProperty, propertyOrIdentifier(onProperty)) + ) + self.onProperty = onProperty + restr_types = [ + (allValuesFrom, OWL.allValuesFrom), + (someValuesFrom, OWL.someValuesFrom), + (value, OWL.hasValue), + (cardinality, OWL.cardinality), + (maxCardinality, OWL.maxCardinality), + (minCardinality, OWL.minCardinality), + ] + valid_restr_props = [(i, oterm) for (i, oterm) in restr_types if i is not None] + if not len(valid_restr_props): + raise ValueError( + "Missing value. One of: allValuesFrom, someValuesFrom," + "value, cardinality, maxCardinality or minCardinality" + "must have a value." + ) + restriction_range, restriction_type = valid_restr_props.pop() + self.restrictionType = restriction_type + if isinstance(restriction_range, Identifier): + self.restrictionRange = restriction_range + elif isinstance(restriction_range, Class): + self.restrictionRange = classOrIdentifier(restriction_range) + else: + # error: Incompatible types in assignment (expression has type "Optional[Identifier]", variable has type "Identifier") + self.restrictionRange = first( # type: ignore[assignment] + # type error: Argument 1 to "first" has incompatible type "Generator[Node, None, None]"; expected "Iterable[Identifier]" + self.graph.objects(self.identifier, restriction_type) # type: ignore[arg-type] + ) + if ( + self.identifier, + restriction_type, + self.restrictionRange, + ) not in self.graph: + self.graph.add((self.identifier, restriction_type, self.restrictionRange)) + assert self.restrictionRange is not None, Class(self.identifier) + if (self.identifier, RDF.type, OWL.Restriction) not in self.graph: + self.graph.add((self.identifier, RDF.type, OWL.Restriction)) + self.graph.remove((self.identifier, RDF.type, OWL.Class)) + + def serialize(self, graph): + """ + ```python + >>> g1 = Graph() + >>> g2 = Graph() + >>> EX = Namespace("http://example.com/") + >>> g1.bind("ex", EX, override=False) + >>> g2.bind("ex", EX, override=False) + >>> Individual.factoryGraph = g1 + >>> prop = Property(EX.someProp, baseType=OWL.DatatypeProperty) + >>> restr1 = (Property( + ... EX.someProp, + ... baseType=OWL.DatatypeProperty)) @ some @ (Class(EX.Foo)) + >>> restr1 # doctest: +SKIP + ( ex:someProp SOME ex:Foo ) + >>> restr1.serialize(g2) + >>> Individual.factoryGraph = g2 + >>> list(Property( + ... EX.someProp,baseType=None).type + ... ) #doctest: +NORMALIZE_WHITESPACE +SKIP + [rdflib.term.URIRef( + 'http://www.w3.org/2002/07/owl#DatatypeProperty')] + + ``` + """ + Property(self.onProperty, graph=self.graph, baseType=None).serialize(graph) + for s, p, o in self.graph.triples((self.identifier, None, None)): + graph.add((s, p, o)) + if p in [OWL.allValuesFrom, OWL.someValuesFrom]: + CastClass(o, self.graph).serialize(graph) + + def isPrimitive(self): # noqa: N802 + return False + + def __hash__(self): + return hash((self.onProperty, self.restrictionRange)) + + def __eq__(self, other): + """ + Equivalence of restrictions is determined by equivalence of the + property in question and the restriction 'range' + """ + assert isinstance(other, Class), repr(other) + repr(type(other)) + if isinstance(other, Restriction): + return ( + other.onProperty == self.onProperty + # type error: "Restriction" has no attribute "restriction_range"; maybe "restrictionRange"? + and other.restriction_range == self.restrictionRange # type: ignore[attr-defined] + ) + else: + return False + + def _get_onproperty(self): + return list( + self.graph.objects(subject=self.identifier, predicate=OWL.onProperty) + )[0] + + def _set_onproperty(self, prop): + if not prop: + return + triple = (self.identifier, OWL.onProperty, propertyOrIdentifier(prop)) + if triple in self.graph: + return + else: + self.graph.set(triple) + + @TermDeletionHelper(OWL.onProperty) + def _del_onproperty(self): + pass # pragma: no cover + + onProperty = property( # noqa: N815 + _get_onproperty, _set_onproperty, _del_onproperty + ) + + def _get_allvaluesfrom(self): + for i in self.graph.objects( + subject=self.identifier, predicate=OWL.allValuesFrom + ): + return Class(i, graph=self.graph) + return None + + def _set_allvaluesfrom(self, other): + if not other: + return + triple = (self.identifier, OWL.allValuesFrom, classOrIdentifier(other)) + if triple in self.graph: + return + else: + self.graph.set(triple) + + @TermDeletionHelper(OWL.allValuesFrom) + def _del_allvaluesfrom(self): + pass # pragma: no cover + + allValuesFrom = property( # noqa: N815 + _get_allvaluesfrom, _set_allvaluesfrom, _del_allvaluesfrom + ) + + def _get_somevaluesfrom(self): + for i in self.graph.objects( + subject=self.identifier, predicate=OWL.someValuesFrom + ): + return Class(i, graph=self.graph) + return None + + def _set_somevaluesfrom(self, other): + if not other: + return + triple = (self.identifier, OWL.someValuesFrom, classOrIdentifier(other)) + if triple in self.graph: + return + else: + self.graph.set(triple) + + @TermDeletionHelper(OWL.someValuesFrom) + def _del_somevaluesfrom(self): + pass # pragma: no cover + + someValuesFrom = property( # noqa: N815 + _get_somevaluesfrom, _set_somevaluesfrom, _del_somevaluesfrom + ) + + def _get_hasvalue(self): + for i in self.graph.objects(subject=self.identifier, predicate=OWL.hasValue): + return Class(i, graph=self.graph) + return None + + def _set_hasvalue(self, other): + if not other: + return + triple = (self.identifier, OWL.hasValue, classOrIdentifier(other)) + if triple in self.graph: + return + else: + self.graph.set(triple) + + @TermDeletionHelper(OWL.hasValue) + def _del_hasvalue(self): + pass # pragma: no cover + + hasValue = property(_get_hasvalue, _set_hasvalue, _del_hasvalue) # noqa: N815 + + def _get_cardinality(self): + for i in self.graph.objects(subject=self.identifier, predicate=OWL.cardinality): + return Class(i, graph=self.graph) + return None + + def _set_cardinality(self, other): + if not other: + return + triple = (self.identifier, OWL.cardinality, classOrTerm(other)) + if triple in self.graph: + return + else: + self.graph.set(triple) + + @TermDeletionHelper(OWL.cardinality) + def _del_cardinality(self): + pass # pragma: no cover + + cardinality = property(_get_cardinality, _set_cardinality, _del_cardinality) + + def _get_maxcardinality(self): + for i in self.graph.objects( + subject=self.identifier, predicate=OWL.maxCardinality + ): + return Class(i, graph=self.graph) + return None + + def _set_maxcardinality(self, other): + if not other: + return + triple = (self.identifier, OWL.maxCardinality, classOrTerm(other)) + if triple in self.graph: + return + else: + self.graph.set(triple) + + @TermDeletionHelper(OWL.maxCardinality) + def _del_maxcardinality(self): + pass # pragma: no cover + + maxCardinality = property( # noqa: N815 + _get_maxcardinality, _set_maxcardinality, _del_maxcardinality + ) + + def _get_mincardinality(self): + for i in self.graph.objects( + subject=self.identifier, predicate=OWL.minCardinality + ): + return Class(i, graph=self.graph) + return None + + def _set_mincardinality(self, other): + if not other: + return + triple = (self.identifier, OWL.minCardinality, classOrIdentifier(other)) + if triple in self.graph: + return + else: + self.graph.set(triple) + + @TermDeletionHelper(OWL.minCardinality) + def _del_mincardinality(self): + pass # pragma: no cover + + minCardinality = property( # noqa: N815 + _get_mincardinality, _set_mincardinality, _del_mincardinality + ) + + def restrictionKind(self): # noqa: N802 + for s, p, o in self.graph.triples_choices( + # type error: Argument 1 to "triples_choices" of "Graph" has incompatible type "Tuple[Any, List[URIRef], None]"; expected "Union[Tuple[List[Node], Node, Node], Tuple[Node, List[Node], Node], Tuple[Node, Node, List[Node]]]" + (self.identifier, self.restrictionKinds, None) # type: ignore[arg-type] + ): + # type error: "Node" has no attribute "split" + return p.split(str(OWL))[-1] # type: ignore[attr-defined] + return None + + def __repr__(self): + """ + Returns the Manchester Syntax equivalent for this restriction + """ + return manchesterSyntax(self.identifier, self.graph) + + +# Infix Operators # + + +some = Infix( + lambda prop, _class: Restriction(prop, graph=_class.graph, someValuesFrom=_class) +) +only = Infix( + lambda prop, _class: Restriction(prop, graph=_class.graph, allValuesFrom=_class) +) +max = Infix( + lambda prop, _class: Restriction(prop, graph=prop.graph, maxCardinality=_class) +) +min = Infix( + lambda prop, _class: Restriction(prop, graph=prop.graph, minCardinality=_class) +) +exactly = Infix( + lambda prop, _class: Restriction(prop, graph=prop.graph, cardinality=_class) +) +value = Infix(lambda prop, _class: Restriction(prop, graph=prop.graph, value=_class)) + +# Unused +PropertyAbstractSyntax = """ +%s( %s { %s } +%s +{ 'super(' datavaluedPropertyID ')'} ['Functional'] +{ domain( %s ) } { range( %s ) } )""" + + +class Property(AnnotatableTerms): + """ + ``` + axiom ::= 'DatatypeProperty(' datavaluedPropertyID ['Deprecated'] + { annotation } + { 'super(' datavaluedPropertyID ')'} ['Functional'] + { 'domain(' description ')' } { 'range(' dataRange ')' } ')' + | 'ObjectProperty(' individualvaluedPropertyID ['Deprecated'] + { annotation } + { 'super(' individualvaluedPropertyID ')' } + [ 'inverseOf(' individualvaluedPropertyID ')' ] [ 'Symmetric' ] + [ 'Functional' | 'InverseFunctional' | + 'Functional' 'InverseFunctional' | + 'Transitive' ] + { 'domain(' description ')' } { 'range(' description ')' } ') + ``` + """ + + def setupVerbAnnotations(self, verb_annotations): # noqa: N802 + """OWL properties map to ACE transitive verbs (TV) + + There are 6 morphological categories that determine the surface form + of an IRI: + + - singular form of a transitive verb (e.g. mans) + - plural form of a transitive verb (e.g. man) + - past participle form a transitive verb (e.g. manned) + - http://attempto.ifi.uzh.ch/ace_lexicon#TV_sg + - http://attempto.ifi.uzh.ch/ace_lexicon#TV_pl + - http://attempto.ifi.uzh.ch/ace_lexicon#TV_vbg + """ + + if isinstance(verb_annotations, tuple): + tv_sgprop, tv_plprop, tv_vbg = verb_annotations + else: + tv_sgprop = verb_annotations + tv_plprop = verb_annotations + tv_vbg = verb_annotations + if tv_sgprop: + self.tv_sgprop.extent = [ + (self.identifier, self.handleAnnotation(tv_sgprop)) + ] + if tv_plprop: + self.tv_plprop.extent = [ + (self.identifier, self.handleAnnotation(tv_plprop)) + ] + if tv_vbg: + self.tv_vbgprop.extent = [(self.identifier, self.handleAnnotation(tv_vbg))] + + def __init__( + self, + identifier=None, + graph=None, + baseType=OWL.ObjectProperty, # noqa: N803 + subPropertyOf=None, # noqa: N803 + domain=None, + range=None, + inverseOf=None, # noqa: N803 + otherType=None, # noqa: N803 + equivalentProperty=None, # noqa: N803 + comment=None, + verbAnnotations=None, # noqa: N803 + nameAnnotation=None, # noqa: N803 + nameIsLabel=False, # noqa: N803 + ): + super(Property, self).__init__(identifier, graph, nameAnnotation, nameIsLabel) + if verbAnnotations: + self.setupVerbAnnotations(verbAnnotations) + + assert not isinstance(self.identifier, BNode) + if baseType is None: + # None give, determine via introspection + self._baseType = first(Individual(self.identifier, graph=self.graph).type) + else: + if (self.identifier, RDF.type, baseType) not in self.graph: + self.graph.add((self.identifier, RDF.type, baseType)) + self._baseType = baseType + self.subPropertyOf = subPropertyOf + self.inverseOf = inverseOf + self.domain = domain + self.range = range + self.comment = [] if comment is None else comment + + def serialize(self, graph): + for fact in self.graph.triples((self.identifier, None, None)): + graph.add(fact) + for p in itertools.chain(self.subPropertyOf, self.inverseOf): + p.serialize(graph) + for c in itertools.chain(self.domain, self.range): + CastClass(c, self.graph).serialize(graph) + + def _get_extent(self, graph=None): + for triple in (graph is None and self.graph or graph).triples( + (None, self.identifier, None) + ): + yield triple + + def _set_extent(self, other): + if not other: + return + for subj, obj in other: + self.graph.add((subj, self.identifier, obj)) + + extent = property(_get_extent, _set_extent) + + def __repr__(self): + rt = [] + if OWL.ObjectProperty in self.type: + rt.append( + "ObjectProperty( %s annotation(%s)" + % (self.qname, first(self.comment) and first(self.comment) or "") + ) + if first(self.inverseOf): + # type error: Item "None" of "Optional[Any]" has no attribute "inverseOf" + two_link_inverse = first(first(self.inverseOf).inverseOf) # type: ignore[union-attr] + if two_link_inverse and two_link_inverse.identifier == self.identifier: + # type error: Item "None" of "Optional[Any]" has no attribute "qname" + inverserepr = first(self.inverseOf).qname # type: ignore[union-attr] + else: + inverserepr = repr(first(self.inverseOf)) + rt.append( + " inverseOf( %s )%s" + % ( + inverserepr, + OWL.SymmetricProperty in self.type and " Symmetric" or "", + ) + ) + for _s, _p, roletype in self.graph.triples_choices( + # type error: Argument 1 to "triples_choices" of "Graph" has incompatible type "Tuple[Any, URIRef, List[URIRef]]"; expected "Union[Tuple[List[Node], Node, Node], Tuple[Node, List[Node], Node], Tuple[Node, Node, List[Node]]]" + ( # type: ignore[arg-type] + self.identifier, + RDF.type, + [ + OWL.FunctionalProperty, + OWL.InverseFunctionalProperty, + OWL.TransitiveProperty, + ], + ) + ): + # type error: "Node" has no attribute "split" + rt.append(str(roletype.split(str(OWL))[-1])) # type: ignore[attr-defined] + else: + rt.append( + "DatatypeProperty( %s %s" + % (self.qname, first(self.comment) and first(self.comment) or "") + ) + for _s, _p, roletype in self.graph.triples( + (self.identifier, RDF.type, OWL.FunctionalProperty) + ): + rt.append(" Functional") + + def canonicalName(term, g): # noqa: N802 + normalized_name = classOrIdentifier(term) + if isinstance(normalized_name, BNode): + return term + elif normalized_name.startswith(XSD): + return str(term) + elif first( + g.triples_choices( + (normalized_name, [OWL.unionOf, OWL.intersectionOf], None) + ) + ): + return repr(term) + else: + return str(term.qname) + + rt.append( + " ".join( + [ + " super( %s )" % canonicalName(super_property, self.graph) + for super_property in self.subPropertyOf + ] + ) + ) + rt.append( + " ".join( + [ + " domain( %s )" % canonicalName(domain, self.graph) + for domain in self.domain + ] + ) + ) + rt.append( + " ".join( + [ + " range( %s )" % canonicalName(range, self.graph) + for range in self.range + ] + ) + ) + # type error: Incompatible types in assignment (expression has type "str", variable has type "List[str]") + rt = "\n".join([expr for expr in rt if expr]) # type: ignore[assignment] + rt += "\n)" + return rt + + def _get_subpropertyof(self): + for anc in self.graph.objects( + subject=self.identifier, predicate=RDFS.subPropertyOf + ): + yield Property(anc, graph=self.graph, baseType=None) + + def _set_subpropertyof(self, other): + if not other: + return + for subproperty in other: + self.graph.add( + (self.identifier, RDFS.subPropertyOf, classOrIdentifier(subproperty)) + ) + + @TermDeletionHelper(RDFS.subPropertyOf) + def _del_subpropertyof(self): + pass # pragma: no cover + + subPropertyOf = property( # noqa: N815 + _get_subpropertyof, _set_subpropertyof, _del_subpropertyof + ) + + def _get_inverseof(self): + for anc in self.graph.objects(subject=self.identifier, predicate=OWL.inverseOf): + yield Property(anc, graph=self.graph, baseType=None) + + def _set_inverseof(self, other): + if not other: + return + self.graph.add((self.identifier, OWL.inverseOf, classOrIdentifier(other))) + + @TermDeletionHelper(OWL.inverseOf) + def _del_inverseof(self): + pass # pragma: no cover + + inverseOf = property(_get_inverseof, _set_inverseof, _del_inverseof) # noqa: N815 + + def _get_domain(self): + for dom in self.graph.objects(subject=self.identifier, predicate=RDFS.domain): + yield Class(dom, graph=self.graph) + + def _set_domain(self, other): + if not other: + return + if isinstance(other, (Individual, Identifier)): + self.graph.add((self.identifier, RDFS.domain, classOrIdentifier(other))) + else: + for dom in other: + self.graph.add((self.identifier, RDFS.domain, classOrIdentifier(dom))) + + @TermDeletionHelper(RDFS.domain) + def _del_domain(self): + pass # pragma: no cover + + domain = property(_get_domain, _set_domain, _del_domain) + + def _get_range(self): + for ran in self.graph.objects(subject=self.identifier, predicate=RDFS.range): + yield Class(ran, graph=self.graph) + + def _set_range(self, ranges): + if not ranges: + return + if isinstance(ranges, (Individual, Identifier)): + self.graph.add((self.identifier, RDFS.range, classOrIdentifier(ranges))) + else: + for range in ranges: + self.graph.add((self.identifier, RDFS.range, classOrIdentifier(range))) + + @TermDeletionHelper(RDFS.range) + def _del_range(self): + pass # pragma: no cover + + range = property(_get_range, _set_range, _del_range) + + def replace(self, other): + # extension = [] + for s, _p, o in self.extent: + self.graph.add((s, propertyOrIdentifier(other), o)) + self.graph.remove((None, self.identifier, None)) + + +def CommonNSBindings(graph, additionalNS=None): # noqa: N802, N803 + """ + Takes a graph and binds the common namespaces (rdf,rdfs, & owl) + """ + additional_ns = {} if additionalNS is None else additionalNS + namespace_manager = NamespaceManager(graph) + namespace_manager.bind("rdfs", RDFS) + namespace_manager.bind("rdf", RDF) + namespace_manager.bind("owl", OWL) + for prefix, uri in list(additional_ns.items()): + namespace_manager.bind(prefix, uri, override=False) + graph.namespace_manager = namespace_manager diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/extras/shacl.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/extras/shacl.py new file mode 100644 index 0000000000000000000000000000000000000000..925d6fee4103b48e3ed68953a183459340ffb209 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/extras/shacl.py @@ -0,0 +1,221 @@ +""" +Utilities for interacting with SHACL Shapes Graphs more easily. +""" + +from __future__ import annotations + +from typing import TYPE_CHECKING, Optional, Union + +from rdflib import BNode, Graph, Literal, URIRef, paths +from rdflib.collection import Collection +from rdflib.namespace import RDF, SH +from rdflib.paths import Path +from rdflib.term import Node + +if TYPE_CHECKING: + from rdflib.term import IdentifiedNode + + +class SHACLPathError(Exception): + pass + + +# Map the variable length path operators to the corresponding SHACL path predicates +_PATH_MOD_TO_PRED = { + paths.ZeroOrMore: SH.zeroOrMorePath, + paths.OneOrMore: SH.oneOrMorePath, + paths.ZeroOrOne: SH.zeroOrOnePath, +} + + +# This implementation is roughly based on +# pyshacl.helper.sparql_query_helper::SPARQLQueryHelper._shacl_path_to_sparql_path +def parse_shacl_path( + shapes_graph: Graph, + path_identifier: Node, +) -> Union[URIRef, Path]: + """ + Parse a valid SHACL path (e.g. the object of a triple with predicate sh:path) + from a [`Graph`][rdflib.graph.Graph] as a [`URIRef`][rdflib.term.URIRef] if the path + is simply a predicate or a [`Path`][rdflib.paths.Path] otherwise. + + Args: + shapes_graph: A [`Graph`][rdflib.graph.Graph] containing the path to be parsed + path_identifier: A [`Node`][rdflib.term.Node] of the path + + Returns: + A [`URIRef`][rdflib.term.URIRef] or a [`Path`][rdflib.paths.Path] + """ + path: Optional[Union[URIRef, Path]] = None + + # Literals are not allowed. + if isinstance(path_identifier, Literal): + raise TypeError("Literals are not a valid SHACL path.") + + # If a path is a URI, that's the whole path. + elif isinstance(path_identifier, URIRef): + if path_identifier == RDF.nil: + raise SHACLPathError( + "A list of SHACL Paths must contain at least two path items." + ) + path = path_identifier + + # Handle Sequence Paths + elif shapes_graph.value(path_identifier, RDF.first) is not None: + sequence = list(shapes_graph.items(path_identifier)) + if len(sequence) < 2: + raise SHACLPathError( + "A list of SHACL Sequence Paths must contain at least two path items." + ) + path = paths.SequencePath( + *(parse_shacl_path(shapes_graph, path) for path in sequence) + ) + + # Handle sh:inversePath + elif inverse_path := shapes_graph.value(path_identifier, SH.inversePath): + path = paths.InvPath(parse_shacl_path(shapes_graph, inverse_path)) + + # Handle sh:alternativePath + elif alternative_path := shapes_graph.value(path_identifier, SH.alternativePath): + alternatives = list(shapes_graph.items(alternative_path)) + if len(alternatives) < 2: + raise SHACLPathError( + "List of SHACL alternate paths must have at least two path items." + ) + path = paths.AlternativePath( + *( + parse_shacl_path(shapes_graph, alternative) + for alternative in alternatives + ) + ) + + # Handle sh:zeroOrMorePath + elif zero_or_more_path := shapes_graph.value(path_identifier, SH.zeroOrMorePath): + path = paths.MulPath(parse_shacl_path(shapes_graph, zero_or_more_path), "*") + + # Handle sh:oneOrMorePath + elif one_or_more_path := shapes_graph.value(path_identifier, SH.oneOrMorePath): + path = paths.MulPath(parse_shacl_path(shapes_graph, one_or_more_path), "+") + + # Handle sh:zeroOrOnePath + elif zero_or_one_path := shapes_graph.value(path_identifier, SH.zeroOrOnePath): + path = paths.MulPath(parse_shacl_path(shapes_graph, zero_or_one_path), "?") + + # Raise error if none of the above options were found + elif path is None: + raise SHACLPathError(f"Cannot parse {repr(path_identifier)} as a SHACL Path.") + + return path + + +def _build_path_component( + graph: Graph, path_component: URIRef | Path +) -> IdentifiedNode: + """ + Helper method that implements the recursive component of SHACL path + triple construction. + + Args: + graph: A [`Graph`][rdflib.graph.Graph] into which to insert triples + graph_component: A [`URIRef`][rdflib.term.URIRef] or + [`Path`][rdflib.paths.Path] that is part of a path expression + + Returns: + The [`IdentifiedNode`][rdflib.term.IdentifiedNode] of the resource in the + graph that corresponds to the provided path_component + """ + # Literals or other types are not allowed + if not isinstance(path_component, (URIRef, Path)): + raise TypeError( + f"Objects of type {type(path_component)} are not valid " + + "components of a SHACL path." + ) + + # If the path component is a URI, return it + elif isinstance(path_component, URIRef): + return path_component + # Otherwise, the path component is represented as a blank node + bnode = BNode() + + # Handle Sequence Paths + if isinstance(path_component, paths.SequencePath): + # Sequence paths are a Collection directly with at least two items + if len(path_component.args) < 2: + raise SHACLPathError( + "A list of SHACL Sequence Paths must contain at least two path items." + ) + Collection( + graph, + bnode, + [_build_path_component(graph, arg) for arg in path_component.args], + ) + + # Handle Inverse Paths + elif isinstance(path_component, paths.InvPath): + graph.add( + (bnode, SH.inversePath, _build_path_component(graph, path_component.arg)) + ) + + # Handle Alternative Paths + elif isinstance(path_component, paths.AlternativePath): + # Alternative paths are a Collection but referenced by sh:alternativePath + # with at least two items + if len(path_component.args) < 2: + raise SHACLPathError( + "List of SHACL alternate paths must have at least two path items." + ) + coll = Collection( + graph, + BNode(), + [_build_path_component(graph, arg) for arg in path_component.args], + ) + graph.add((bnode, SH.alternativePath, coll.uri)) + + # Handle Variable Length Paths + elif isinstance(path_component, paths.MulPath): + # Get the predicate corresponding to the path modifiier + pred = _PATH_MOD_TO_PRED.get(path_component.mod) + if pred is None: + raise SHACLPathError(f"Unknown path modifier {path_component.mod}") + graph.add((bnode, pred, _build_path_component(graph, path_component.path))) + + # Return the blank node created for the provided path_component + return bnode + + +def build_shacl_path( + path: URIRef | Path, target_graph: Graph | None = None +) -> tuple[IdentifiedNode, Graph | None]: + """ + Build the SHACL Path triples for a path given by a [`URIRef`][rdflib.term.URIRef] for + simple paths or a [`Path`][rdflib.paths.Path] for complex paths. + + Returns an [`IdentifiedNode`][rdflib.term.IdentifiedNode] for the path (which should be + the object of a triple with predicate `sh:path`) and the graph into which any + new triples were added. + + Args: + path: A [`URIRef`][rdflib.term.URIRef] or a [`Path`][rdflib.paths.Path] + target_graph: Optionally, a [`Graph`][rdflib.graph.Graph] into which to put + constructed triples. If not provided, a new graph will be created + + Returns: + A (path_identifier, graph) tuple where: + - path_identifier: If path is a [`URIRef`][rdflib.term.URIRef], this is simply + the provided path. If path is a [`Path`][rdflib.paths.Path], this is + the [`BNode`][rdflib.term.BNode] corresponding to the root of the SHACL + path expression added to the graph. + - graph: None if path is a [`URIRef`][rdflib.term.URIRef] (as no new triples + are constructed). If path is a [`Path`][rdflib.paths.Path], this is either the + target_graph provided or a new graph into which the path triples were added. + """ + # If a path is a URI, that's the whole path. No graph needs to be constructed. + if isinstance(path, URIRef): + return path, None + + # Create a graph if one was not provided + if target_graph is None: + target_graph = Graph() + + # Recurse through the path to build the graph representation + return _build_path_component(target_graph, path), target_graph diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_BRICK.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_BRICK.py new file mode 100644 index 0000000000000000000000000000000000000000..20c60fc1ca97234ba9bdb4268901b2341517eeea --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_BRICK.py @@ -0,0 +1,1592 @@ +from rdflib.namespace import DefinedNamespace, Namespace +from rdflib.term import URIRef + + +class BRICK(DefinedNamespace): + """ + Brick Ontology classes, properties and entity properties. See https://brickschema.org/ + for more information. + + Generated from: https://github.com/BrickSchema/Brick/releases/download/nightly/Brick.ttl + Date: 2021-09-22T14:32:56 + """ + + # http://www.w3.org/2002/07/owl#Class + AED: URIRef + AHU: URIRef # Assembly consisting of sections containing a fan or fans and other necessary equipment to perform one or more of the following functions: circulating, filtration, heating, cooling, heat recovery, humidifying, dehumidifying, and mixing of air. Is usually connected to an air-distribution system. + Ablutions_Room: URIRef # A room for performing cleansing rituals before prayer + Absorption_Chiller: URIRef # A chiller that utilizes a thermal or/and chemical process to produce the refrigeration effect necessary to provide chilled water. There is no mechanical compression of the refrigerant taking place within the machine, as occurs within more traditional vapor compression type chillers. + Acceleration_Time_Setpoint: URIRef + Access_Control_Equipment: URIRef + Access_Reader: URIRef + Active_Chilled_Beam: URIRef # A Chilled Beam with an integral primary air connection that induces air flow through the device. + Active_Power_Sensor: URIRef # Measures the portion of power that, averaged over a complete cycle of the AC waveform, results in net transfer of energy in one direction + Adjust_Sensor: URIRef # Measures user-provided adjustment of some value + Air: URIRef # the invisible gaseous substance surrounding the earth, a mixture mainly of oxygen and nitrogen. + Air_Alarm: URIRef + Air_Differential_Pressure_Sensor: ( + URIRef # Measures the difference in pressure between two regions of air + ) + Air_Differential_Pressure_Setpoint: URIRef # Sets the target air differential pressure between an upstream and downstream point in a air duct or conduit + Air_Diffuser: URIRef # A device that is a component of the air distribution system that controls the delivery of conditioned and/or ventilating air into a room + Air_Enthalpy_Sensor: URIRef # Measures the total heat content of air + Air_Flow_Deadband_Setpoint: URIRef # Sets the size of a deadband of air flow + Air_Flow_Demand_Setpoint: URIRef # Sets the rate of air flow required for a process + Air_Flow_Loss_Alarm: URIRef # An alarm that indicates loss in air flow. + Air_Flow_Sensor: URIRef # Measures the rate of flow of air + Air_Flow_Setpoint: URIRef # Sets air flow + Air_Flow_Setpoint_Limit: URIRef # A parameter that places a lower or upper bound on the range of permitted values of a Air_Flow_Setpoint. + Air_Grains_Sensor: URIRef # Measures the mass of water vapor in air + Air_Handler_Unit: URIRef # Assembly consisting of sections containing a fan or fans and other necessary equipment to perform one or more of the following functions: circulating, filtration, heating, cooling, heat recovery, humidifying, dehumidifying, and mixing of air. Is usually connected to an air-distribution system. + Air_Handling_Unit: URIRef + Air_Humidity_Setpoint: URIRef + Air_Loop: URIRef # The set of connected equipment serving one path of air + Air_Plenum: URIRef # A component of the HVAC the receives air from the air handling unit or room to distribute or exhaust to or from the building + Air_Quality_Sensor: URIRef # A sensor which provides a measure of air quality + Air_Static_Pressure_Step_Parameter: URIRef + Air_System: URIRef # The equipment, distribution systems and terminals that introduce or exhaust, either collectively or individually, the air into and from the building + Air_Temperature_Alarm: URIRef # An alarm that indicates the off-normal conditions associated with the temperature of air. + Air_Temperature_Integral_Time_Parameter: URIRef + Air_Temperature_Sensor: URIRef # Measures the temperature of air + Air_Temperature_Setpoint: URIRef # Sets temperature of air + Air_Temperature_Setpoint_Limit: URIRef # A parameter that places a lower or upper bound on the range of permitted values of a Air_Temperature_Setpoint. + Air_Temperature_Step_Parameter: URIRef + Air_Wet_Bulb_Temperature_Sensor: URIRef + Alarm: URIRef # Alarm points are signals (either audible or visual) that alert an operator to an off-normal condition which requires some form of corrective action + Alarm_Delay_Parameter: URIRef # A parameter determining how long to delay an alarm after sufficient conditions have been met + Angle_Sensor: URIRef # Measues the planar angle of some phenomenon + Auditorium: URIRef # A space for performances or larger gatherings + Automated_External_Defibrillator: URIRef + Automatic_Mode_Command: URIRef # Controls whether or not a device or controller is operating in "Automatic" mode + Availability_Status: URIRef # Indicates if a piece of equipment, system, or functionality is available for operation + Average_Cooling_Demand_Sensor: URIRef # Measures the average power consumed by a cooling process as the amount of power consumed over some interval + Average_Discharge_Air_Flow_Sensor: ( + URIRef # The computed average flow of discharge air over some interval + ) + Average_Exhaust_Air_Static_Pressure_Sensor: URIRef # The computed average static pressure of air in exhaust regions of an HVAC system over some period of time + Average_Heating_Demand_Sensor: URIRef # Measures the average power consumed by a heating process as the amount of power consumed over some interval + Average_Supply_Air_Flow_Sensor: ( + URIRef # The computed average flow of supply air over some interval + ) + Average_Zone_Air_Temperature_Sensor: URIRef # The computed average temperature of air in a zone, over some period of time + Baseboard_Radiator: URIRef # Steam, hydronic, or electric heating device located at or near the floor. + Basement: URIRef # The floor of a building which is partly or entirely below ground level. + Battery: URIRef # A container that stores chemical energy that can be converted into electricity and used as a source of power + Battery_Energy_Storage_System: URIRef # A collection of batteries that provides energy storage, along with their supporting equipment + Battery_Room: URIRef # A room used to hold batteries for backup power + Battery_Voltage_Sensor: URIRef # Measures the capacity of a battery + Bench_Space: URIRef # For areas of play in a stadium, the area for partcipants and referees by the side of the field + Blowdown_Water: URIRef # Water expelled from a system to remove mineral build up + Boiler: URIRef # A closed, pressure vessel that uses fuel or electricity for heating water or other fluids to supply steam or hot water for heating, humidification, or other applications. + Booster_Fan: URIRef # Fan activated to increase airflow beyond what is provided by the default configuration + Box_Mode_Command: URIRef + Break_Room: URIRef # A space for people to relax while not working + Breaker_Panel: URIRef # Breaker Panel distributes power into various end-uses. + Breakroom: URIRef # A space for people to relax while not working + Broadcast_Room: ( + URIRef # A space to organize and manage a broadcast. Separate from studio + ) + Building: URIRef # An independent unit of the built environment with a characteristic spatial structure, intended to serve at least one function or user activity [ISO 12006-2:2013] + Building_Air: URIRef # air contained within a building + Building_Air_Humidity_Setpoint: URIRef # Setpoint for humidity in a building + Building_Air_Static_Pressure_Sensor: ( + URIRef # The static pressure of air within a building + ) + Building_Air_Static_Pressure_Setpoint: ( + URIRef # Sets static pressure of the entire building + ) + Building_Chilled_Water_Meter: URIRef # A meter that measures the usage or consumption of chilled water of a whole building + Building_Electrical_Meter: URIRef # A meter that measures the usage or consumption of electricity of a whole building + Building_Gas_Meter: URIRef # A meter that measures the usage or consumption of gas of a whole building + Building_Hot_Water_Meter: URIRef # A meter that measures the usage or consumption of hot water of a whole building + Building_Meter: URIRef # A meter that measures usage or consumption of some media for a whole building + Building_Water_Meter: URIRef # A meter that measures the usage or consumption of water of a whole building + Bus_Riser: URIRef # Bus Risers are commonly fed from a switchgear and rise up through a series of floors to the main power distribution source for each floor. + Bypass_Air: URIRef # air in a bypass duct, used to relieve static pressure + Bypass_Air_Flow_Sensor: URIRef # Measures the rate of flow of bypass air + Bypass_Air_Humidity_Setpoint: URIRef # Humidity setpoint for bypass air + Bypass_Command: URIRef + Bypass_Valve: URIRef # A type of valve installed in a bypass pipeline + Bypass_Water: URIRef # Water that circumvents a piece of equipment or system + Bypass_Water_Flow_Sensor: URIRef # Measures the rate of flow of bypass water + Bypass_Water_Flow_Setpoint: URIRef # Sets the target flow rate of bypass water + CAV: URIRef + CO: URIRef # Carbon Monoxide in the vapor phase + CO2: URIRef # Carbon Dioxide in the vapor phase + CO2_Alarm: URIRef # An alarm that indicates the off-normal conditions associated with the presence of carbon dioxide. + CO2_Differential_Sensor: ( + URIRef # Measures the difference between CO2 levels of inside and outside air + ) + CO2_Level_Sensor: URIRef # Measures the concentration of CO2 in air + CO2_Sensor: URIRef # Measures properties of CO2 in air + CO2_Setpoint: URIRef # Sets some property of CO2 + CO_Differential_Sensor: URIRef + CO_Level_Sensor: URIRef # Measures the concentration of CO + CO_Sensor: URIRef # Measures properties of CO + CRAC: URIRef + Cafeteria: URIRef # A space to serve food and beverages + Camera: URIRef + Capacity_Sensor: URIRef + Ceiling_Fan: URIRef # A fan installed on the ceiling of a room for the purpose of air circulation + Centrifugal_Chiller: URIRef # A chiller that uses the vapor compression cycle to chill water. It throws off the heat collected from the chilled water plus the heat from the compressor to a water loop + Change_Filter_Alarm: URIRef # An alarm that indicates that a filter must be changed + Chilled_Beam: URIRef # A device with an integrated coil that performs sensible heating of a space via circulation of room air. Chilled Beams are not designed to perform latent cooling; see Induction Units. Despite their name, Chilled Beams may perform heating or cooling of a space depending on their configuration. + Chilled_Water: URIRef # water used as a cooling medium (particularly in air-conditioning systems or in processes) at below ambient temperature. + Chilled_Water_Coil: URIRef # A cooling element made of pipe or tube that removes heat from equipment, machines or airflows that is filled with chilled water. + Chilled_Water_Differential_Pressure_Deadband_Setpoint: ( + URIRef # Sets the size of a deadband of differential pressure of chilled water + ) + Chilled_Water_Differential_Pressure_Integral_Time_Parameter: URIRef + Chilled_Water_Differential_Pressure_Load_Shed_Reset_Status: URIRef + Chilled_Water_Differential_Pressure_Load_Shed_Setpoint: URIRef + Chilled_Water_Differential_Pressure_Load_Shed_Status: URIRef + Chilled_Water_Differential_Pressure_Proportional_Band_Parameter: URIRef + Chilled_Water_Differential_Pressure_Sensor: URIRef # Measures the difference in water pressure on either side of a chilled water valve + Chilled_Water_Differential_Pressure_Setpoint: URIRef # Sets the target water differential pressure between an upstream and downstream point in a water pipe or conduit used to carry chilled water + Chilled_Water_Differential_Pressure_Step_Parameter: URIRef + Chilled_Water_Differential_Temperature_Sensor: URIRef # Measures the difference in temperature between the entering water to the chiller or other water cooling device and leaving water from the same chiller or other water cooling device + Chilled_Water_Discharge_Flow_Sensor: ( + URIRef # Measures the rate of flow of chilled discharge water + ) + Chilled_Water_Discharge_Flow_Setpoint: ( + URIRef # Sets the target flow rate of chilled discharge water + ) + Chilled_Water_Flow_Sensor: ( + URIRef # Measures the rate of flow in a chilled water circuit + ) + Chilled_Water_Flow_Setpoint: URIRef # Sets the target flow rate of chilled water + Chilled_Water_Loop: URIRef # A collection of equipment that transport and regulate chilled water among each other + Chilled_Water_Meter: ( + URIRef # A meter that measures the usage or consumption of chilled water + ) + Chilled_Water_Pump: URIRef # A pump that performs work on chilled water; typically part of a chilled water system + Chilled_Water_Pump_Differential_Pressure_Deadband_Setpoint: URIRef # Sets the size of a deadband of differential pressure of chilled water in a chilled water pump + Chilled_Water_Return_Flow_Sensor: ( + URIRef # Measures the rate of flow of chilled return water + ) + Chilled_Water_Return_Temperature_Sensor: URIRef # Measures the temperature of chilled water that is returned to a cooling tower + Chilled_Water_Static_Pressure_Setpoint: ( + URIRef # Sets static pressure of chilled water + ) + Chilled_Water_Supply_Flow_Sensor: ( + URIRef # Measures the rate of flow of chilled supply water + ) + Chilled_Water_Supply_Flow_Setpoint: ( + URIRef # Sets the target flow rate of chilled supply water + ) + Chilled_Water_Supply_Temperature_Sensor: URIRef # Measures the temperature of chilled water that is supplied from a chiller + Chilled_Water_System: URIRef # The equipment, devices and conduits that handle the production and distribution of chilled water in a building + Chilled_Water_System_Enable_Command: ( + URIRef # Enables operation of the chilled water system + ) + Chilled_Water_Temperature_Sensor: ( + URIRef # Measures the temperature of chilled water + ) + Chilled_Water_Temperature_Setpoint: URIRef # Sets the temperature of chilled water + Chilled_Water_Valve: URIRef # A valve that modulates the flow of chilled water + Chiller: URIRef # Refrigerating machine used to transfer heat between fluids. Chillers are either direct expansion with a compressor or absorption type. + Class: URIRef + Close_Limit: URIRef # A parameter that places a lower or upper bound on the range of permitted values of a Close_Setpoint. + Coil: URIRef # Cooling or heating element made of pipe or tube that may or may not be finned and formed into helical or serpentine shape (ASHRAE Dictionary) + Cold_Box: URIRef # in a gas separation unit, the insulated section that contains the low-temperature heat exchangers and distillation columns. + Coldest_Zone_Air_Temperature_Sensor: URIRef # The zone temperature that is coldest; drives the supply temperature of hot air. A computed value rather than a physical sensor. Also referred to as a 'Lowest Zone Air Temperature Sensor' + Collection: URIRef + Collection_Basin_Water: URIRef # Water transiently collected and directed to the sump or pump suction line, typically integral with a cooling tower + Collection_Basin_Water_Heater: URIRef # Basin heaters prevent cold water basin freeze-up, e.g. in cooling towers, closed circuit fluid coolers, or evaporative condensers + Collection_Basin_Water_Level_Alarm: URIRef # An alarm that indicates a high or low level of water in the collection basin, e.g. within a Cooling_Tower + Collection_Basin_Water_Level_Sensor: URIRef # Measures the level of the water in the collection basin, e.g. within a Cooling_Tower + Collection_Basin_Water_Temperature_Sensor: URIRef # Measures the temperature of the water in the collection basin, e.g. within a Cooling_Tower + Command: URIRef # A Command is an output point that directly determines the behavior of equipment and/or affects relevant operational points. + Common_Space: ( + URIRef # A class of spaces that are used by multiple people at the same time + ) + Communication_Loss_Alarm: URIRef # An alarm that indicates a loss of communication e.g. with a device or controller + Compressor: URIRef # (1) device for mechanically increasing the pressure of a gas. (2) often described as being either open, hermetic, or semihermetic to describe how the compressor and motor drive is situated in relation to the gas or vapor being compressed. Types include centrifugal, axial flow, reciprocating, rotary screw, rotary vane, scroll, or diaphragm. 1. device for mechanically increasing the pressure of a gas. 2. specific machine, with or without accessories, for compressing refrigerant vapor. + Computer_Room_Air_Conditioning: URIRef # A device that monitors and maintains the temperature, air distribution and humidity in a network room or data center. + Concession: URIRef # A space to sell food and beverages. Usually embedded in a larger space and does not include a space where people consume their purchases + Condensate_Leak_Alarm: ( + URIRef # An alarm that indicates a leak of condensate from a cooling system + ) + Condenser: URIRef # A heat exchanger in which the primary heat transfer vapor changes its state to a liquid phase. + Condenser_Heat_Exchanger: URIRef # A heat exchanger in which the primary heat transfer vapor changes its state to a liquid phase. + Condenser_Water: URIRef # Water used used to remove heat through condensation + Condenser_Water_Bypass_Valve: ( + URIRef # A valve installed in a bypass line of a condenser water loop + ) + Condenser_Water_Isolation_Valve: ( + URIRef # An isolation valve installed in the condenser water loop + ) + Condenser_Water_Pump: URIRef # A pump that is part of a condenser system; the pump circulates condenser water from the chiller back to the cooling tower + Condenser_Water_System: URIRef # A heat rejection system consisting of (typically) cooling towers, condenser water pumps, chillers and the piping connecting the components + Condenser_Water_Temperature_Sensor: ( + URIRef # Measures the temperature of condenser water + ) + Condenser_Water_Valve: URIRef # A valve that modulates the flow of condenser water + Condensing_Natural_Gas_Boiler: URIRef # A closed, pressure vessel that uses natural gas and heat exchanger that capture and reuse any latent heat for heating water or other fluids to supply steam or hot water for heating, humidification, or other applications. + Conductivity_Sensor: URIRef # Measures electrical conductance + Conference_Room: URIRef # A space dedicated in which to hold a meetings + Constant_Air_Volume_Box: URIRef # A terminal unit for which supply air flow rate is constant and the supply air temperature is varied to meet thermal load + Contact_Sensor: URIRef # Senses or detects contact, such as for determining if a door is closed. + Control_Room: URIRef # A space from which operations are managed + Cooling_Coil: URIRef # A cooling element made of pipe or tube that removes heat from equipment, machines or airflows. Typically filled with either refrigerant or cold water. + Cooling_Command: URIRef # Controls the amount of cooling to be delivered (typically as a proportion of total cooling output) + Cooling_Demand_Sensor: URIRef # Measures the amount of power consumed by a cooling process; typically found by multiplying the tonnage of a unit (e.g. RTU) by the efficiency rating in kW/ton + Cooling_Demand_Setpoint: URIRef # Sets the rate required for cooling + Cooling_Discharge_Air_Flow_Setpoint: URIRef # Sets discharge air flow for cooling + Cooling_Discharge_Air_Temperature_Deadband_Setpoint: ( + URIRef # Sets the size of a deadband of temperature of cooling discharge air + ) + Cooling_Discharge_Air_Temperature_Integral_Time_Parameter: URIRef + Cooling_Discharge_Air_Temperature_Proportional_Band_Parameter: URIRef + Cooling_Start_Stop_Status: URIRef + Cooling_Supply_Air_Flow_Setpoint: URIRef # Sets supply air flow rate for cooling + Cooling_Supply_Air_Temperature_Deadband_Setpoint: ( + URIRef # Sets the size of a deadband of temperature of supply air for cooling + ) + Cooling_Supply_Air_Temperature_Integral_Time_Parameter: URIRef + Cooling_Supply_Air_Temperature_Proportional_Band_Parameter: URIRef + Cooling_Temperature_Setpoint: URIRef # Sets temperature for cooling + Cooling_Tower: URIRef # A cooling tower is a heat rejection device that rejects waste heat to the atmosphere through the cooling of a water stream to a lower temperature. Cooling towers may either use the evaporation of water to remove process heat and cool the working fluid to near the wet-bulb air temperature or, in the case of closed circuit dry cooling towers, rely solely on air to cool the working fluid to near the dry-bulb air temperature. + Cooling_Tower_Fan: URIRef # A fan that pulls air through a cooling tower and across the louvers where the water falls to aid in heat exchange by the process of evaporation + Cooling_Valve: URIRef # A valve that controls air temperature by modulating the amount of cold water flowing through a cooling coil + Copy_Room: URIRef # A room set aside for common office equipment, including printers and copiers + Core_Temperature_Sensor: URIRef # Measures the internal temperature of the radiant layer at the heat source or sink level of the radiant heating and cooling HVAC system. + Core_Temperature_Setpoint: URIRef # Sets temperature for the core, i.e. the temperature at the heat source or sink level, of the radiant panel. + Cubicle: URIRef # A smaller space set aside for an individual, but not with a door and without full-height walls + Current_Imbalance_Sensor: URIRef # A sensor which measures the current difference (imbalance) between phases of an electrical system + Current_Limit: URIRef # A parameter that places a lower or upper bound on the range of permitted values of a Current_Setpoint. + Current_Output_Sensor: URIRef # Senses the amperes of electrical current produced as output by a device + Current_Sensor: ( + URIRef # Senses the amperes of electrical current passing through the sensor + ) + Curtailment_Override_Command: URIRef + Cycle_Alarm: URIRef # An alarm that indicates off-normal conditions associated with HVAC cycles + DC_Bus_Voltage_Sensor: URIRef # Measures the voltage across a DC bus + DOAS: URIRef # See Dedicated_Outdoor_Air_System_Unit + Damper: URIRef # Element inserted into an air-distribution system or element of an air-distribution system permitting modification of the air resistance of the system and consequently changing the airflow rate or shutting off the airflow. + Damper_Command: URIRef # Controls properties of dampers + Damper_Position_Command: ( + URIRef # Controls the position (the degree of openness) of a damper + ) + Damper_Position_Sensor: URIRef # Measures the current position of a damper in terms of the percent of fully open + Damper_Position_Setpoint: URIRef # Sets the position of damper + Deadband_Setpoint: URIRef # Sets the size of a deadband + Deceleration_Time_Setpoint: URIRef + Dedicated_Outdoor_Air_System_Unit: URIRef # A device that conditions and delivers 100% outdoor air to its assigned spaces. It decouples air-conditioning of the outdoor air, usually used to provide minimum outdoor air ventilation, from conditioning of the internal loads. + Dehumidification_Start_Stop_Status: URIRef + Deionised_Water_Conductivity_Sensor: ( + URIRef # Measures the electrical conductance of deionised water + ) + Deionised_Water_Level_Sensor: ( + URIRef # Measures the height/level of deionised water in some container + ) + Deionized_Water: URIRef # Water which has been purified by removing its ions (constituting the majority of non-particulate contaminants) + Deionized_Water_Alarm: URIRef # An alarm that indicates deionized water leaks. + Delay_Parameter: URIRef # A parameter determining how long to delay a subsequent action to take place after a received signal + Demand_Sensor: URIRef # Measures the amount of power consumed by the use of some process; typically found by multiplying the tonnage of a unit (e.g. RTU) by the efficiency rating in kW/ton + Demand_Setpoint: URIRef # Sets the rate required for a process + Derivative_Gain_Parameter: URIRef + Derivative_Time_Parameter: URIRef + Detention_Room: ( + URIRef # A space for the temporary involuntary confinement of people + ) + Dew_Point_Setpoint: URIRef # Sets dew point + Dewpoint_Sensor: URIRef # Senses the dewpoint temperature . Dew point is the temperature to which air must be cooled to become saturated with water vapor + Differential_Air_Temperature_Setpoint: ( + URIRef # Sets temperature of differential air + ) + Differential_Pressure_Bypass_Valve: URIRef # A 2-way, self contained proportional valve with an integral differential pressure adjustment setting. + Differential_Pressure_Deadband_Setpoint: ( + URIRef # Sets the size of a deadband of differential pressure + ) + Differential_Pressure_Integral_Time_Parameter: URIRef + Differential_Pressure_Load_Shed_Status: URIRef + Differential_Pressure_Proportional_Band: URIRef + Differential_Pressure_Sensor: ( + URIRef # Measures the difference between two applied pressures + ) + Differential_Pressure_Setpoint: URIRef # Sets differential pressure + Differential_Pressure_Setpoint_Limit: URIRef # A parameter that places a lower or upper bound on the range of permitted values of a Differential_Pressure_Setpoint. + Differential_Pressure_Step_Parameter: URIRef + Differential_Speed_Sensor: URIRef + Differential_Speed_Setpoint: URIRef # Sets differential speed + Differential_Supply_Return_Water_Temperature_Sensor: URIRef # Measures the difference in temperature between return and supply water of water a circuit + Dimmer: URIRef # A switch providing continuous control over all or part of a lighting installation; typically potentiometer-based + Direct_Expansion_Cooling_Coil: URIRef + Direct_Expansion_Heating_Coil: URIRef + Direction_Command: URIRef # Commands that affect the direction of some phenomenon + Direction_Sensor: ( + URIRef # Measures the direction in degrees in which a phenomenon is occurring + ) + Direction_Status: URIRef # Indicates which direction a device is operating in + Disable_Command: URIRef # Commands that disable functionality + Disable_Differential_Enthalpy_Command: ( + URIRef # Disables the use of differential enthalpy control + ) + Disable_Differential_Temperature_Command: ( + URIRef # Disables the use of differential temperature control + ) + Disable_Fixed_Enthalpy_Command: URIRef # Disables the use of fixed enthalpy control + Disable_Fixed_Temperature_Command: ( + URIRef # Disables the use of fixed temperature temperature + ) + Disable_Hot_Water_System_Outside_Air_Temperature_Setpoint: URIRef # Disables hot water system when outside air temperature reaches the indicated value + Disable_Status: URIRef # Indicates if functionality has been disabled + Discharge_Air: URIRef # the air exiting the registers (vents). + Discharge_Air_Dewpoint_Sensor: URIRef # Measures dewpoint of discharge air + Discharge_Air_Duct_Pressure_Status: ( + URIRef # Indicates if air pressure in discharge duct is within expected bounds + ) + Discharge_Air_Flow_Demand_Setpoint: ( + URIRef # Sets the rate of discharge air flow required for a process + ) + Discharge_Air_Flow_High_Reset_Setpoint: URIRef + Discharge_Air_Flow_Low_Reset_Setpoint: URIRef + Discharge_Air_Flow_Reset_Setpoint: URIRef # Setpoints used in Reset strategies + Discharge_Air_Flow_Sensor: URIRef # Measures the rate of flow of discharge air + Discharge_Air_Flow_Setpoint: URIRef # Sets discharge air flow + Discharge_Air_Humidity_Sensor: ( + URIRef # Measures the relative humidity of discharge air + ) + Discharge_Air_Humidity_Setpoint: URIRef # Humidity setpoint for discharge air + Discharge_Air_Smoke_Detection_Alarm: URIRef + Discharge_Air_Static_Pressure_Deadband_Setpoint: ( + URIRef # Sets the size of a deadband of static pressure of discharge air + ) + Discharge_Air_Static_Pressure_Integral_Time_Parameter: URIRef + Discharge_Air_Static_Pressure_Proportional_Band_Parameter: URIRef + Discharge_Air_Static_Pressure_Sensor: ( + URIRef # The static pressure of air within discharge regions of an HVAC system + ) + Discharge_Air_Static_Pressure_Setpoint: ( + URIRef # Sets static pressure of discharge air + ) + Discharge_Air_Static_Pressure_Step_Parameter: URIRef + Discharge_Air_Temperature_Alarm: URIRef # An alarm that indicates the off-normal conditions associated with the temperature of discharge air. + Discharge_Air_Temperature_Cooling_Setpoint: ( + URIRef # Sets temperature of discharge air for cooling + ) + Discharge_Air_Temperature_Deadband_Setpoint: ( + URIRef # Sets the size of a deadband of temperature of discharge air + ) + Discharge_Air_Temperature_Heating_Setpoint: ( + URIRef # Sets temperature of discharge air for heating + ) + Discharge_Air_Temperature_High_Reset_Setpoint: URIRef + Discharge_Air_Temperature_Low_Reset_Setpoint: URIRef + Discharge_Air_Temperature_Proportional_Band_Parameter: URIRef + Discharge_Air_Temperature_Reset_Differential_Setpoint: URIRef + Discharge_Air_Temperature_Sensor: ( + URIRef # Measures the temperature of discharge air + ) + Discharge_Air_Temperature_Setpoint: URIRef # Sets temperature of discharge air + Discharge_Air_Temperature_Setpoint_Limit: URIRef # A parameter that places a lower or upper bound on the range of permitted values of a Discharge_Air_Temperature_Setpoint. + Discharge_Air_Temperature_Step_Parameter: URIRef + Discharge_Air_Velocity_Pressure_Sensor: URIRef + Discharge_Chilled_Water: URIRef + Discharge_Fan: URIRef # Fan moving air discharged from HVAC vents + Discharge_Hot_Water: URIRef + Discharge_Water: URIRef + Discharge_Water_Differential_Pressure_Deadband_Setpoint: URIRef # Sets the size of a deadband of differential pressure of discharge water + Discharge_Water_Differential_Pressure_Integral_Time_Parameter: URIRef + Discharge_Water_Differential_Pressure_Proportional_Band_Parameter: URIRef + Discharge_Water_Flow_Sensor: URIRef # Measures the rate of flow of discharge water + Discharge_Water_Flow_Setpoint: ( + URIRef # Sets the target flow rate of discharge water + ) + Discharge_Water_Temperature_Alarm: URIRef # An alarm that indicates the off-normal conditions associated with temperature of the discharge water. + Discharge_Water_Temperature_Proportional_Band_Parameter: URIRef + Discharge_Water_Temperature_Sensor: ( + URIRef # Measures the temperature of discharge water + ) + Discharge_Water_Temperature_Setpoint: URIRef # Sets temperature of discharge water + Disconnect_Switch: URIRef # Building power is most commonly provided by utility company through a master disconnect switch (sometimes called a service disconnect) in the main electrical room of a building. The Utility Company provided master disconnect switch often owns or restricts access to this switch. There can also be other cases where a disconnect is placed into an electrical system to allow service cut-off to a portion of the building. + Displacement_Flow_Air_Diffuser: URIRef # An air diffuser that is designed for low discharge air speeds to minimize turbulence and induction of room air. This diffuser is used with displacement ventilation systems. + Distribution_Frame: URIRef # A class of spaces where the cables carrying signals meet and connect, e.g. a wiring closet or a broadcast downlink room + Domestic_Hot_Water_Supply_Temperature_Sensor: URIRef # Measures the temperature of domestic water supplied by a hot water system + Domestic_Hot_Water_Supply_Temperature_Setpoint: ( + URIRef # Sets temperature of supplying part of domestic hot water + ) + Domestic_Hot_Water_System: URIRef # The equipment, devices and conduits that handle the production and distribution of domestic hot water in a building + Domestic_Hot_Water_System_Enable_Command: ( + URIRef # Enables operation of the domestic hot water system + ) + Domestic_Hot_Water_Temperature_Setpoint: ( + URIRef # Sets temperature of domestic hot water + ) + Domestic_Hot_Water_Valve: ( + URIRef # A valve regulating the flow of domestic hot water + ) + Domestic_Water: ( + URIRef # Tap water for drinking, washing, cooking, and flushing of toliets + ) + Domestic_Water_Loop: URIRef + Drench_Hose: URIRef + Drive_Ready_Status: URIRef # Indicates if a hard drive or other storage device is ready to be used, e.g. in the context of RAID + Duration_Sensor: URIRef # Measures the duration of a phenomenon or event + ESS_Panel: URIRef # See Embedded_Surface_System_Panel + EconCycle_Start_Stop_Status: URIRef + Economizer: URIRef # Device that, on proper variable sensing, initiates control signals or actions to conserve energy. A control system that reduces the mechanical heating and cooling requirement. + Economizer_Damper: URIRef # A damper that is part of an economizer that is used to module the flow of air + Effective_Air_Temperature_Cooling_Setpoint: URIRef + Effective_Air_Temperature_Heating_Setpoint: URIRef + Effective_Air_Temperature_Setpoint: URIRef + Effective_Discharge_Air_Temperature_Setpoint: URIRef + Effective_Return_Air_Temperature_Setpoint: URIRef + Effective_Room_Air_Temperature_Setpoint: URIRef + Effective_Supply_Air_Temperature_Setpoint: URIRef + Effective_Zone_Air_Temperature_Setpoint: URIRef + Electric_Baseboard_Radiator: ( + URIRef # Electric heating device located at or near the floor + ) + Electric_Boiler: URIRef # A closed, pressure vessel that uses electricity for heating water or other fluids to supply steam or hot water for heating, humidification, or other applications. + Electric_Radiator: URIRef # Electric heating device + Electrical_Equipment: URIRef + Electrical_Meter: ( + URIRef # A meter that measures the usage or consumption of electricity + ) + Electrical_Power_Sensor: ( + URIRef # Measures the amount of instantaneous electric power consumed + ) + Electrical_Room: URIRef # A class of service rooms that house electrical equipment for a building + Electrical_System: URIRef # Devices that serve or are part of the electrical subsystem in the building + Elevator: URIRef # A device that provides vertical transportation between floors, levels or decks of a building, vessel or other structure + Elevator_Shaft: ( + URIRef # The vertical space in which an elevator ascends and descends + ) + Elevator_Space: ( + URIRef # The vertical space in which an elevator ascends and descends + ) + Embedded_Surface_System_Panel: URIRef # Radiant panel heating and cooling system where the energy heat source or sink is embedded in a radiant layer which is thermally insulated from the building structure. + Embedded_Temperature_Sensor: URIRef # Measures the internal temperature of the radiant layer of the radiant heating and cooling HVAC system. + Embedded_Temperature_Setpoint: URIRef # Sets temperature for the internal material, e.g. concrete slab, of the radiant panel. + Emergency_Air_Flow_System: URIRef + Emergency_Air_Flow_System_Status: URIRef + Emergency_Alarm: URIRef # Alarms that indicate off-normal conditions associated with emergency systems + Emergency_Generator_Alarm: URIRef # An alarm that indicates off-normal conditions associated with an emergency generator + Emergency_Generator_Status: URIRef # Indicates if an emergency generator is active + Emergency_Phone: URIRef + Emergency_Power_Off_System: URIRef # A system that can power down a single piece of equipment or a single system from a single point + Emergency_Power_Off_System_Activated_By_High_Temperature_Status: URIRef + Emergency_Power_Off_System_Activated_By_Leak_Detection_System_Status: URIRef + Emergency_Power_Off_System_Status: URIRef + Emergency_Push_Button_Status: ( + URIRef # Indicates if an emergency button has been pushed + ) + Emergency_Wash_Station: URIRef + Employee_Entrance_Lobby: URIRef # An open space near an entrance that is typically only used for employees + Enable_Command: URIRef # Commands that enable functionality + Enable_Differential_Enthalpy_Command: ( + URIRef # Enables the use of differential enthalpy control + ) + Enable_Differential_Temperature_Command: ( + URIRef # Enables the use of differential temperature control + ) + Enable_Fixed_Enthalpy_Command: URIRef # Enables the use of fixed enthalpy control + Enable_Fixed_Temperature_Command: ( + URIRef # Enables the use of fixed temperature control + ) + Enable_Hot_Water_System_Outside_Air_Temperature_Setpoint: URIRef # Enables hot water system when outside air temperature reaches the indicated value + Enable_Status: ( + URIRef # Indicates if a system or piece of functionality has been enabled + ) + Enclosed_Office: URIRef # A space for individuals to work with walls and a door + Energy_Generation_System: ( + URIRef # A collection of devices that generates electricity + ) + Energy_Sensor: URIRef # Measures energy consumption + Energy_Storage: ( + URIRef # Devices or equipment that store energy in its various forms + ) + Energy_Storage_System: URIRef # A collection of devices that stores electricity + Energy_System: URIRef # A collection of devices that generates, stores or transports electricity + Energy_Usage_Sensor: ( + URIRef # Measures the total amount of energy used over some period of time + ) + Energy_Zone: URIRef # A space or group of spaces that are managed or monitored as one unit for energy purposes + Entering_Water: URIRef # Water that is entering a piece of equipment or system + Entering_Water_Flow_Sensor: URIRef # Measures the rate of flow of water entering a piece of equipment or system + Entering_Water_Flow_Setpoint: URIRef # Sets the target flow rate of entering water + Entering_Water_Temperature_Sensor: URIRef # Measures the temperature of water entering a piece of equipment or system + Entering_Water_Temperature_Setpoint: URIRef # Sets temperature of entering water + Enthalpy_Sensor: URIRef # Measures the total heat content of some substance + Enthalpy_Setpoint: URIRef # Sets enthalpy + Entrance: URIRef # The location and space of a building where people enter and exit the building + Environment_Box: URIRef # (also known as climatic chamber), enclosed space designed to create a particular environment. + Equipment: URIRef # devices that serve all or part of the building and may include electric power, lighting, transportation, or service water heating, including, but not limited to, furnaces, boilers, air conditioners, heat pumps, chillers, water heaters, lamps, luminaires, ballasts, elevators, escalators, or other devices or installations. + Equipment_Room: URIRef # A telecommunications room where equipment that serves the building is stored + Evaporative_Heat_Exchanger: URIRef + Even_Month_Status: URIRef + Exercise_Room: URIRef # An indoor room used for exercise and physical activities + Exhaust_Air: URIRef # air that must be removed from a space due to contaminants, regardless of pressurization + Exhaust_Air_Dewpoint_Sensor: URIRef # Measures dewpoint of exhaust air + Exhaust_Air_Differential_Pressure_Sensor: URIRef # Measures the difference in pressure between an upstream and downstream of an air duct or other air conduit used to exhaust air from the building + Exhaust_Air_Differential_Pressure_Setpoint: URIRef # Sets the target air differential pressure between an upstream and downstream point in a exhaust air duct or conduit + Exhaust_Air_Flow_Integral_Time_Parameter: URIRef + Exhaust_Air_Flow_Proportional_Band_Parameter: URIRef + Exhaust_Air_Flow_Sensor: URIRef # Measures the rate of flow of exhaust air + Exhaust_Air_Flow_Setpoint: URIRef # Sets exhaust air flow rate + Exhaust_Air_Humidity_Sensor: URIRef # Measures the relative humidity of exhaust air + Exhaust_Air_Humidity_Setpoint: URIRef # Humidity setpoint for exhaust air + Exhaust_Air_Stack_Flow_Deadband_Setpoint: ( + URIRef # Sets the size of a deadband of exhaust air stack flow + ) + Exhaust_Air_Stack_Flow_Integral_Time_Parameter: URIRef + Exhaust_Air_Stack_Flow_Proportional_Band_Parameter: URIRef + Exhaust_Air_Stack_Flow_Sensor: ( + URIRef # Measures the rate of flow of air in the exhaust air stack + ) + Exhaust_Air_Stack_Flow_Setpoint: URIRef # Sets exhaust air stack flow rate + Exhaust_Air_Static_Pressure_Proportional_Band_Parameter: URIRef + Exhaust_Air_Static_Pressure_Sensor: ( + URIRef # The static pressure of air within exhaust regions of an HVAC system + ) + Exhaust_Air_Static_Pressure_Setpoint: URIRef # Sets static pressure of exhaust air + Exhaust_Air_Temperature_Sensor: URIRef # Measures the temperature of exhaust air + Exhaust_Air_Velocity_Pressure_Sensor: URIRef + Exhaust_Damper: URIRef # A damper that modulates the flow of exhaust air + Exhaust_Fan: URIRef # Fan moving exhaust air -- air that must be removed from a space due to contaminants + Exhaust_Fan_Disable_Command: URIRef # Disables operation of the exhaust fan + Exhaust_Fan_Enable_Command: URIRef # Enables operation of the exhaust fan + Eye_Wash_Station: URIRef + FCU: URIRef # See Fan_Coil_Unit + Failure_Alarm: URIRef # Alarms that indicate the failure of devices, equipment, systems and control loops + Fan: URIRef # Any device with two or more blades or vanes attached to a rotating shaft used to produce an airflow for the purpose of comfort, ventilation, exhaust, heating, cooling, or any other gaseous transport. + Fan_Coil_Unit: URIRef # Terminal device consisting of a heating and/or cooling heat exchanger or 'coil' and fan that is used to control the temperature in the space where it is installed + Fan_On_Off_Status: URIRef + Fan_Status: URIRef # Indicates properties of fans + Fan_VFD: URIRef # Variable-frequency drive for fans + Fault_Reset_Command: URIRef # Clears a fault status + Fault_Status: ( + URIRef # Indicates the presence of a fault in a device, system or control loop + ) + Field_Of_Play: URIRef # The area of a stadium where athletic events occur, e.g. the soccer pitch + Filter: URIRef # Device to remove gases from a mixture of gases or to remove solid material from a fluid + Filter_Differential_Pressure_Sensor: ( + URIRef # Measures the difference in pressure on either side of a filter + ) + Filter_Reset_Command: URIRef + Filter_Status: URIRef # Indicates if a filter needs to be replaced + Final_Filter: URIRef # The last, high-efficiency filter installed in a sequence to remove the finest particulates from the substance being filtered + Fire_Control_Panel: URIRef # A panel-mounted device that provides status and control of a fire safety system + Fire_Safety_Equipment: URIRef + Fire_Safety_System: URIRef # A system containing devices and equipment that monitor, detect and suppress fire hazards + Fire_Sensor: URIRef # Measures the presence of fire + Fire_Zone: URIRef # combustion chamber in a furnace or boiler. + First_Aid_Kit: URIRef + First_Aid_Room: URIRef # A room for a person with minor injuries can be treated or temporarily treated until transferred to a more advanced medical facility + Floor: URIRef # A level, typically representing a horizontal aggregation of spaces that are vertically bound. (referring to IFC) + Flow_Sensor: URIRef # Measures the rate of flow of some substance + Flow_Setpoint: URIRef # Sets flow + Fluid: URIRef # substance, as a liquid or gas, that is capable of flowing and that changes shape when acted on by a force. + Food_Service_Room: URIRef # A space used in the production, storage, serving, or cleanup of food and beverages + Formaldehyde_Level_Sensor: ( + URIRef # Measures the concentration of formaldehyde in air + ) + Freeze_Status: ( + URIRef # Indicates if a substance contained within a vessel has frozen + ) + Freezer: URIRef # cold chamber usually kept at a temperature of 22°F to 31°F (–5°C to –1°C), with high-volume air circulation. + Frequency_Command: URIRef # Controls the frequency of a device's operation (e.g. rotational frequency) + Frequency_Sensor: URIRef # Measures the frequency of a phenomenon or aspect of a phenomenon, e.g. the frequency of a fan turning + Fresh_Air_Fan: URIRef # Fan moving fresh air -- air that is supplied into the building from the outdoors + Fresh_Air_Setpoint_Limit: URIRef # A parameter that places a lower or upper bound on the range of permitted values of a Fresh_Air_Setpoint. + Frost: URIRef # frost formed on the cold surface (tubes, plates) of a cooling coil. + Frost_Sensor: ( + URIRef # Senses the presence of frost or conditions that may cause frost + ) + Fuel_Oil: URIRef # Petroleum based oil burned for energy + Fume_Hood: URIRef # A fume-collection device mounted over a work space, table, or shelf and serving to conduct unwanted gases away from the area enclosed. + Fume_Hood_Air_Flow_Sensor: URIRef # Measures the rate of flow of air in a fume hood + Furniture: URIRef # Movable objects intended to support various human activities such as seating, eating and sleeping + Gain_Parameter: URIRef + Gas: URIRef # state of matter in which substances exist in the form of nonaggregated molecules and which, within acceptable limits of accuracy, satisfy the ideal gas laws; usually a highly superheated vapor. See [[state]]. + Gas_Distribution: URIRef # Utilize a gas distribution source to represent how gas is distributed across multiple destinations + Gas_Meter: URIRef # A meter that measures the usage or consumption of gas + Gas_Sensor: URIRef # Measures gas concentration (other than CO2) + Gas_System: URIRef + Gas_Valve: URIRef + Gasoline: URIRef # Petroleum derived liquid used as a fuel source + Gatehouse: URIRef # The standalone building used to manage the entrance to a campus or building grounds + Generator_Room: ( + URIRef # A room for electrical equipment, specifically electrical generators. + ) + Glycol: URIRef + HVAC_Equipment: URIRef # See Heating_Ventilation_Air_Conditioning_System + HVAC_System: URIRef # See Heating_Ventilation_Air_Conditioning_System + HVAC_Zone: URIRef # a space or group of spaces, within a building with heating, cooling, and ventilating requirements, that are sufficiently similar so that desired conditions (e.g., temperature) can be maintained throughout using a single sensor (e.g., thermostat or temperature sensor). + HX: URIRef # See Heat_Exchanger + Hail: ( + URIRef # pellets of frozen rain which fall in showers from cumulonimbus clouds. + ) + Hail_Sensor: URIRef # Measures hail in terms of its size and damage potential + Hallway: URIRef # A common space, used to connect other parts of a building + Hazardous_Materials_Storage: URIRef # A storage space set aside (usually with restricted access) for the storage of materials that can be hazardous to living beings or the environment + Heat_Exchanger: URIRef # A heat exchanger is a piece of equipment built for efficient heat transfer from one medium to another. The media may be separated by a solid wall to prevent mixing or they may be in direct contact (BEDES) + Heat_Exchanger_Supply_Water_Temperature_Sensor: ( + URIRef # Measures the temperature of water supplied by a heat exchanger + ) + Heat_Exchanger_System_Enable_Status: ( + URIRef # Indicates if the heat exchanger system has been enabled + ) + Heat_Recovery_Hot_Water_System: URIRef + Heat_Sensor: URIRef # Measures heat + Heat_Wheel: URIRef # A rotary heat exchanger positioned within the supply and exhaust air streams of an air handling system in order to recover heat energy + Heat_Wheel_VFD: URIRef # A VFD that drives a heat wheel + Heating_Coil: URIRef # A heating element typically made of pipe, tube or wire that emits heat. Typically filled with hot water, or, in the case of wire, uses electricity. + Heating_Command: URIRef # Controls the amount of heating to be delivered (typically as a proportion of total heating output) + Heating_Demand_Sensor: URIRef # Measures the amount of power consumed by a heating process; typically found by multiplying the tonnage of a unit (e.g. RTU) by the efficiency rating in kW/ton + Heating_Demand_Setpoint: URIRef # Sets the rate required for heating + Heating_Discharge_Air_Flow_Setpoint: URIRef # Sets discharge air flow for heating + Heating_Discharge_Air_Temperature_Deadband_Setpoint: ( + URIRef # Sets the size of a deadband of temperature of heating discharge air + ) + Heating_Discharge_Air_Temperature_Integral_Time_Parameter: URIRef + Heating_Discharge_Air_Temperature_Proportional_Band_Parameter: URIRef + Heating_Start_Stop_Status: URIRef + Heating_Supply_Air_Flow_Setpoint: URIRef # Sets supply air flow rate for heating + Heating_Supply_Air_Temperature_Deadband_Setpoint: ( + URIRef # Sets the size of a deadband of temperature of supply air for heating + ) + Heating_Supply_Air_Temperature_Integral_Time_Parameter: URIRef + Heating_Supply_Air_Temperature_Proportional_Band_Parameter: URIRef + Heating_Temperature_Setpoint: URIRef # Sets temperature for heating + Heating_Thermal_Power_Sensor: URIRef + Heating_Valve: URIRef # A valve that controls air temperature by modulating the amount of hot water flowing through a heating coil + Heating_Ventilation_Air_Conditioning_System: URIRef # The equipment, distribution systems and terminals that provide, either collectively or individually, the processes of heating, ventilating or air conditioning to a building or portion of a building + High_CO2_Alarm: ( + URIRef # A device that indicates high concentration of carbon dioxide. + ) + High_Discharge_Air_Temperature_Alarm: ( + URIRef # An alarm that indicates that discharge air temperature is too high + ) + High_Head_Pressure_Alarm: URIRef # An alarm that indicates a high pressure generated on the output side of a gas compressor in a refrigeration or air conditioning system. + High_Humidity_Alarm: ( + URIRef # An alarm that indicates high concentration of water vapor in the air. + ) + High_Humidity_Alarm_Parameter: URIRef # A parameter determining the humidity level at which to trigger a high humidity alarm + High_Outside_Air_Lockout_Temperature_Differential_Parameter: ( + URIRef # The upper bound of the outside air temperature lockout range + ) + High_Return_Air_Temperature_Alarm: ( + URIRef # An alarm that indicates that return air temperature is too high + ) + High_Static_Pressure_Cutout_Setpoint_Limit: URIRef # A parameter that places a lower or upper bound on the range of permitted values of a High_Static_Pressure_Cutout_Setpoint. + High_Temperature_Alarm: URIRef # An alarm that indicates high temperature. + High_Temperature_Alarm_Parameter: URIRef # A parameter determining the temperature level at which to trigger a high temperature alarm + High_Temperature_Hot_Water_Return_Temperature_Sensor: URIRef # Measures the temperature of high-temperature hot water returned to a hot water system + High_Temperature_Hot_Water_Supply_Temperature_Sensor: URIRef # Measures the temperature of high-temperature hot water supplied by a hot water system + Hold_Status: URIRef + Hospitality_Box: URIRef # A room at a stadium, usually overlooking the field of play, that is physical separate from the other seating at the venue + Hot_Box: URIRef # hot air chamber forming part of an air handler. + Hot_Water: URIRef # Hot water used for HVAC heating or supply to hot taps + Hot_Water_Baseboard_Radiator: ( + URIRef # Hydronic heating device located at or near the floor + ) + Hot_Water_Coil: URIRef # A heating element typically made of pipe, tube or wire that emits heat that is filled with hot water. + Hot_Water_Differential_Pressure_Deadband_Setpoint: ( + URIRef # Sets the size of a deadband of differential pressure of hot water + ) + Hot_Water_Differential_Pressure_Integral_Time_Parameter: URIRef + Hot_Water_Differential_Pressure_Load_Shed_Reset_Status: URIRef + Hot_Water_Differential_Pressure_Load_Shed_Status: URIRef + Hot_Water_Differential_Pressure_Proportional_Band_Parameter: URIRef + Hot_Water_Differential_Pressure_Sensor: URIRef # Measures the difference in water pressure on either side of a hot water valve + Hot_Water_Differential_Pressure_Setpoint: URIRef # Sets the target water differential pressure between an upstream and downstream point in a water pipe or conduit used to carry hot water + Hot_Water_Differential_Temperature_Sensor: URIRef # Measures the difference in temperature between the entering water to the boiler or other water heating device and leaving water from the same boiler or other water heating device + Hot_Water_Discharge_Flow_Sensor: ( + URIRef # Measures the rate of flow of hot discharge water + ) + Hot_Water_Discharge_Flow_Setpoint: ( + URIRef # Sets the target flow rate of hot discharge water + ) + Hot_Water_Discharge_Temperature_Load_Shed_Status: URIRef + Hot_Water_Flow_Sensor: URIRef # Measures the rate of flow in a hot water circuit + Hot_Water_Flow_Setpoint: URIRef # Sets the target flow rate of hot water + Hot_Water_Loop: URIRef # A collection of equipment that transport and regulate hot water among each other + Hot_Water_Meter: ( + URIRef # A meter that measures the usage or consumption of hot water + ) + Hot_Water_Pump: URIRef # A pump that performs work on hot water; typically part of a hot water system + Hot_Water_Radiator: URIRef # Radiator that uses hot water + Hot_Water_Return_Flow_Sensor: ( + URIRef # Measures the rate of flow of hot return water + ) + Hot_Water_Return_Temperature_Sensor: ( + URIRef # Measures the temperature of water returned to a hot water system + ) + Hot_Water_Static_Pressure_Setpoint: URIRef # Sets static pressure of hot air + Hot_Water_Supply_Flow_Sensor: ( + URIRef # Measures the rate of flow of hot supply water + ) + Hot_Water_Supply_Flow_Setpoint: ( + URIRef # Sets the target flow rate of hot supply water + ) + Hot_Water_Supply_Temperature_High_Reset_Setpoint: URIRef + Hot_Water_Supply_Temperature_Load_Shed_Status: URIRef + Hot_Water_Supply_Temperature_Low_Reset_Setpoint: URIRef + Hot_Water_Supply_Temperature_Sensor: ( + URIRef # Measures the temperature of water supplied by a hot water system + ) + Hot_Water_System: URIRef # The equipment, devices and conduits that handle the production and distribution of hot water in a building + Hot_Water_System_Enable_Command: URIRef # Enables operation of the hot water system + Hot_Water_Temperature_Setpoint: URIRef # Sets the temperature of hot water + Hot_Water_Usage_Sensor: URIRef # Measures the amount of hot water that is consumed, over some period of time + Hot_Water_Valve: URIRef # A valve regulating the flow of hot water + Humidification_Start_Stop_Status: URIRef + Humidifier: URIRef # A device that adds moisture to air or other gases + Humidifier_Fault_Status: URIRef # Indicates the presence of a fault in a humidifier + Humidify_Command: URIRef + Humidity_Alarm: URIRef # An alarm that indicates the off-normal conditions associated with the concentration of water vapor in the air. + Humidity_Parameter: ( + URIRef # Parameters relevant to humidity-related systems and points + ) + Humidity_Sensor: URIRef # Measures the concentration of water vapor in air + Humidity_Setpoint: URIRef # Sets humidity + Humidity_Tolerance_Parameter: URIRef # A parameter determining the difference between upper and lower limits of humidity. + IDF: URIRef # An room for an intermediate distribution frame, where cables carrying signals from the main distribution frame terminate and then feed out to endpoints + Ice: URIRef # Water in its solid form + Ice_Tank_Leaving_Water_Temperature_Sensor: ( + URIRef # Measures the temperature of water leaving an ice tank + ) + Illuminance_Sensor: ( + URIRef # Measures the total luminous flux incident on a surface, per unit area + ) + Imbalance_Sensor: URIRef # A sensor which measures difference (imbalance) between phases of an electrical system + Induction_Unit: URIRef # A device with an primary air connection and integrated coil and condensate pan that performs sensible and latent cooling of a space. Essentially an Active Chilled Beam with a built in condensate pan. + Information_Area: URIRef # An information booth or kiosk where visitors would look for information + Inside_Face_Surface_Temperature_Sensor: URIRef # Measures the inside surface (relative to the space) of the radiant panel of the radiant heating and cooling HVAC system. + Inside_Face_Surface_Temperature_Setpoint: URIRef # Sets temperature for the inside face surface temperature of the radiant panel. + Intake_Air_Filter: URIRef # Filters air intake + Intake_Air_Temperature_Sensor: ( + URIRef # Measures air at the interface between the building and the outside + ) + Integral_Gain_Parameter: URIRef + Integral_Time_Parameter: URIRef + Intercom_Equipment: URIRef + Interface: ( + URIRef # A device that provides an occupant control over a lighting system + ) + Intrusion_Detection_Equipment: URIRef + Inverter: URIRef # A device that changes direct current into alternating current + Isolation_Valve: URIRef # A valve that stops the flow of a fluid, usually for maintenance or safety purposes + Janitor_Room: ( + URIRef # A room set aside for the storage of cleaning equipment and supplies + ) + Jet_Nozzle_Air_Diffuser: URIRef # An air diffuser that is designed to produce high velocity discharge air stream to throw the air over a large distance or target the air stream to a localize area + Laboratory: URIRef # facility acceptable to the local, national, or international recognized authority having jurisdiction and which provides uniform testing and examination procedures and standards for meeting design, manufacturing, and factory testing requirements. + Laminar_Flow_Air_Diffuser: URIRef # An air diffuser that is designed for low discharge air speeds to provide uniform and unidirectional air pattern which minimizes room air entrainment + Last_Fault_Code_Status: URIRef # Indicates the last fault code that occurred + Lead_Lag_Command: URIRef # Enables lead/lag operation + Lead_Lag_Status: URIRef # Indicates if lead/lag operation is enabled + Lead_On_Off_Command: URIRef # Controls the active/inactive status of the "lead" part of a lead/lag system + Leak_Alarm: ( + URIRef # An alarm that indicates leaks occurred in systems containing fluids + ) + Leaving_Water: URIRef # Water that is leaving a piece of equipment or system + Leaving_Water_Flow_Sensor: URIRef # Measures the rate of flow of water that is leaving a piece of equipment or system + Leaving_Water_Flow_Setpoint: URIRef # Sets the target flow rate of leaving water + Leaving_Water_Temperature_Sensor: URIRef # Measures the temperature of water leaving a piece of equipment or system + Leaving_Water_Temperature_Setpoint: URIRef # Sets temperature of leaving water + Library: URIRef # A place for the storage and/or consumption of physical media, e.g. books, periodicals, and DVDs/CDs + Lighting: URIRef + Lighting_Equipment: URIRef + Lighting_System: URIRef # The equipment, devices and interfaces that serve or are a part of the lighting subsystem in a building + Lighting_Zone: URIRef + Limit: URIRef # A parameter that places an upper or lower bound on the range of permitted values of another point + Liquid: URIRef # state of matter intermediate between crystalline substances and gases in which the volume of a substance, but not the shape, remains relatively constant. + Liquid_CO2: URIRef # Carbon Dioxide in the liquid phase + Liquid_Detection_Alarm: URIRef + Load_Current_Sensor: URIRef # Measures the current consumed by a load + Load_Parameter: URIRef + Load_Setpoint: URIRef + Load_Shed_Command: ( + URIRef # Controls load shedding behavior provided by a control system + ) + Load_Shed_Differential_Pressure_Setpoint: URIRef + Load_Shed_Setpoint: URIRef + Load_Shed_Status: URIRef # Indicates if a load shedding policy is in effect + Loading_Dock: URIRef # A part of a facility where delivery trucks can load and unload. Usually partially enclosed with specific traffic lanes leading to the dock + Lobby: URIRef # A space just after the entrance to a building or other space of a building, where visitors can wait + Locally_On_Off_Status: URIRef + Location: URIRef + Lockout_Status: URIRef # Indicates if a piece of equipment, system, or functionality has been locked out from operation + Lockout_Temperature_Differential_Parameter: URIRef + Loop: URIRef # A collection of connected equipment; part of a System + Lounge: URIRef # A room for lesiure activities or relaxing + Louver: URIRef # Device consisting of an assembly of parallel sloping vanes, intended to permit the passage of air while providing a measure of protection against environmental influences + Low_Freeze_Protect_Temperature_Parameter: URIRef + Low_Humidity_Alarm: ( + URIRef # An alarm that indicates low concentration of water vapor in the air. + ) + Low_Humidity_Alarm_Parameter: URIRef # A parameter determining the humidity level at which to trigger a low humidity alarm + Low_Outside_Air_Lockout_Temperature_Differential_Parameter: ( + URIRef # The lower bound of the outside air temperature lockout range + ) + Low_Outside_Air_Temperature_Enable_Differential_Sensor: URIRef + Low_Outside_Air_Temperature_Enable_Setpoint: URIRef + Low_Return_Air_Temperature_Alarm: ( + URIRef # An alarm that indicates that return air temperature is too low + ) + Low_Suction_Pressure_Alarm: URIRef # An alarm that indicates a low suction pressure in the compressor in a refrigeration or air conditioning system. + Low_Temperature_Alarm: URIRef # An alarm that indicates low temperature. + Low_Temperature_Alarm_Parameter: URIRef # A parameter determining the temperature level at which to trigger a low temperature alarm + Lowest_Exhaust_Air_Static_Pressure_Sensor: URIRef # The lowest observed static pressure of air in exhaust regions of an HVAC system over some period of time + Luminaire: URIRef # A complete lighting unit consisting of a lamp or lamps and ballast(s) (when applicable) together with the parts designed to distribute the light, to position and protect the lamps, and to connect the lamps to the power supply. + Luminaire_Driver: URIRef # A power source for a luminaire + Luminance_Alarm: URIRef + Luminance_Command: ( + URIRef # Controls the amount of luminance delivered by a lighting system + ) + Luminance_Sensor: URIRef # Measures the luminous intensity per unit area of light travelling in a given direction + Luminance_Setpoint: URIRef # Sets luminance + MAU: URIRef # See Makeup_Air_Unit + MDF: URIRef # A room for the Main Distribution Frame, the central place of a building where cables carrying signals meet and connect to the outside world + Mail_Room: URIRef # A room where mail is received and sorted for distribution to the rest of the building + Maintenance_Mode_Command: URIRef # Controls whether or not a device or controller is operating in "Maintenance" mode + Maintenance_Required_Alarm: URIRef # An alarm that indicates that repair/maintenance is required on an associated device or equipment + Majlis: URIRef # In Arab countries, an Majlis is a private lounge where visitors are received and entertained + Makeup_Air_Unit: URIRef # A device designed to condition ventilation air introduced into a space or to replace air exhausted from a process or general area exhaust. The device may be used to prevent negative pressure within buildings or to reduce airborne contaminants in a space. + Makeup_Water: URIRef # Water used used to makeup water loss through leaks, evaporation, or blowdown + Makeup_Water_Valve: URIRef # A valve regulating the flow of makeup water into a water holding tank, e.g. a cooling tower, hot water tank + Manual_Auto_Status: ( + URIRef # Indicates if a system is under manual or automatic operation + ) + Massage_Room: URIRef # Usually adjunct to an athletic facility, a private/semi-private space where massages are performed + Max_Air_Flow_Setpoint_Limit: URIRef # A parameter that places an upper bound on the range of permitted values of a Air_Flow_Setpoint. + Max_Air_Temperature_Setpoint: URIRef # Setpoint for maximum air temperature + Max_Chilled_Water_Differential_Pressure_Setpoint_Limit: URIRef # A parameter that places an upper bound on the range of permitted values of a Chilled_Water_Differential_Pressure_Setpoint. + Max_Cooling_Discharge_Air_Flow_Setpoint_Limit: URIRef # A parameter that places an upper bound on the range of permitted values of a Cooling_Discharge_Air_Flow_Setpoint. + Max_Cooling_Supply_Air_Flow_Setpoint_Limit: URIRef # A parameter that places an upper bound on the range of permitted values of a Cooling_Supply_Air_Flow_Setpoint. + Max_Discharge_Air_Static_Pressure_Setpoint_Limit: URIRef # A parameter that places an upper bound on the range of permitted values of a Discharge_Air_Static_Pressure_Setpoint. + Max_Discharge_Air_Temperature_Setpoint_Limit: URIRef # A parameter that places an upper bound on the range of permitted values of a Discharge_Air_Temperature_Setpoint. + Max_Frequency_Command: URIRef # Sets the maximum permitted frequency + Max_Heating_Discharge_Air_Flow_Setpoint_Limit: URIRef # A parameter that places an upper bound on the range of permitted values of a Heating_Discharge_Air_Flow_Setpoint. + Max_Heating_Supply_Air_Flow_Setpoint_Limit: URIRef # A parameter that places an upper bound on the range of permitted values of a Heating_Supply_Air_Flow_Setpoint. + Max_Hot_Water_Differential_Pressure_Setpoint_Limit: URIRef # A parameter that places an upper bound on the range of permitted values of a Hot_Water_Differential_Pressure_Setpoint. + Max_Limit: URIRef # A parameter that places an upper bound on the range of permitted values of a Setpoint. + Max_Load_Setpoint: URIRef + Max_Occupied_Cooling_Discharge_Air_Flow_Setpoint_Limit: URIRef # A parameter that places an upper bound on the range of permitted values of a Occupied_Cooling_Discharge_Air_Flow_Setpoint. + Max_Occupied_Cooling_Supply_Air_Flow_Setpoint_Limit: URIRef # A parameter that places an upper bound on the range of permitted values of a Occupied_Cooling_Supply_Air_Flow_Setpoint. + Max_Occupied_Heating_Discharge_Air_Flow_Setpoint_Limit: URIRef # A parameter that places an upper bound on the range of permitted values of a Occupied_Heating_Discharge_Air_Flow_Setpoint. + Max_Occupied_Heating_Supply_Air_Flow_Setpoint_Limit: URIRef # A parameter that places an upper bound on the range of permitted values of a Occupied_Heating_Supply_Air_Flow_Setpoint. + Max_Position_Setpoint_Limit: URIRef # A parameter that places an upper bound on the range of permitted values of a Position_Setpoint. + Max_Speed_Setpoint_Limit: URIRef # A parameter that places an upper bound on the range of permitted values of a Speed_Setpoint. + Max_Static_Pressure_Setpoint_Limit: URIRef # A parameter that places an upper bound on the range of permitted values of a Static_Pressure_Setpoint. + Max_Supply_Air_Static_Pressure_Setpoint_Limit: URIRef # A parameter that places an upper bound on the range of permitted values of a Supply_Air_Static_Pressure_Setpoint. + Max_Temperature_Setpoint_Limit: URIRef # A parameter that places an upper bound on the range of permitted values of a Temperature_Setpoint. + Max_Unoccupied_Cooling_Discharge_Air_Flow_Setpoint_Limit: URIRef # A parameter that places an upper bound on the range of permitted values of a Unoccupied_Cooling_Discharge_Air_Flow_Setpoint. + Max_Unoccupied_Cooling_Supply_Air_Flow_Setpoint_Limit: URIRef # A parameter that places an upper bound on the range of permitted values of a Unoccupied_Cooling_Supply_Air_Flow_Setpoint. + Max_Unoccupied_Heating_Discharge_Air_Flow_Setpoint_Limit: URIRef # A parameter that places an upper bound on the range of permitted values of a Unoccupied_Heating_Discharge_Air_Flow_Setpoint. + Max_Unoccupied_Heating_Supply_Air_Flow_Setpoint_Limit: URIRef # A parameter that places an upper bound on the range of permitted values of a Unoccupied_Heating_Supply_Air_Flow_Setpoint. + Max_Water_Level_Alarm: ( + URIRef # Alarm indicating that the maximum water level was reached + ) + Max_Water_Temperature_Setpoint: URIRef # Setpoint for max water temperature + Measurable: URIRef + Mechanical_Room: ( + URIRef # A class of service rooms where mechanical equipment (HVAC) operates + ) + Media_Hot_Desk: URIRef # A non-enclosed space used by members of the media temporarily to cover an event while they are present at a venue + Media_Production_Room: URIRef # A enclosed space used by media professionals for the production of media + Media_Room: URIRef # A class of spaces related to the creation of media + Medical_Room: URIRef # A class of rooms used for medical purposes + Medium_Temperature_Hot_Water_Differential_Pressure_Load_Shed_Reset_Status: URIRef + Medium_Temperature_Hot_Water_Differential_Pressure_Load_Shed_Setpoint: URIRef + Medium_Temperature_Hot_Water_Differential_Pressure_Load_Shed_Status: URIRef + Medium_Temperature_Hot_Water_Differential_Pressure_Sensor: URIRef # Measures the difference in water pressure between sections of a medium temperature hot water system + Medium_Temperature_Hot_Water_Differential_Pressure_Setpoint: URIRef + Medium_Temperature_Hot_Water_Discharge_Temperature_High_Reset_Setpoint: URIRef + Medium_Temperature_Hot_Water_Discharge_Temperature_Low_Reset_Setpoint: URIRef + Medium_Temperature_Hot_Water_Return_Temperature_Sensor: URIRef # Measures the temperature of medium-temperature hot water returned to a hot water system + Medium_Temperature_Hot_Water_Supply_Temperature_High_Reset_Setpoint: URIRef + Medium_Temperature_Hot_Water_Supply_Temperature_Load_Shed_Setpoint: URIRef + Medium_Temperature_Hot_Water_Supply_Temperature_Load_Shed_Status: URIRef + Medium_Temperature_Hot_Water_Supply_Temperature_Low_Reset_Setpoint: URIRef + Medium_Temperature_Hot_Water_Supply_Temperature_Sensor: URIRef # Measures the temperature of medium-temperature hot water supplied by a hot water system + Meter: URIRef # A device that measure usage or consumption of some media --- typically a form energy or power. + Methane_Level_Sensor: URIRef # Measures the concentration of methane in air + Min_Air_Flow_Setpoint_Limit: URIRef # A parameter that places a lower bound on the range of permitted values of a Air_Flow_Setpoint. + Min_Air_Temperature_Setpoint: URIRef # Setpoint for minimum air temperature + Min_Chilled_Water_Differential_Pressure_Setpoint_Limit: URIRef # A parameter that places a lower bound on the range of permitted values of a Chilled_Water_Differential_Pressure_Setpoint. + Min_Cooling_Discharge_Air_Flow_Setpoint_Limit: URIRef # A parameter that places a lower bound on the range of permitted values of a Cooling_Discharge_Air_Flow_Setpoint. + Min_Cooling_Supply_Air_Flow_Setpoint_Limit: URIRef # A parameter that places a lower bound on the range of permitted values of a Cooling_Supply_Air_Flow_Setpoint. + Min_Discharge_Air_Static_Pressure_Setpoint_Limit: URIRef # A parameter that places a lower bound on the range of permitted values of a Discharge_Air_Static_Pressure_Setpoint. + Min_Discharge_Air_Temperature_Setpoint_Limit: URIRef # A parameter that places a lower bound on the range of permitted values of a Discharge_Air_Temperature_Setpoint. + Min_Fresh_Air_Setpoint_Limit: URIRef # A parameter that places a lower bound on the range of permitted values of a Fresh_Air_Setpoint. + Min_Heating_Discharge_Air_Flow_Setpoint_Limit: URIRef # A parameter that places a lower bound on the range of permitted values of a Heating_Discharge_Air_Flow_Setpoint. + Min_Heating_Supply_Air_Flow_Setpoint_Limit: URIRef # A parameter that places a lower bound on the range of permitted values of a Heating_Supply_Air_Flow_Setpoint. + Min_Hot_Water_Differential_Pressure_Setpoint_Limit: URIRef # A parameter that places a lower bound on the range of permitted values of a Hot_Water_Differential_Pressure_Setpoint. + Min_Limit: URIRef # A parameter that places a lower bound on the range of permitted values of a Setpoint. + Min_Occupied_Cooling_Discharge_Air_Flow_Setpoint_Limit: URIRef # A parameter that places a lower bound on the range of permitted values of a Occupied_Cooling_Discharge_Air_Flow_Setpoint. + Min_Occupied_Cooling_Supply_Air_Flow_Setpoint_Limit: URIRef # A parameter that places a lower bound on the range of permitted values of a Occupied_Cooling_Supply_Air_Flow_Setpoint. + Min_Occupied_Heating_Discharge_Air_Flow_Setpoint_Limit: URIRef # A parameter that places a lower bound on the range of permitted values of a Occupied_Heating_Discharge_Air_Flow_Setpoint. + Min_Occupied_Heating_Supply_Air_Flow_Setpoint_Limit: URIRef # A parameter that places a lower bound on the range of permitted values of a Occupied_Heating_Supply_Air_Flow_Setpoint. + Min_Outside_Air_Flow_Setpoint_Limit: URIRef # A parameter that places a lower bound on the range of permitted values of a Outside_Air_Flow_Setpoint. + Min_Position_Setpoint_Limit: URIRef # A parameter that places a lower bound on the range of permitted values of a Position_Setpoint. + Min_Speed_Setpoint_Limit: URIRef # A parameter that places a lower bound on the range of permitted values of a Speed_Setpoint. + Min_Static_Pressure_Setpoint_Limit: URIRef # A parameter that places a lower bound on the range of permitted values of a Static_Pressure_Setpoint. + Min_Supply_Air_Static_Pressure_Setpoint_Limit: URIRef # A parameter that places a lower bound on the range of permitted values of a Supply_Air_Static_Pressure_Setpoint. + Min_Temperature_Setpoint_Limit: URIRef # A parameter that places a lower bound on the range of permitted values of a Temperature_Setpoint. + Min_Unoccupied_Cooling_Discharge_Air_Flow_Setpoint_Limit: URIRef # A parameter that places a lower bound on the range of permitted values of a Unoccupied_Cooling_Discharge_Air_Flow_Setpoint. + Min_Unoccupied_Cooling_Supply_Air_Flow_Setpoint_Limit: URIRef # A parameter that places a lower bound on the range of permitted values of a Unoccupied_Cooling_Supply_Air_Flow_Setpoint. + Min_Unoccupied_Heating_Discharge_Air_Flow_Setpoint_Limit: URIRef # A parameter that places a lower bound on the range of permitted values of a Unoccupied_Heating_Discharge_Air_Flow_Setpoint. + Min_Unoccupied_Heating_Supply_Air_Flow_Setpoint_Limit: URIRef # A parameter that places a lower bound on the range of permitted values of a Unoccupied_Heating_Supply_Air_Flow_Setpoint. + Min_Water_Level_Alarm: ( + URIRef # Alarm indicating that the minimum water level was reached + ) + Min_Water_Temperature_Setpoint: URIRef # Setpoint for min water temperature + Mixed_Air: URIRef # (1) air that contains two or more streams of air. (2) combined outdoor air and recirculated air. + Mixed_Air_Filter: URIRef # A filter that is applied to the mixture of recirculated and outside air + Mixed_Air_Flow_Sensor: URIRef # Measures the rate of flow of mixed air + Mixed_Air_Humidity_Sensor: URIRef # Measures the humidity of mixed air + Mixed_Air_Humidity_Setpoint: URIRef # Humidity setpoint for mixed air + Mixed_Air_Temperature_Sensor: URIRef # Measures the temperature of mixed air + Mixed_Air_Temperature_Setpoint: URIRef # Sets temperature of mixed air + Mixed_Damper: URIRef # A damper that modulates the flow of the mixed outside and return air streams + Mode_Command: URIRef # Controls the operating mode of a device or controller + Mode_Status: ( + URIRef # Indicates which mode a system, device or control loop is currently in + ) + Motion_Sensor: URIRef # Detects the presence of motion in some area + Motor: URIRef # A machine in which power is applied to do work by the conversion of various forms of energy into mechanical force and motion. + Motor_Control_Center: URIRef # The Motor Control Center is a specialized type of switchgear which provides electrical power to major mechanical systems in the building such as HVAC components. + Motor_Current_Sensor: URIRef # Measures the current consumed by a motor + Motor_Direction_Status: URIRef # Indicates which direction a motor is operating in, e.g. forward or reverse + Motor_On_Off_Status: URIRef + Motor_Speed_Sensor: URIRef + Motor_Torque_Sensor: URIRef # Measures the torque, or rotating power, of a motor + NO2_Level_Sensor: URIRef # Measures the concentration of NO2 in air + NVR: URIRef + Natural_Gas: URIRef # Fossil fuel energy source consisting largely of methane and other hydrocarbons + Natural_Gas_Boiler: URIRef # A closed, pressure vessel that uses natural gas for heating water or other fluids to supply steam or hot water for heating, humidification, or other applications. + Network_Video_Recorder: URIRef + No_Water_Alarm: ( + URIRef # Alarm indicating that there is no water in the equipment or system + ) + Noncondensing_Natural_Gas_Boiler: URIRef # A closed, pressure vessel that uses natural gas with no system to capture latent heat for heating water or other fluids to supply steam or hot water for heating, humidification, or other applications. + Occupancy_Command: URIRef # Controls whether or not a device or controller is operating in "Occupied" mode + Occupancy_Sensor: URIRef # Detects occupancy of some space or area + Occupancy_Status: URIRef # Indicates if a room or space is occupied + Occupied_Air_Temperature_Setpoint: URIRef + Occupied_Cooling_Discharge_Air_Flow_Setpoint: ( + URIRef # Sets discharge air flow for cooling when occupied + ) + Occupied_Cooling_Supply_Air_Flow_Setpoint: ( + URIRef # Sets supply air flow rate for cooling when occupied + ) + Occupied_Cooling_Temperature_Deadband_Setpoint: ( + URIRef # Sets the size of a deadband of temperature for cooling when occupied + ) + Occupied_Discharge_Air_Flow_Setpoint: ( + URIRef # Sets discharge air flow when occupied + ) + Occupied_Discharge_Air_Temperature_Setpoint: URIRef + Occupied_Heating_Discharge_Air_Flow_Setpoint: ( + URIRef # Sets discharge air flow for heating when occupied + ) + Occupied_Heating_Supply_Air_Flow_Setpoint: ( + URIRef # Sets supply air flow rate for heating when occupied + ) + Occupied_Heating_Temperature_Deadband_Setpoint: ( + URIRef # Sets the size of a deadband of temperature for heating when occupied + ) + Occupied_Mode_Status: ( + URIRef # Indicates if a system, device or control loop is in "Occupied" mode + ) + Occupied_Return_Air_Temperature_Setpoint: URIRef + Occupied_Room_Air_Temperature_Setpoint: URIRef + Occupied_Supply_Air_Flow_Setpoint: URIRef # Sets supply air flow rate when occupied + Occupied_Supply_Air_Temperature_Setpoint: URIRef + Occupied_Zone_Air_Temperature_Setpoint: URIRef + Off_Command: URIRef # An Off Command controls or reports the binary 'off' status of a control loop, relay or equipment activity. It can only be used to stop/deactivate an associated equipment or process, or determine that the related entity is 'off' + Off_Status: URIRef # Indicates if a control loop, relay or equipment is off + Office: URIRef # A class of rooms dedicated for work or study + Office_Kitchen: URIRef # A common space, usually near or in a breakroom, where minor food preparation occurs + Oil: URIRef # a viscous liquid derived from petroleum, especially for use as a fuel or lubricant. + On_Command: URIRef # An On Command controls or reports the binary 'on' status of a control loop, relay or equipment activity. It can only be used to start/activate an associated equipment or process, or determine that the related entity is 'on' + On_Off_Command: URIRef # An On/Off Command controls or reports the binary status of a control loop, relay or equipment activity + On_Off_Status: ( + URIRef # Indicates the on/off status of a control loop, relay or equipment + ) + On_Status: URIRef # Indicates if a control loop, relay or equipment is on + On_Timer_Sensor: URIRef # Measures the duration for which a device was in an active or "on" state + Open_Close_Status: ( + URIRef # Indicates the open/close status of a device such as a damper or valve + ) + Open_Heating_Valve_Outside_Air_Temperature_Setpoint: URIRef + Open_Office: URIRef # An open space used for work or study by multiple people. Usuaully subdivided into cubicles or desks + Operating_Mode_Status: URIRef # Indicates the current operating mode of a system, device or control loop + Outdoor_Area: URIRef # A class of spaces that exist outside of a building + Output_Frequency_Sensor: URIRef + Output_Voltage_Sensor: ( + URIRef # Measures the voltage output by some process or device + ) + Outside: URIRef + Outside_Air: URIRef # air external to a defined zone (e.g., corridors). + Outside_Air_CO2_Sensor: URIRef # Measures the concentration of CO2 in outside air + Outside_Air_CO_Sensor: URIRef # Measures the concentration of CO in outside air + Outside_Air_Dewpoint_Sensor: ( + URIRef # Senses the dewpoint temperature of outside air + ) + Outside_Air_Enthalpy_Sensor: ( + URIRef # Measures the total heat content of outside air + ) + Outside_Air_Flow_Sensor: ( + URIRef # Measures the rate of flow of outside air into the system + ) + Outside_Air_Flow_Setpoint: URIRef # Sets outside air flow rate + Outside_Air_Grains_Sensor: URIRef # Measures the mass of water vapor in outside air + Outside_Air_Humidity_Sensor: URIRef # Measures the relative humidity of outside air + Outside_Air_Humidity_Setpoint: URIRef # Humidity setpoint for outside air + Outside_Air_Lockout_Temperature_Differential_Parameter: URIRef + Outside_Air_Lockout_Temperature_Setpoint: URIRef + Outside_Air_Temperature_Enable_Differential_Sensor: URIRef + Outside_Air_Temperature_High_Reset_Setpoint: URIRef + Outside_Air_Temperature_Low_Reset_Setpoint: URIRef + Outside_Air_Temperature_Sensor: URIRef # Measures the temperature of outside air + Outside_Air_Temperature_Setpoint: URIRef # Sets temperature of outside air + Outside_Air_Wet_Bulb_Temperature_Sensor: ( + URIRef # A sensor measuring the wet-bulb temperature of outside air + ) + Outside_Damper: URIRef # A damper that modulates the flow of outside air + Outside_Face_Surface_Temperature_Sensor: URIRef # Measures the outside surface (relative to the space) of the radiant panel of a radiant heating and cooling HVAC system. + Outside_Face_Surface_Temperature_Setpoint: URIRef # Sets temperature for the outside face surface temperature of the radiant panel. + Outside_Illuminance_Sensor: ( + URIRef # Measures the total luminous flux incident on an outside, per unit area + ) + Overload_Alarm: ( + URIRef # An alarm that can indicate when a full-load current is exceeded. + ) + Overridden_Off_Status: URIRef # Indicates if a control loop, relay or equipment has been turned off when it would otherwise be scheduled to be on + Overridden_On_Status: URIRef # Indicates if a control loop, relay or equipment has been turned on when it would otherwise be scheduled to be off + Overridden_Status: URIRef # Indicates if the expected operating status of an equipment or control loop has been overridden + Override_Command: URIRef # Controls or reports whether or not a device or control loop is in 'override' + Ozone_Level_Sensor: URIRef # Measures the concentration of ozone in air + PAU: URIRef # A type of AHU, use to pre-treat the outdoor air before feed to AHU + PID_Parameter: URIRef + PIR_Sensor: URIRef # Detects the presence of motion in some area using the differential change in infrared intensity between two or more receptors + PM10_Level_Sensor: URIRef # Detects level of particulates of size 10 microns + PM10_Sensor: URIRef # Detects matter of size 10 microns + PM1_Level_Sensor: URIRef # Detects level of particulates of size 1 microns + PM1_Sensor: URIRef # Detects matter of size 1 micron + PVT_Panel: URIRef # A type of solar panels that convert solar radiation into usable thermal and electrical energy + PV_Array: URIRef + PV_Current_Output_Sensor: URIRef # See Photovoltaic_Current_Output_Sensor + PV_Generation_System: ( + URIRef # A collection of photovoltaic devices that generates energy + ) + PV_Panel: URIRef # An integrated assembly of interconnected photovoltaic cells designed to deliver a selected level of working voltage and current at its output terminals packaged for protection against environment degradation and suited for incorporation in photovoltaic power systems. + Parameter: URIRef # Parameter points are configuration settings used to guide the operation of equipment and control systems; for example they may provide bounds on valid setpoint values + Parking_Level: URIRef # A floor of a parking structure + Parking_Space: URIRef # An area large enough to park an individual vehicle + Parking_Structure: ( + URIRef # A building or part of a building devoted to vehicle parking + ) + Particulate_Matter_Sensor: URIRef # Detects pollutants in the ambient air + Passive_Chilled_Beam: URIRef # A chilled beam that does not have an integral air supply and instead relies on natural convection to draw air through the device. + Peak_Power_Demand_Sensor: ( + URIRef # The peak power consumed by a process over some period of time + ) + Photovoltaic_Array: URIRef # A collection of photovoltaic panels + Photovoltaic_Current_Output_Sensor: URIRef # Senses the amperes of electrical current produced as output by a photovoltaic device + Piezoelectric_Sensor: URIRef # Senses changes pressure, acceleration, temperature, force or strain via the piezoelectric effect + PlugStrip: URIRef # A device containing a block of electrical sockets allowing multiple electrical devices to be powered from a single electrical socket. + Plumbing_Room: URIRef # A service room devoted to the operation and routing of water in a building. Usually distinct from the HVAC subsystems. + Point: URIRef + Portfolio: URIRef # A collection of sites + Position_Command: URIRef # Controls or reports the position of some object + Position_Limit: URIRef # A parameter that places a lower or upper bound on the range of permitted values of a Position_Setpoint. + Position_Sensor: URIRef # Measures the current position of a component in terms of a fraction of its full range of motion + Potable_Water: URIRef # Water that is safe to drink + Power_Alarm: URIRef # An alarm that indicates the off-normal conditions associated with electrical power. + Power_Loss_Alarm: URIRef # An alarm that indicates a power failure. + Power_Sensor: URIRef # Measures the amount of instantaneous power consumed + Prayer_Room: URIRef # A room set aside for prayer + Pre_Filter: URIRef # A filter installed in front of a more efficient filter to extend the life of the more expensive higher efficiency filter + Pre_Filter_Status: URIRef # Indicates if a prefilter needs to be replaced + Preheat_Demand_Setpoint: URIRef # Sets the rate required for preheat + Preheat_Discharge_Air_Temperature_Sensor: ( + URIRef # Measures the temperature of discharge air before heating is applied + ) + Preheat_Hot_Water_System: URIRef + Preheat_Hot_Water_Valve: URIRef + Preheat_Supply_Air_Temperature_Sensor: ( + URIRef # Measures the temperature of supply air before it is heated + ) + Pressure_Alarm: URIRef # An alarm that indicates the off-normal conditions associated with pressure. + Pressure_Sensor: URIRef # Measure the amount of force acting on a unit area + Pressure_Setpoint: URIRef # Sets pressure + Pressure_Status: URIRef # Indicates if pressure is within expected bounds + Private_Office: ( + URIRef # An office devoted to a single individual, with walls and door + ) + Proportional_Band_Parameter: URIRef + Proportional_Gain_Parameter: URIRef + Pump: URIRef # Machine for imparting energy to a fluid, causing it to do work, drawing a fluid into itself through an entrance port, and forcing the fluid out through an exhaust port. + Pump_Command: URIRef # Controls or reports the speed of a pump (typically as a proportion of its full pumping capacity) + Pump_On_Off_Status: URIRef + Pump_Room: URIRef # A mechanical room that houses pumps + Pump_VFD: URIRef # Variable-frequency drive for pumps + Quantity: URIRef + RC_Panel: URIRef # See Radiant_Ceiling_Panel + RTU: URIRef # see Rooftop_Unit + RVAV: URIRef # See Variable_Air_Volume_Box_With_Reheat + Radiant_Ceiling_Panel: URIRef # Radiant panel heating and cooling system that are usually made from metal and suspended under the ceiling or insulated from the building structure. + Radiant_Panel: URIRef # A temperature-controlled surface that provides fifty percent (50%) or more of the design heat transfer by thermal radiation. + Radiant_Panel_Temperature_Sensor: URIRef # Measures the temperature of the radiant panel of the radiant heating and cooling HVAC system. + Radiant_Panel_Temperature_Setpoint: URIRef # Sets temperature of radiant panel. + Radiation_Hot_Water_System: URIRef + Radiator: URIRef # Heat exchangers designed to transfer thermal energy from one medium to another + Radioactivity_Concentration_Sensor: ( + URIRef # Measures the concentration of radioactivity + ) + Radon_Concentration_Sensor: ( + URIRef # Measures the concentration of radioactivity due to radon + ) + Rain_Duration_Sensor: ( + URIRef # Measures the duration of precipitation within some time frame + ) + Rain_Sensor: URIRef # Measures the amount of precipitation fallen + Rated_Speed_Setpoint: URIRef # Sets rated speed + Reactive_Power_Sensor: URIRef # Measures the portion of power that, averaged over a complete cycle of the AC waveform, is due to stored energy which returns to the source in each cycle + Reception: URIRef # A space, usually in a lobby, where visitors to a building or space can go to after arriving at a building and inform building staff that they have arrived + Region: URIRef # A unit of geographic space, usually contiguous or somehow related to a geopolitical feature + Reheat_Hot_Water_System: URIRef + Reheat_Valve: URIRef # A valve that controls air temperature by modulating the amount of hot water flowing through a reheat coil + Relative_Humidity_Sensor: URIRef # Measures the present state of absolute humidity relative to a maximum humidity given the same temperature + Relief_Damper: URIRef # A damper that is a component of a Relief Air System, ensuring building doesn't become over-pressurised + Relief_Fan: URIRef # A fan that is a component of a Relief Air System, ensuring building doesn't become over-pressurised + Remotely_On_Off_Status: URIRef + Reset_Command: ( + URIRef # Commands that reset a flag, property or value to its default + ) + Reset_Setpoint: URIRef # Setpoints used in reset strategies + Rest_Room: URIRef # A room that provides toilets and washbowls. Alternate spelling of Restroom + Restroom: URIRef # A room that provides toilets and washbowls. + Retail_Room: URIRef # A space set aside for retail in a larger establishment, e.g. a gift shop in a hospital + Return_Air: URIRef # air removed from a space to be recirculated or exhausted. Air extracted from a space and totally or partially returned to an air conditioner, furnace, or other heating, cooling, or ventilating system. + Return_Air_CO2_Sensor: URIRef # Measures the concentration of CO2 in return air + Return_Air_CO2_Setpoint: URIRef # Sets some property of CO2 in Return Air + Return_Air_CO_Sensor: URIRef # Measures the concentration of CO in return air + Return_Air_Dewpoint_Sensor: URIRef # Senses the dewpoint temperature of return air + Return_Air_Differential_Pressure_Sensor: ( + URIRef # Measures the difference in pressure between the return and supply side + ) + Return_Air_Differential_Pressure_Setpoint: URIRef # Sets the target air differential pressure between an upstream and downstream point in a return air duct or conduit + Return_Air_Enthalpy_Sensor: URIRef # Measures the total heat content of return air + Return_Air_Filter: URIRef # Filters return air + Return_Air_Flow_Sensor: URIRef # Measures the rate of flow of return air + Return_Air_Grains_Sensor: URIRef # Measures the mass of water vapor in return air + Return_Air_Humidity_Sensor: URIRef # Measures the relative humidity of return air + Return_Air_Humidity_Setpoint: URIRef # Humidity setpoint for return air + Return_Air_Plenum: URIRef # A component of the HVAC the receives air from the room to recirculate or exhaust to or from the building + Return_Air_Temperature_Alarm: URIRef # An alarm that indicates the off-normal conditions associated with the temperature of return air. + Return_Air_Temperature_High_Reset_Setpoint: URIRef + Return_Air_Temperature_Low_Reset_Setpoint: URIRef + Return_Air_Temperature_Sensor: URIRef # Measures the temperature of return air + Return_Air_Temperature_Setpoint: URIRef # The target temperature for return air, often used as an approximation of zone air temperature + Return_Chilled_Water_Temperature_Setpoint: URIRef # Sets the temperature of return (downstream of the chilled water load) chilled water + Return_Condenser_Water: URIRef # In a condenser water loop, this is water being brought away from the condenser side of a heat-rejection device (e.g. chiller). It is the 'warm' side. + Return_Condenser_Water_Flow_Sensor: ( + URIRef # Measures the flow of the return condenser water + ) + Return_Condenser_Water_Temperature_Sensor: ( + URIRef # Measures the temperature of the return condenser water + ) + Return_Condenser_Water_Temperature_Setpoint: ( + URIRef # The temperature setpoint for the return condenser water + ) + Return_Damper: URIRef # A damper that modulates the flow of return air + Return_Fan: URIRef # Fan moving return air -- air that is circulated from the building back into the HVAC system + Return_Heating_Valve: ( + URIRef # A valve installed on the return side of a heat exchanger + ) + Return_Hot_Water: URIRef + Return_Hot_Water_Temperature_Setpoint: URIRef # Sets the temperature of return (downstream of the hot water load) hot water + Return_Water: ( + URIRef # The water is a system after it is used in a heat transfer cycle + ) + Return_Water_Flow_Sensor: URIRef + Return_Water_Temperature_Sensor: URIRef # Measures the temperature of return water + Return_Water_Temperature_Setpoint: URIRef # Sets the temperature of return water + Riser: URIRef # A vertical shaft indented for installing building infrastructure e.g., electrical wire, network communication wire, plumbing, etc + Rooftop: URIRef + Rooftop_Unit: URIRef # Packaged air conditioner mounted on a roof, the conditioned air being discharged directly into the rooms below or through a duct system. + Room: URIRef # Base class for all more specific room types. + Room_Air_Temperature_Setpoint: URIRef # Sets temperature of room air + Run_Enable_Command: URIRef + Run_Request_Status: ( + URIRef # Indicates if a request has been filed to start a device or equipment + ) + Run_Status: URIRef + Run_Time_Sensor: URIRef # Measures the duration for which a device was in an active or "on" state + Safety_Equipment: URIRef + Safety_Shower: URIRef + Safety_System: URIRef + Sash_Position_Sensor: URIRef # Measures the current position of a sash in terms of the percent of fully open + Schedule_Temperature_Setpoint: ( + URIRef # The current setpoint as indicated by the schedule + ) + Security_Equipment: URIRef + Security_Service_Room: ( + URIRef # A class of spaces used by the security staff of a facility + ) + Sensor: URIRef # A Sensor is an input point that represents the value of a device or instrument designed to detect and measure a variable (ASHRAE Dictionary). + Server_Room: URIRef + Service_Room: URIRef # A class of spaces related to the operations of building subsystems, e.g. HVAC, electrical, IT, plumbing, etc + Setpoint: ( + URIRef # A Setpoint is an input value at which the desired property is set + ) + Shading_System: URIRef # Devices that can control daylighting through various means + Shared_Office: URIRef # An office used by multiple people + Short_Cycle_Alarm: URIRef # An alarm that indicates a short cycle occurred. A short cycle occurs when a cooling cycle is prevented from completing its full cycle + Shower: URIRef # A space containing showers, usually adjacent to an athletic or execise area + Site: URIRef # A geographic region containing 0 or more buildings. Typically used as the encapsulating location for a collection of Brick entities through the hasSite/isSiteOf relationships + Smoke_Alarm: URIRef # An alarm that indicates the off-normal conditions associated with smoke. + Smoke_Detection_Alarm: URIRef + Solar_Azimuth_Angle_Sensor: URIRef # Measures the azimuth angle of the sun + Solar_Radiance_Sensor: URIRef # The amount of light that passes through or is emitted from the sun and falls within a given solid angle in a specified direction + Solar_Thermal_Collector: URIRef # A type of solar panels that converts solar radiation into thermal energy. + Solar_Zenith_Angle_Sensor: URIRef # Measures the zenith angle of the sun + Solid: URIRef # one of the three states or phases of matter characterized by stability of dimensions, relative incompressibility, and molecular motion held to limited oscillation. + Space: URIRef # A part of the physical world or a virtual world whose 3D spatial extent is bounded actually or theoretically, and provides for certain functions within the zone it is contained in. + Space_Heater: URIRef # A heater used to warm the air in an enclosed area, such as a room or office + Speed_Reset_Command: URIRef + Speed_Sensor: URIRef # Measures the magnitude of velocity of some form of movement + Speed_Setpoint: URIRef # Sets speed + Speed_Setpoint_Limit: URIRef # A parameter that places a lower or upper bound on the range of permitted values of a Speed_Setpoint. + Speed_Status: ( + URIRef # Indicates the operating speed of a device or equipment, e.g. fan + ) + Sports_Service_Room: URIRef # A class of spaces used in the support of sports + Stage_Enable_Command: URIRef # A point representing a discrete stage which the equipment should be operating at. The desired stage number should be identified by an entity property + Stage_Riser: URIRef # A low platform in a space or on a stage + Stages_Status: URIRef # Indicates which stage a control loop or equipment is in + Staircase: URIRef # A vertical space containing stairs + Standby_CRAC: URIRef # A CRAC that is activated as part of a lead/lag operation or when an alarm occurs in a primary unit + Standby_Fan: URIRef # Fan that is activated as part of a lead/lag operation or when a primary fan raises an alarm + Standby_Glycool_Unit_On_Off_Status: ( + URIRef # Indicates the on/off status of a standby glycool unit + ) + Standby_Load_Shed_Command: URIRef + Standby_Unit_On_Off_Status: URIRef # Indicates the on/off status of a standby unit + Start_Stop_Command: URIRef # A Start/Stop Command controls or reports the active/inactive status of a control sequence + Start_Stop_Status: URIRef # Indicates the active/inactive status of a control loop (but not equipment activities or relays -- use On/Off for this purpose) + Static_Pressure_Deadband_Setpoint: ( + URIRef # Sets the size of a deadband of static pressure + ) + Static_Pressure_Integral_Time_Parameter: URIRef + Static_Pressure_Proportional_Band_Parameter: URIRef + Static_Pressure_Sensor: URIRef # Measures resistance to airflow in a heating and cooling system's components and duct work + Static_Pressure_Setpoint: URIRef # Sets static pressure + Static_Pressure_Setpoint_Limit: URIRef # A parameter that places a lower or upper bound on the range of permitted values of a Static_Pressure_Setpoint. + Static_Pressure_Step_Parameter: URIRef + Status: URIRef # A Status is input point that reports the current operating mode, state, position, or condition of an item. Statuses are observations and should be considered 'read-only' + Steam: URIRef # water in the vapor phase. + Steam_Baseboard_Radiator: ( + URIRef # Steam heating device located at or near the floor + ) + Steam_Distribution: URIRef # Utilize a steam distribution source to represent how steam is distributed across multiple destinations + Steam_On_Off_Command: URIRef + Steam_Radiator: URIRef # Radiator that uses steam + Steam_System: URIRef # The equipment, devices and conduits that handle the production and distribution of steam in a building + Steam_Usage_Sensor: URIRef # Measures the amount of steam that is consumed or used, over some period of time + Steam_Valve: URIRef + Step_Parameter: URIRef + Storage_Room: URIRef # A class of spaces used for storage + Storey: URIRef + Studio: URIRef # A room used for the production or media, usually with either a specialized set or a specialized sound booth for recording + Substance: URIRef + Supply_Air: URIRef # (1) air delivered by mechanical or natural ventilation to a space, composed of any combination of outdoor air, recirculated air, or transfer air. (2) air entering a space from an air-conditioning, heating, or ventilating apparatus for the purpose of comfort conditioning. Supply air is generally filtered, fan forced, and either heated, cooled, humidified, or dehumidified as necessary to maintain specified conditions. Only the quantity of outdoor air within the supply airflow may be used as replacement air. + Supply_Air_Differential_Pressure_Sensor: URIRef # Measures the difference in pressure between an upstream and downstream of an air duct or other air conduit used to supply air into the building + Supply_Air_Differential_Pressure_Setpoint: URIRef # Sets the target air differential pressure between an upstream and downstream point in a supply air duct or conduit + Supply_Air_Duct_Pressure_Status: ( + URIRef # Indicates if air pressure in supply duct is within expected bounds + ) + Supply_Air_Flow_Demand_Setpoint: ( + URIRef # Sets the rate of supply air flow required for a process + ) + Supply_Air_Flow_Sensor: URIRef # Measures the rate of flow of supply air + Supply_Air_Flow_Setpoint: URIRef # Sets supply air flow rate + Supply_Air_Humidity_Sensor: URIRef # Measures the relative humidity of supply air + Supply_Air_Humidity_Setpoint: URIRef # Humidity setpoint for supply air + Supply_Air_Integral_Gain_Parameter: URIRef + Supply_Air_Plenum: URIRef # A component of the HVAC the receives air from the air handling unit to distribute to the building + Supply_Air_Proportional_Gain_Parameter: URIRef + Supply_Air_Static_Pressure_Deadband_Setpoint: ( + URIRef # Sets the size of a deadband of static pressure of supply air + ) + Supply_Air_Static_Pressure_Integral_Time_Parameter: URIRef + Supply_Air_Static_Pressure_Proportional_Band_Parameter: URIRef + Supply_Air_Static_Pressure_Sensor: ( + URIRef # The static pressure of air within supply regions of an HVAC system + ) + Supply_Air_Static_Pressure_Setpoint: URIRef # Sets static pressure of supply air + Supply_Air_Temperature_Alarm: URIRef # An alarm that indicates the off-normal conditions associated with the temperature of supply air. + Supply_Air_Temperature_Deadband_Setpoint: ( + URIRef # Sets the size of a deadband of temperature of supply air + ) + Supply_Air_Temperature_High_Reset_Setpoint: URIRef + Supply_Air_Temperature_Low_Reset_Setpoint: URIRef + Supply_Air_Temperature_Proportional_Band_Parameter: URIRef + Supply_Air_Temperature_Reset_Differential_Setpoint: URIRef + Supply_Air_Temperature_Sensor: URIRef # Measures the temperature of supply air + Supply_Air_Temperature_Setpoint: URIRef # Temperature setpoint for supply air + Supply_Air_Temperature_Step_Parameter: URIRef + Supply_Air_Velocity_Pressure_Sensor: URIRef + Supply_Chilled_Water: URIRef + Supply_Chilled_Water_Temperature_Setpoint: ( + URIRef # Temperature setpoint for supply chilled water + ) + Supply_Condenser_Water: URIRef # In a condenser water loop, this is water being brought to the condenser side of a heat-rejection device (e.g. chiller). It is the 'cold' side. + Supply_Condenser_Water_Flow_Sensor: ( + URIRef # Measures the flow of the supply condenser water + ) + Supply_Condenser_Water_Temperature_Sensor: ( + URIRef # Measures the temperature of the supply condenser water + ) + Supply_Condenser_Water_Temperature_Setpoint: ( + URIRef # The temperature setpoint for the supply condenser water + ) + Supply_Fan: URIRef # Fan moving supply air -- air that is supplied from the HVAC system into the building + Supply_Hot_Water: URIRef + Supply_Hot_Water_Temperature_Setpoint: ( + URIRef # Temperature setpoint for supply hot water + ) + Supply_Water: URIRef + Supply_Water_Differential_Pressure_Deadband_Setpoint: ( + URIRef # Sets the size of a deadband of differential pressure of supply water + ) + Supply_Water_Differential_Pressure_Integral_Time_Parameter: URIRef + Supply_Water_Differential_Pressure_Proportional_Band_Parameter: URIRef + Supply_Water_Flow_Sensor: URIRef # Measures the rate of flow of hot supply water + Supply_Water_Flow_Setpoint: URIRef # Sets the flow rate of hot supply water + Supply_Water_Temperature_Alarm: URIRef # An alarm that indicates the off-normal conditions associated with temperature of the supply water. + Supply_Water_Temperature_Deadband_Setpoint: ( + URIRef # Sets the size of a deadband of temperature of supply water + ) + Supply_Water_Temperature_Integral_Time_Parameter: URIRef + Supply_Water_Temperature_Proportional_Band_Parameter: URIRef + Supply_Water_Temperature_Setpoint: URIRef # Sets temperature of supply water + Surveillance_Camera: URIRef + Switch: URIRef # A switch used to operate all or part of a lighting installation + Switch_Room: URIRef # A telecommuncations room housing network switches + Switchgear: URIRef # A main disconnect or service disconnect feeds power to a switchgear, which then distributes power to the rest of the building through smaller amperage-rated disconnects. + System: URIRef # A System is a combination of equipment and auxiliary devices (e.g., controls, accessories, interconnecting means, and termi­nal elements) by which energy is transformed so it performs a specific function such as HVAC, service water heating, or lighting. (ASHRAE Dictionary). + System_Enable_Command: URIRef # Enables operation of a system + System_Shutdown_Status: URIRef # Indicates if a system has been shutdown + System_Status: URIRef # Indicates properties of the activity of a system + TABS_Panel: URIRef # See Thermally_Activated_Building_System_Panel + TETRA_Room: URIRef # A room used for local two-way radio networks, e.g. the portable radios carried by facilities staff + TVOC_Level_Sensor: URIRef # A sensor measuring the level of all VOCs in air + TVOC_Sensor: URIRef + Team_Room: URIRef # An office used by multiple team members for specific work tasks. Distinct from Conference Room + Telecom_Room: ( + URIRef # A class of spaces used to support telecommuncations and IT equipment + ) + Temperature_Alarm: URIRef # An alarm that indicates the off-normal conditions associated with temperature. + Temperature_Deadband_Setpoint: URIRef # Sets the size of a deadband of temperature + Temperature_Differential_Reset_Setpoint: URIRef + Temperature_High_Reset_Setpoint: URIRef + Temperature_Low_Reset_Setpoint: URIRef + Temperature_Parameter: ( + URIRef # Parameters relevant to temperature-related systems and points + ) + Temperature_Sensor: URIRef # Measures temperature: the physical property of matter that quantitatively expresses the common notions of hot and cold + Temperature_Setpoint: URIRef # Sets temperature + Temperature_Step_Parameter: URIRef + Temperature_Tolerance_Parameter: URIRef # A parameter determining the difference between upper and lower limits of temperature. + Temporary_Occupancy_Status: URIRef # For systems that differentiate between scheduled occupied/unoccupied mode, this indicates if a space is temporarily occupied when it would otherwise be unoccupied + Terminal_Unit: URIRef # A device that regulates the volumetric flow rate and/or the temperature of the controlled medium. + Thermal_Power_Meter: URIRef # A standalone thermal power meter + Thermal_Power_Sensor: URIRef + Thermally_Activated_Building_System_Panel: URIRef # Radiant panel heating and cooling system where the energy heat source or sink is embedded in the building structure such as in slabs and walls. + Thermostat: URIRef # An automatic control device used to maintain temperature at a fixed or adjustable setpoint. + Ticketing_Booth: URIRef # A room or space used to sell or distribute tickets to events at a venue + Time_Parameter: URIRef + Time_Setpoint: URIRef + Tolerance_Parameter: URIRef # difference between upper and lower limits of size for a given nominal dimension or value. + Torque_Sensor: URIRef # Measures torque, the tendency of a force to rotate an object about some axis + Touchpanel: URIRef # A switch used to operate all or part of a lighting installation that uses a touch-based mechanism (typically resistive or capacitive) rather than a mechanical actuator + Trace_Heat_Sensor: URIRef # Measures the surface temperature of pipelines carrying temperature-sensitive products; typically used to avoid frosting/freezing + Transformer: URIRef # A Transformer is usually fed by a high-voltage source and then steps down the voltage to a lower-voltage feed for low-voltage application (such as lights). Transformers also can step up voltage, but this generally does not apply to in building distribution. + Transformer_Room: URIRef # An electrical room where electricity enters and is transformed to different voltages and currents by the equipment contained in the room + Tunnel: URIRef # An enclosed space that connects buildings. Often underground + Underfloor_Air_Plenum: URIRef # An open space between a structural concrete slab and the underside of a raised access floor system that connects to an air handling unit to receive conditioned and/or ventilating air before delivery to the room(s) + Underfloor_Air_Plenum_Static_Pressure_Sensor: URIRef # Measures the outward push of air against the plenum surfaces and used to measure the resistance when air moves through the plenum + Underfloor_Air_Plenum_Static_Pressure_Setpoint: ( + URIRef # Sets the underfloor air plenum static pressure + ) + Underfloor_Air_Temperature_Sensor: ( + URIRef # Measures the temperature of underfloor air + ) + Unit_Failure_Alarm: ( + URIRef # An alarm that indicates the failure of an equipment or device + ) + Unoccupied_Air_Temperature_Cooling_Setpoint: ( + URIRef # Sets temperature of air when unoccupied for cooling + ) + Unoccupied_Air_Temperature_Heating_Setpoint: ( + URIRef # Sets temperature of air when unoccupied for heating + ) + Unoccupied_Air_Temperature_Setpoint: ( + URIRef # Sets temperature of air when unoccupied + ) + Unoccupied_Cooling_Discharge_Air_Flow_Setpoint: ( + URIRef # Sets discharge air flow for cooling when unoccupied + ) + Unoccupied_Discharge_Air_Temperature_Setpoint: URIRef + Unoccupied_Load_Shed_Command: URIRef + Unoccupied_Return_Air_Temperature_Setpoint: URIRef + Unoccupied_Room_Air_Temperature_Setpoint: URIRef + Unoccupied_Supply_Air_Temperature_Setpoint: URIRef + Unoccupied_Zone_Air_Temperature_Setpoint: URIRef + Usage_Sensor: URIRef # Measures the amount of some substance that is consumed or used, over some period of time + VAV: URIRef # See Variable_Air_Volume_Box + VFD: URIRef # Electronic device that varies its output frequency to vary the rotating speed of a motor, given a fixed input frequency. Used with fans or pumps to vary the flow in the system as a function of a maintained pressure. + VFD_Enable_Command: URIRef # Enables operation of a variable frequency drive + Valve: URIRef # A device that regulates, directs or controls the flow of a fluid by opening, closing or partially obstructing various passageways + Valve_Command: URIRef # Controls or reports the openness of a valve (typically as a proportion of its full range of motion) + Valve_Position_Sensor: URIRef # Measures the current position of a valve in terms of the percent of fully open + Variable_Air_Volume_Box: URIRef # A device that regulates the volume and temperature of air delivered to a zone by opening or closing a damper + Variable_Air_Volume_Box_With_Reheat: URIRef # A VAV box with a reheat coil mounted on the discharge end of the unit that can heat the air delivered to a zone + Variable_Frequency_Drive: URIRef # Electronic device that varies its output frequency to vary the rotating speed of a motor, given a fixed input frequency. Used with fans or pumps to vary the flow in the system as a function of a maintained pressure. + Velocity_Pressure_Sensor: ( + URIRef # Measures the difference between total pressure and static pressure + ) + Velocity_Pressure_Setpoint: URIRef # Sets static veloicty pressure + Vent_Operating_Mode_Status: URIRef # Indicates the current operating mode of a vent + Ventilation_Air_Flow_Ratio_Limit: URIRef # A parameter that places a lower or upper bound on the range of permitted values of a Ventilation_Air_Flow_Ratio_Setpoint. + Ventilation_Air_System: URIRef # The equipment, devices, and conduits that handle the introduction and distribution of ventilation air in the building + Vertical_Space: ( + URIRef # A class of spaces used to connect multiple floors or levels.. + ) + Video_Intercom: URIRef + Video_Surveillance_Equipment: URIRef + Visitor_Lobby: URIRef # A lobby for visitors to the building. Sometimes used to distinguish from an employee entrance looby + Voltage_Imbalance_Sensor: URIRef # A sensor which measures the voltage difference (imbalance) between phases of an electrical system + Voltage_Sensor: URIRef # Measures the voltage of an electrical device or object + Wardrobe: URIRef # Storage for clothing, costumes, or uniforms + Warm_Cool_Adjust_Sensor: URIRef # User provided adjustment of zone temperature, typically in the range of +/- 5 degrees + Warmest_Zone_Air_Temperature_Sensor: URIRef # The zone temperature that is warmest; drives the supply temperature of cold air. A computed value rather than a physical sensor. Also referred to as a 'Highest Zone Air Temperature Sensor' + Waste_Storage: URIRef # A room used for storing waste such as trash or recycling + Water: URIRef # transparent, odorless, tasteless liquid; a compound of hydrogen and oxygen (H2O), containing 11.188% hydrogen and 88.812% oxygen by mass; freezing at 32°F (0°C); boiling near 212°F (100°C). + Water_Alarm: URIRef # Alarm that indicates an undesirable event with a pipe, container, or equipment carrying water e.g. water leak + Water_Differential_Pressure_Setpoint: URIRef # Sets the target water differential pressure between an upstream and downstream point in a water pipe or conduit + Water_Differential_Temperature_Sensor: URIRef # Measures the difference in water temperature between an upstream and downstream point in a pipe or conduit + Water_Differential_Temperature_Setpoint: URIRef # Sets the target differential temperature between the start and end of a heat transfer cycle in a water circuit + Water_Distribution: URIRef # Utilize a water distribution source to represent how water is distributed across multiple destinations (pipes) + Water_Flow_Sensor: URIRef # Measures the rate of flow of water + Water_Flow_Setpoint: URIRef # Sets the target flow rate of water + Water_Heater: URIRef # An apparatus for heating and usually storing hot water + Water_Level_Alarm: ( + URIRef # An alarm that indicates a high or low water level e.g. in a basin + ) + Water_Level_Sensor: URIRef # Measures the height/level of water in some container + Water_Loop: URIRef # A collection of equipment that transport and regulate water among each other + Water_Loss_Alarm: ( + URIRef # An alarm that indicates a loss of water e.g. during transport + ) + Water_Meter: URIRef # A meter that measures the usage or consumption of water + Water_Pump: URIRef # A pump that performs work on water + Water_System: URIRef # The equipment, devices and conduits that handle the production and distribution of water in a building + Water_Tank: URIRef # A space used to hold water + Water_Temperature_Alarm: URIRef # An alarm that indicates the off-normal conditions associated with temperature of water. + Water_Temperature_Sensor: URIRef # Measures the temperature of water + Water_Temperature_Setpoint: URIRef # Sets temperature of water + Water_Usage_Sensor: URIRef # Measures the amount of water that is consumed, over some period of time + Water_Valve: URIRef # A valve that modulates the flow of water + Weather_Station: URIRef # A dedicated weather measurement station + Wind_Direction_Sensor: ( + URIRef # Measures the direction of wind in degrees relative to North + ) + Wind_Speed_Sensor: ( + URIRef # Measured speed of wind, caused by air moving from high to low pressure + ) + Wing: URIRef # A wing is part of a building – or any feature of a building – that is subordinate to the main, central structure. + Workshop: URIRef # A space used to house equipment that can be used to repair or fabricate things + Zone: URIRef # (1) a separately controlled heated or cooled space. (2) one occupied space or several occupied spaces with similar occupancy category, occupant density, zone air distribution effectiveness, and zone primary airflow per unit area. (3) space or group of spaces within a building for which the heating, cooling, or lighting requirements are sufficiently similar that desired conditions can be maintained throughout by a single controlling device. + Zone_Air: URIRef # air inside a defined zone (e.g., corridors). + Zone_Air_Cooling_Temperature_Setpoint: ( + URIRef # The upper (cooling) setpoint for zone air temperature + ) + Zone_Air_Dewpoint_Sensor: URIRef # Measures dewpoint of zone air + Zone_Air_Heating_Temperature_Setpoint: ( + URIRef # The lower (heating) setpoint for zone air temperature + ) + Zone_Air_Humidity_Sensor: URIRef # Measures the relative humidity of zone air + Zone_Air_Humidity_Setpoint: URIRef # Humidity setpoint for zone air + Zone_Air_Temperature_Sensor: URIRef # Measures the temperature of air in a zone + Zone_Air_Temperature_Setpoint: URIRef # Sets temperature of zone air + Zone_Standby_Load_Shed_Command: URIRef + Zone_Unoccupied_Load_Shed_Command: URIRef + + # http://www.w3.org/2002/07/owl#Property + feeds: URIRef # The subject is upstream of the object in the context of some sequential process; some media is passed between them + feedsAir: URIRef # Passes air + hasAddress: URIRef # To specify the address of a building. + hasAssociatedTag: URIRef # The class is associated with the given tag + hasInputSubstance: URIRef # The subject receives the given substance as an input to its internal process + hasLocation: ( + URIRef # Subject is physically located in the location given by the object + ) + hasOutputSubstance: URIRef # The subject produces or exports the given substance from its internal process + hasPart: URIRef # The subject is composed in part of the entity given by the object + hasPoint: URIRef # The subject has a source of telemetry identified by the object. In some systems the source of telemetry may be represented as a digital/analog input/output point + hasQUDTReference: URIRef # Points to the relevant QUDT definition + hasTag: URIRef # The subject has the given tag + hasTimeseriesId: URIRef # The unique identifier (primary key) for this TimeseriesReference in some database + hasUnit: URIRef # The QUDT unit associated with this Brick entity (usually a Brick Point instance or Entity Property) + isAssociatedWith: URIRef # The tag is associated with the given class + isFedBy: URIRef + isLocationOf: URIRef # Subject is the physical location encapsulating the object + isMeasuredBy: URIRef + isPartOf: URIRef + isPointOf: URIRef # The subject is a source of telemetry related to the object. In some systems the source of telemetry may be represented as a digital/analog input/output point + isRegulatedBy: URIRef + isTagOf: URIRef + latitude: URIRef + longitude: URIRef + measures: URIRef # The subject measures a quantity or substance given by the object + regulates: URIRef # The subject contributes to or performs the regulation of the substance given by the object + storedAt: ( + URIRef # A reference to where the data for this TimeseriesReference is stored + ) + timeseries: URIRef # Relates a Brick point to the TimeseriesReference that indicates where and how the data for this point is stored + value: URIRef # The basic value of an entity property + + # https://brickschema.org/schema/Brick#EntityProperty + aggregate: URIRef # Description of how the dta for this point is aggregated + area: URIRef # Entity has 2-dimensional area + azimuth: URIRef # (Horizontal) angle between a projected vector and a reference vector (typically a compass bearing). The projected vector usually indicates the direction of a face or plane. + buildingPrimaryFunction: URIRef # Enumerated string applied to a site record to indicate the building's primary function. The list of primary functions is derived from the US Energy Star program (adopted from Project Haystack) + buildingThermalTransmittance: URIRef # The area-weighted average heat transfer coefficient (commonly referred to as a U-value) for a building envelope + conversionEfficiency: URIRef # The percent efficiency of the conversion process (usually to power or energy) carried out by the entity + coolingCapacity: URIRef # Measurement of a chiller ability to remove heat (adopted from Project Haystack) + coordinates: URIRef # The location of an entity in latitude/longitude + currentFlowType: URIRef # The current flow type of the entity + electricalPhaseCount: URIRef # Entity has these phases + electricalPhases: URIRef # Entity has these electrical AC phases + grossArea: URIRef # Entity has gross 2-dimensional area + measuredModuleConversionEfficiency: URIRef # The measured percentage of sunlight that is converted into usable power + measuredPowerOutput: URIRef # The nominal measured power output of the entity + netArea: URIRef # Entity has net 2-dimensional area + operationalStage: URIRef # The associated operational stage + operationalStageCount: ( + URIRef # The number of operational stages supported by this eqiupment + ) + panelArea: URIRef # Surface area of a panel, such as a PV panel + powerComplexity: URIRef # Entity has this power complexity + powerFlow: URIRef # Entity has this power flow relative to the building' + ratedModuleConversionEfficiency: URIRef # The *rated* percentage of sunlight that is converted into usable power, as measured using Standard Test Conditions (STC): 1000 W/sqm irradiance, 25 degC panel temperature, no wind + ratedPowerOutput: URIRef # The nominal rated power output of the entity + temperatureCoefficientofPmax: URIRef # The % change in power output for every degree celsius that the entity is hotter than 25 degrees celsius + thermalTransmittance: URIRef # The area-weighted average heat transfer coefficient (commonly referred to as a U-value) + tilt: URIRef # The direction an entity is facing in degrees above the horizon + volume: URIRef # Entity has 3-dimensional volume + yearBuilt: URIRef # Four digit year that a building was first built. (adopted from Project Haystack) + + _extras = ["PM2.5_Sensor", "PM2.5_Level_Sensor"] + + _NS = Namespace("https://brickschema.org/schema/Brick#") diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_CSVW.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_CSVW.py new file mode 100644 index 0000000000000000000000000000000000000000..73eb661b8ecfdb1c43058e3003fed8fa04c4c222 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_CSVW.py @@ -0,0 +1,118 @@ +from rdflib.namespace import DefinedNamespace, Namespace +from rdflib.term import URIRef + + +class CSVW(DefinedNamespace): + """ + CSVW Namespace Vocabulary Terms + + This document describes the RDFS vocabulary description used in the Metadata Vocabulary for Tabular Data + [[tabular-metadata]] along with the default JSON-LD Context. + + Generated from: http://www.w3.org/ns/csvw + Date: 2020-05-26 14:19:58.184766 + + """ + + _fail = True + + # http://www.w3.org/1999/02/22-rdf-syntax-ns#Property + aboutUrl: URIRef # A URI template property that MAY be used to indicate what a cell contains information about. + base: URIRef # An atomic property that contains a single string: a term defined in the default context representing a built-in datatype URL, as listed above. + column: URIRef # An array property of column descriptions as described in section 5.6 Columns. + columnReference: URIRef # A column reference property that holds either a single reference to a column description object within this schema, or an array of references. These form the referencing columns for the foreign key definition. + commentPrefix: URIRef # An atomic property that sets the comment prefix flag to the single provided value, which MUST be a string. + datatype: URIRef # An object property that contains either a single string that is the main datatype of the values of the cell or a datatype description object. If the value of this property is a string, it MUST be one of the built-in datatypes defined in section 5.11.1 Built-in Datatypes or an absolute URL; if it is an object then it describes a more specialised datatype. + decimalChar: URIRef # A string whose value is used to represent a decimal point within the number. + default: URIRef # An atomic property holding a single string that is used to create a default value for the cell in cases where the original string value is an empty string. + delimiter: URIRef # An atomic property that sets the delimiter flag to the single provided value, which MUST be a string. + describes: URIRef # From IANA describes: The relationship A 'describes' B asserts that resource A provides a description of resource B. There are no constraints on the format or representation of either A or B, neither are there any further constraints on either resource. + dialect: URIRef # An object property that provides a single dialect description. If provided, dialect provides hints to processors about how to parse the referenced files to create tabular data models for the tables in the group. + doubleQuote: URIRef # A boolean atomic property that, if `true`, sets the escape character flag to `"`. + encoding: URIRef # An atomic property that sets the encoding flag to the single provided string value, which MUST be a defined in [[encoding]]. The default is "utf-8". + foreignKey: URIRef # For a Table: a list of foreign keys on the table. For a Schema: an array property of foreign key definitions that define how the values from specified columns within this table link to rows within this table or other tables. + format: URIRef # An atomic property that contains either a single string or an object that defines the format of a value of this type, used when parsing a string value as described in Parsing Cells in [[tabular-data-model]]. + groupChar: URIRef # A string whose value is used to group digits within the number. + header: URIRef # A boolean atomic property that, if `true`, sets the header row count flag to `1`, and if `false` to `0`, unless headerRowCount is provided, in which case the value provided for the header property is ignored. + headerRowCount: URIRef # An numeric atomic property that sets the header row count flag to the single provided value, which must be a non-negative integer. + lang: URIRef # An atomic property giving a single string language code as defined by [[BCP47]]. + length: URIRef # The exact length of the value of the cell. + lineTerminators: URIRef # An atomic property that sets the line terminators flag to either an array containing the single provided string value, or the provided array. + maxExclusive: URIRef # An atomic property that contains a single number that is the maximum valid value (exclusive). + maxInclusive: URIRef # An atomic property that contains a single number that is the maximum valid value (inclusive). + maxLength: URIRef # A numeric atomic property that contains a single integer that is the maximum length of the value. + minExclusive: URIRef # An atomic property that contains a single number that is the minimum valid value (exclusive). + minInclusive: URIRef # An atomic property that contains a single number that is the minimum valid value (inclusive). + minLength: URIRef # An atomic property that contains a single integer that is the minimum length of the value. + name: URIRef # An atomic property that gives a single canonical name for the column. The value of this property becomes the name annotation for the described column. + note: URIRef # An array property that provides an array of objects representing arbitrary annotations on the annotated tabular data model. + null: URIRef # An atomic property giving the string or strings used for null values within the data. If the string value of the cell is equal to any one of these values, the cell value is `null`. + ordered: URIRef # A boolean atomic property taking a single value which indicates whether a list that is the value of the cell is ordered (if `true`) or unordered (if `false`). + pattern: URIRef # A regular expression string, in the syntax and interpreted as defined by [[ECMASCRIPT]]. + primaryKey: URIRef # For Schema: A column reference property that holds either a single reference to a column description object or an array of references. For Row: a possibly empty list of cells whose values together provide a unique identifier for this row. This is similar to the name of a column. + propertyUrl: URIRef # An URI template property that MAY be used to create a URI for a property if the table is mapped to another format. + quoteChar: URIRef # An atomic property that sets the quote character flag to the single provided value, which must be a string or `null`. + reference: URIRef # An object property that identifies a **referenced table** and a set of **referenced columns** within that table. + referencedRow: URIRef # A possibly empty list of pairs of a foreign key and a row in a table within the same group of tables. + required: URIRef # A boolean atomic property taking a single value which indicates whether the cell must have a non-null value. The default is `false`. + resource: URIRef # A link property holding a URL that is the identifier for a specific table that is being referenced. + row: URIRef # Relates a Table to each Row output. + rowTitle: URIRef # A column reference property that holds either a single reference to a column description object or an array of references. + rownum: URIRef # The position of the row amongst the rows of the Annotated Tabl, starting from 1 + schemaReference: URIRef # A link property holding a URL that is the identifier for a schema that is being referenced. + scriptFormat: URIRef # A link property giving the single URL for the format that is used by the script or template. + separator: URIRef # An atomic property that MUST have a single string value that is the character used to separate items in the string value of the cell. + skipBlankRows: URIRef # An boolean atomic property that sets the `skip blank rows` flag to the single provided boolean value. + skipColumns: URIRef # An numeric atomic property that sets the `skip columns` flag to the single provided numeric value, which MUST be a non-negative integer. + skipInitialSpace: URIRef # A boolean atomic property that, if `true`, sets the trim flag to "start". If `false`, to `false`. + skipRows: URIRef # An numeric atomic property that sets the `skip rows` flag to the single provided numeric value, which MUST be a non-negative integer. + source: URIRef # A single string atomic property that provides, if specified, the format to which the tabular data should be transformed prior to the transformation using the script or template. + suppressOutput: URIRef # A boolean atomic property. If `true`, suppresses any output that would be generated when converting a table or cells within a column. + table: URIRef # Relates an Table group to annotated tables. + tableDirection: URIRef # One of `rtl`, `ltr` or `auto`. Indicates whether the tables in the group should be displayed with the first column on the right, on the left, or based on the first character in the table that has a specific direction. + tableSchema: URIRef # An object property that provides a single schema description as described in section 5.5 Schemas, used as the default for all the tables in the group + targetFormat: URIRef # A link property giving the single URL for the format that will be created through the transformation. + textDirection: URIRef # An atomic property that must have a single value that is one of `rtl` or `ltr` (the default). + title: URIRef # For a Transformation A natural language property that describes the format that will be generated from the transformation. For a Column: A natural language property that provides possible alternative names for the column. + transformations: URIRef # An array property of transformation definitions that provide mechanisms to transform the tabular data into other formats. + trim: URIRef # An atomic property that, if the boolean `true`, sets the trim flag to `true` and if the boolean `false` to `false`. If the value provided is a string, sets the trim flag to the provided value, which must be one of "true", "false", "start" or "end". + url: URIRef # For a Table: This link property gives the single URL of the CSV file that the table is held in, relative to the location of the metadata document. For a Transformation: A link property giving the single URL of the file that the script or template is held in, relative to the location of the metadata document. + valueUrl: URIRef # An URI template property that is used to map the values of cells into URLs. + virtual: URIRef # A boolean atomic property taking a single value which indicates whether the column is a virtual column not present in the original source + + # http://www.w3.org/2000/01/rdf-schema#Class + Cell: URIRef # A Cell represents a cell at the intersection of a Row and a Column within a Table. + Column: ( + URIRef # A Column represents a vertical arrangement of Cells within a Table. + ) + Datatype: URIRef # Describes facets of a datatype. + Dialect: URIRef # A Dialect Description provides hints to parsers about how to parse a linked file. + Direction: URIRef # The class of table/text directions. + ForeignKey: URIRef # Describes relationships between Columns in one or more Tables. + NumericFormat: URIRef # If the datatype is a numeric type, the format property indicates the expected format for that number. Its value must be either a single string or an object with one or more properties. + Row: URIRef # A Row represents a horizontal arrangement of cells within a Table. + Schema: URIRef # A Schema is a definition of a tabular format that may be common to multiple tables. + Table: URIRef # An annotated table is a table that is annotated with additional metadata. + TableGroup: URIRef # A Group of Tables comprises a set of Annotated Tables and a set of annotations that relate to those Tables. + TableReference: URIRef # An object property that identifies a referenced table and a set of referenced columns within that table. + Transformation: URIRef # A Transformation Definition is a definition of how tabular data can be transformed into another format. + + # http://www.w3.org/2000/01/rdf-schema#Datatype + JSON: URIRef # A literal containing JSON. + uriTemplate: URIRef # + + # http://www.w3.org/ns/csvw#Direction + auto: URIRef # Indicates whether the tables in the group should be displayed based on the first character in the table that has a specific direction. + inherit: URIRef # For `textDirection`, indicates that the direction is inherited from the `tableDirection` annotation of the `table`. + ltr: URIRef # Indicates whether the tables in the group should be displayed with the first column on the right. + rtl: URIRef # Indicates whether the tables in the group should be displayed with the first column on the left. + + # http://www.w3.org/ns/prov#Role + csvEncodedTabularData: ( + URIRef # Describes the role of a CSV file in the tabular data mapping. + ) + tabularMetadata: ( + URIRef # Describes the role of a Metadata file in the tabular data mapping. + ) + + _NS = Namespace("http://www.w3.org/ns/csvw#") diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_DC.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_DC.py new file mode 100644 index 0000000000000000000000000000000000000000..fa175c22de65439622929069e68f404a9fa8c179 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_DC.py @@ -0,0 +1,37 @@ +from rdflib.namespace import DefinedNamespace, Namespace +from rdflib.term import URIRef + + +class DC(DefinedNamespace): + """ + Dublin Core Metadata Element Set, Version 1.1 + + Generated from: https://www.dublincore.org/specifications/dublin-core/dcmi-terms/dublin_core_elements.ttl + Date: 2020-05-26 14:19:58.671906 + + """ + + _fail = True + + # http://www.w3.org/1999/02/22-rdf-syntax-ns#Property + contributor: ( + URIRef # An entity responsible for making contributions to the resource. + ) + coverage: URIRef # The spatial or temporal topic of the resource, spatial applicability of the resource, or jurisdiction under which the resource is relevant. + creator: URIRef # An entity primarily responsible for making the resource. + date: URIRef # A point or period of time associated with an event in the lifecycle of the resource. + description: URIRef # An account of the resource. + format: URIRef # The file format, physical medium, or dimensions of the resource. + identifier: ( + URIRef # An unambiguous reference to the resource within a given context. + ) + language: URIRef # A language of the resource. + publisher: URIRef # An entity responsible for making the resource available. + relation: URIRef # A related resource. + rights: URIRef # Information about rights held in and over the resource. + source: URIRef # A related resource from which the described resource is derived. + subject: URIRef # The topic of the resource. + title: URIRef # A name given to the resource. + type: URIRef # The nature or genre of the resource. + + _NS = Namespace("http://purl.org/dc/elements/1.1/") diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_DCAM.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_DCAM.py new file mode 100644 index 0000000000000000000000000000000000000000..4d55067980cb473f0122a9f94a94aedf16f1df37 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_DCAM.py @@ -0,0 +1,24 @@ +from rdflib.namespace import DefinedNamespace, Namespace +from rdflib.term import URIRef + + +class DCAM(DefinedNamespace): + """ + Metadata terms for vocabulary description + + Generated from: https://www.dublincore.org/specifications/dublin-core/dcmi-terms/dublin_core_abstract_model.ttl + Date: 2020-05-26 14:20:00.970966 + + """ + + _fail = True + + # http://www.w3.org/1999/02/22-rdf-syntax-ns#Property + domainIncludes: URIRef # A suggested class for subjects of this property. + memberOf: URIRef # A relationship between a resource and a vocabulary encoding scheme which indicates that the resource is a member of a set. + rangeIncludes: URIRef # A suggested class for values of this property. + + # http://www.w3.org/2000/01/rdf-schema#Class + VocabularyEncodingScheme: URIRef # An enumerated set of resources. + + _NS = Namespace("http://purl.org/dc/dcam/") diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_DCAT.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_DCAT.py new file mode 100644 index 0000000000000000000000000000000000000000..8abcf1f38ae9df0eedaa66dfb93422aeb8d30a12 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_DCAT.py @@ -0,0 +1,71 @@ +from rdflib.namespace import DefinedNamespace, Namespace +from rdflib.term import URIRef + + +class DCAT(DefinedNamespace): + """ + The data catalog vocabulary + + DCAT is an RDF vocabulary designed to facilitate interoperability between data catalogs published on the Web. + By using DCAT to describe datasets in data catalogs, publishers increase discoverability and enable + applications easily to consume metadata from multiple catalogs. It further enables decentralized publishing of + catalogs and facilitates federated dataset search across sites. Aggregated DCAT metadata can serve as a + manifest file to facilitate digital preservation. DCAT is defined at http://www.w3.org/TR/vocab-dcat/. Any + variance between that normative document and this schema is an error in this schema. + + Generated from: https://www.w3.org/ns/dcat2.ttl + Date: 2020-05-26 14:19:59.985854 + + """ + + # http://www.w3.org/1999/02/22-rdf-syntax-ns#Property + accessURL: URIRef # A URL of a resource that gives access to a distribution of the dataset. E.g. landing page, feed, SPARQL endpoint. Use for all cases except a simple download link, in which case downloadURL is preferred. + bbox: URIRef # The geographic bounding box of a resource. + byteSize: URIRef # The size of a distribution in bytes. + centroid: URIRef # The geographic center (centroid) of a resource. + compressFormat: URIRef # The compression format of the distribution in which the data is contained in a compressed form, e.g. to reduce the size of the downloadable file. + contactPoint: URIRef # Relevant contact information for the catalogued resource. Use of vCard is recommended. + dataset: URIRef # A collection of data that is listed in the catalog. + distribution: URIRef # An available distribution of the dataset. + downloadURL: URIRef # The URL of the downloadable file in a given format. E.g. CSV file or RDF file. The format is indicated by the distribution's dct:format and/or dcat:mediaType. + endDate: URIRef # The end of the period. + keyword: URIRef # A keyword or tag describing a resource. + landingPage: URIRef # A Web page that can be navigated to in a Web browser to gain access to the catalog, a dataset, its distributions and/or additional information. + mediaType: URIRef # The media type of the distribution as defined by IANA. + packageFormat: URIRef # The package format of the distribution in which one or more data files are grouped together, e.g. to enable a set of related files to be downloaded together. + record: URIRef # A record describing the registration of a single dataset or data service that is part of the catalog. + startDate: URIRef # The start of the period + theme: ( + URIRef # A main category of the resource. A resource can have multiple themes. + ) + themeTaxonomy: URIRef # The knowledge organization system (KOS) used to classify catalog's datasets. + + # http://www.w3.org/2000/01/rdf-schema#Class + Catalog: URIRef # A curated collection of metadata about resources (e.g., datasets and data services in the context of a data catalog). + CatalogRecord: URIRef # A record in a data catalog, describing the registration of a single dataset or data service. + Dataset: URIRef # A collection of data, published or curated by a single source, and available for access or download in one or more representations. + Distribution: URIRef # A specific representation of a dataset. A dataset might be available in multiple serializations that may differ in various ways, including natural language, media-type or format, schematic organization, temporal and spatial resolution, level of detail or profiles (which might specify any or all of the above). + + # http://www.w3.org/2002/07/owl#Class + DataService: URIRef # A site or end-point providing operations related to the discovery of, access to, or processing functions on, data or related resources. + Relationship: URIRef # An association class for attaching additional information to a relationship between DCAT Resources. + Resource: URIRef # Resource published or curated by a single agent. + Role: URIRef # A role is the function of a resource or agent with respect to another resource, in the context of resource attribution or resource relationships. + + # http://www.w3.org/2002/07/owl#DatatypeProperty + spatialResolutionInMeters: URIRef # mínima separacíon espacial disponible en un conjunto de datos, medida en metros. + temporalResolution: URIRef # minimum time period resolvable in a dataset. + + # http://www.w3.org/2002/07/owl#ObjectProperty + accessService: URIRef # A site or end-point that gives access to the distribution of the dataset. + catalog: URIRef # A catalog whose contents are of interest in the context of this catalog. + endpointDescription: URIRef # A description of the service end-point, including its operations, parameters etc. + endpointURL: URIRef # The root location or primary endpoint of the service (a web-resolvable IRI). + hadRole: URIRef # The function of an entity or agent with respect to another entity or resource. + qualifiedRelation: ( + URIRef # Link to a description of a relationship with another resource. + ) + servesDataset: URIRef # A collection of data that this DataService can distribute. + service: URIRef # A site or endpoint that is listed in the catalog. + + _NS = Namespace("http://www.w3.org/ns/dcat#") diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_DCMITYPE.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_DCMITYPE.py new file mode 100644 index 0000000000000000000000000000000000000000..d6b0ac953ee7133e927a5e39f2690c29063edad4 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_DCMITYPE.py @@ -0,0 +1,30 @@ +from rdflib.namespace import DefinedNamespace, Namespace +from rdflib.term import URIRef + + +class DCMITYPE(DefinedNamespace): + """ + DCMI Type Vocabulary + + Generated from: https://www.dublincore.org/specifications/dublin-core/dcmi-terms/dublin_core_type.ttl + Date: 2020-05-26 14:19:59.084150 + + """ + + _fail = True + + # http://www.w3.org/2000/01/rdf-schema#Class + Collection: URIRef # An aggregation of resources. + Dataset: URIRef # Data encoded in a defined structure. + Event: URIRef # A non-persistent, time-based occurrence. + Image: URIRef # A visual representation other than text. + InteractiveResource: URIRef # A resource requiring interaction from the user to be understood, executed, or experienced. + MovingImage: URIRef # A series of visual representations imparting an impression of motion when shown in succession. + PhysicalObject: URIRef # An inanimate, three-dimensional object or substance. + Service: URIRef # A system that provides one or more functions. + Software: URIRef # A computer program in source or compiled form. + Sound: URIRef # A resource primarily intended to be heard. + StillImage: URIRef # A static visual representation. + Text: URIRef # A resource consisting primarily of words for reading. + + _NS = Namespace("http://purl.org/dc/dcmitype/") diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_DCTERMS.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_DCTERMS.py new file mode 100644 index 0000000000000000000000000000000000000000..d3548f4badb57fae4e7a6246f6f4602c823605d6 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_DCTERMS.py @@ -0,0 +1,139 @@ +from rdflib.namespace import DefinedNamespace, Namespace +from rdflib.term import URIRef + + +class DCTERMS(DefinedNamespace): + """ + DCMI Metadata Terms - other + + Generated from: https://www.dublincore.org/specifications/dublin-core/dcmi-terms/dublin_core_terms.ttl + Date: 2020-05-26 14:20:00.590514 + + """ + + _fail = True + + # http://purl.org/dc/dcam/VocabularyEncodingScheme + DCMIType: URIRef # The set of classes specified by the DCMI Type Vocabulary, used to categorize the nature or genre of the resource. + DDC: URIRef # The set of conceptual resources specified by the Dewey Decimal Classification. + IMT: URIRef # The set of media types specified by the Internet Assigned Numbers Authority. + LCC: URIRef # The set of conceptual resources specified by the Library of Congress Classification. + LCSH: URIRef # The set of labeled concepts specified by the Library of Congress Subject Headings. + MESH: ( + URIRef # The set of labeled concepts specified by the Medical Subject Headings. + ) + NLM: URIRef # The set of conceptual resources specified by the National Library of Medicine Classification. + TGN: URIRef # The set of places specified by the Getty Thesaurus of Geographic Names. + UDC: URIRef # The set of conceptual resources specified by the Universal Decimal Classification. + + # http://www.w3.org/1999/02/22-rdf-syntax-ns#Property + abstract: URIRef # A summary of the resource. + accessRights: URIRef # Information about who access the resource or an indication of its security status. + accrualMethod: URIRef # The method by which items are added to a collection. + accrualPeriodicity: ( + URIRef # The frequency with which items are added to a collection. + ) + accrualPolicy: URIRef # The policy governing the addition of items to a collection. + alternative: URIRef # An alternative name for the resource. + audience: URIRef # A class of agents for whom the resource is intended or useful. + available: URIRef # Date that the resource became or will become available. + bibliographicCitation: URIRef # A bibliographic reference for the resource. + conformsTo: ( + URIRef # An established standard to which the described resource conforms. + ) + contributor: ( + URIRef # An entity responsible for making contributions to the resource. + ) + coverage: URIRef # The spatial or temporal topic of the resource, spatial applicability of the resource, or jurisdiction under which the resource is relevant. + created: URIRef # Date of creation of the resource. + creator: URIRef # An entity responsible for making the resource. + date: URIRef # A point or period of time associated with an event in the lifecycle of the resource. + dateAccepted: URIRef # Date of acceptance of the resource. + dateCopyrighted: URIRef # Date of copyright of the resource. + dateSubmitted: URIRef # Date of submission of the resource. + description: URIRef # An account of the resource. + educationLevel: URIRef # A class of agents, defined in terms of progression through an educational or training context, for which the described resource is intended. + extent: URIRef # The size or duration of the resource. + format: URIRef # The file format, physical medium, or dimensions of the resource. + hasFormat: URIRef # A related resource that is substantially the same as the pre-existing described resource, but in another format. + hasPart: URIRef # A related resource that is included either physically or logically in the described resource. + hasVersion: URIRef # A related resource that is a version, edition, or adaptation of the described resource. + identifier: ( + URIRef # An unambiguous reference to the resource within a given context. + ) + instructionalMethod: URIRef # A process, used to engender knowledge, attitudes and skills, that the described resource is designed to support. + isFormatOf: URIRef # A pre-existing related resource that is substantially the same as the described resource, but in another format. + isPartOf: URIRef # A related resource in which the described resource is physically or logically included. + isReferencedBy: URIRef # A related resource that references, cites, or otherwise points to the described resource. + isReplacedBy: URIRef # A related resource that supplants, displaces, or supersedes the described resource. + isRequiredBy: URIRef # A related resource that requires the described resource to support its function, delivery, or coherence. + isVersionOf: URIRef # A related resource of which the described resource is a version, edition, or adaptation. + issued: URIRef # Date of formal issuance of the resource. + language: URIRef # A language of the resource. + license: URIRef # A legal document giving official permission to do something with the resource. + mediator: URIRef # An entity that mediates access to the resource. + medium: URIRef # The material or physical carrier of the resource. + modified: URIRef # Date on which the resource was changed. + provenance: URIRef # A statement of any changes in ownership and custody of the resource since its creation that are significant for its authenticity, integrity, and interpretation. + publisher: URIRef # An entity responsible for making the resource available. + references: URIRef # A related resource that is referenced, cited, or otherwise pointed to by the described resource. + relation: URIRef # A related resource. + replaces: URIRef # A related resource that is supplanted, displaced, or superseded by the described resource. + requires: URIRef # A related resource that is required by the described resource to support its function, delivery, or coherence. + rights: URIRef # Information about rights held in and over the resource. + rightsHolder: ( + URIRef # A person or organization owning or managing rights over the resource. + ) + source: URIRef # A related resource from which the described resource is derived. + spatial: URIRef # Spatial characteristics of the resource. + subject: URIRef # A topic of the resource. + tableOfContents: URIRef # A list of subunits of the resource. + temporal: URIRef # Temporal characteristics of the resource. + title: URIRef # A name given to the resource. + type: URIRef # The nature or genre of the resource. + valid: URIRef # Date (often a range) of validity of a resource. + + # http://www.w3.org/2000/01/rdf-schema#Class + Agent: URIRef # A resource that acts or has the power to act. + AgentClass: URIRef # A group of agents. + BibliographicResource: URIRef # A book, article, or other documentary resource. + FileFormat: URIRef # A digital resource format. + Frequency: URIRef # A rate at which something recurs. + Jurisdiction: ( + URIRef # The extent or range of judicial, law enforcement, or other authority. + ) + LicenseDocument: URIRef # A legal document giving official permission to do something with a resource. + LinguisticSystem: URIRef # A system of signs, symbols, sounds, gestures, or rules used in communication. + Location: URIRef # A spatial region or named place. + LocationPeriodOrJurisdiction: URIRef # A location, period of time, or jurisdiction. + MediaType: URIRef # A file format or physical medium. + MediaTypeOrExtent: URIRef # A media type or extent. + MethodOfAccrual: URIRef # A method by which resources are added to a collection. + MethodOfInstruction: ( + URIRef # A process that is used to engender knowledge, attitudes, and skills. + ) + PeriodOfTime: URIRef # An interval of time that is named or defined by its start and end dates. + PhysicalMedium: URIRef # A physical material or carrier. + PhysicalResource: URIRef # A material thing. + Policy: URIRef # A plan or course of action by an authority, intended to influence and determine decisions, actions, and other matters. + ProvenanceStatement: URIRef # Any changes in ownership and custody of a resource since its creation that are significant for its authenticity, integrity, and interpretation. + RightsStatement: URIRef # A statement about the intellectual property rights (IPR) held in or over a resource, a legal document giving official permission to do something with a resource, or a statement about access rights. + SizeOrDuration: URIRef # A dimension or extent, or a time taken to play or execute. + Standard: URIRef # A reference point against which other things can be evaluated or compared. + + # http://www.w3.org/2000/01/rdf-schema#Datatype + Box: URIRef # The set of regions in space defined by their geographic coordinates according to the DCMI Box Encoding Scheme. + ISO3166: URIRef # The set of codes listed in ISO 3166-1 for the representation of names of countries. + Period: URIRef # The set of time intervals defined by their limits according to the DCMI Period Encoding Scheme. + Point: URIRef # The set of points in space defined by their geographic coordinates according to the DCMI Point Encoding Scheme. + RFC1766: URIRef # The set of tags, constructed according to RFC 1766, for the identification of languages. + RFC3066: URIRef # The set of tags constructed according to RFC 3066 for the identification of languages. + RFC4646: URIRef # The set of tags constructed according to RFC 4646 for the identification of languages. + RFC5646: URIRef # The set of tags constructed according to RFC 5646 for the identification of languages. + URI: URIRef # The set of identifiers constructed according to the generic syntax for Uniform Resource Identifiers as specified by the Internet Engineering Task Force. + W3CDTF: URIRef # The set of dates and times constructed according to the W3C Date and Time Formats Specification. + + # Valid non-python identifiers + _extras = ["ISO639-2", "ISO639-3"] + + _NS = Namespace("http://purl.org/dc/terms/") diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_DOAP.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_DOAP.py new file mode 100644 index 0000000000000000000000000000000000000000..d8b652848d35e5e03aa8962565e9f7321ebf5368 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_DOAP.py @@ -0,0 +1,84 @@ +from rdflib.namespace import DefinedNamespace, Namespace +from rdflib.term import URIRef + + +class DOAP(DefinedNamespace): + """ + Description of a Project (DOAP) vocabulary + + The Description of a Project (DOAP) vocabulary, described using W3C RDF Schema and the Web Ontology Language. + + Generated from: http://usefulinc.com/ns/doap + Date: 2024-08-01 13:03:22.175167 + """ + + _NS = Namespace("http://usefulinc.com/ns/doap#") + + _fail = True + + ArchRepository: URIRef # GNU Arch source code repository. Dépôt GNU Arch du code source. Repositorio GNU Arch del código fuente. GNU Arch Quellcode-Versionierungssystem. Úložiště zdrojových kódů GNU Arch. Repositório GNU Arch do código fonte. + BKRepository: URIRef # BitKeeper source code repository. Dépôt BitKeeper du code source. Repositorio BitKeeper del código fuente. BitKeeper Quellcode-Versionierungssystem. Úložiště zdrojových kódů BitKeeper. Repositório BitKeeper do código fonte. + BazaarBranch: ( + URIRef # Bazaar source code branch. Código fonte da ramificação Bazaar. + ) + CVSRepository: URIRef # CVS source code repository. Dépôt CVS du code source. Repositorio CVS del código fuente. CVS Quellcode-Versionierungssystem. Úložiště zdrojových kódů CVS. Repositório CVS do código fonte. + DarcsRepository: URIRef # darcs source code repository. Dépôt darcs du code source. Repositorio darcs del código fuente. Repositório darcs do código fonte. + GitBranch: URIRef # Git source code branch. Código fonte da ramificação Git. + GitRepository: URIRef # Git source code repository. Dépôt Git du code source. Repositorio Git del código fuente. Git Quellcode-Versionierungssystem. Úložiště zdrojových kódů Git. Repositório Git do código fonte. + HgRepository: URIRef # Mercurial source code repository. Repositório Mercurial do código fonte. + Project: URIRef # A project. Un projet. Un proyecto. Ein Projekt. Projekt. Projeto. + Repository: URIRef # Source code repository. Dépôt du code source. Repositorio del código fuente. Quellcode-Versionierungssystem. Úložiště zdrojových kódů. Repositório do código fonte. + SVNRepository: URIRef # Subversion source code repository. Dépôt Subversion du code source. Repositorio Subversion del código fuente. Subversion Quellcode-Versionierungssystem. Úložiště zdrojových kódů Subversion. Repositório Subversion do código fonte. + Specification: URIRef # A specification of a system's aspects, technical or otherwise. A especificação de aspetos, técnicas ou outros do sistema. + Version: URIRef # Version information of a project release. Détails sur une version d'une release d'un projet. Información sobre la versión de un release del proyecto. Versionsinformation eines Projekt Releases. Informace o uvolněné verzi projektu. Informação sobre a versão do projeto lançado. + audience: ( + URIRef # Description of target user base Descrição do utilizador base alvo + ) + blog: URIRef # URI of a blog related to a project URI de um blog relacionado com um projeto + browse: URIRef # Web browser interface to repository. Interface web au dépôt. Interface web del repositorio. Web-Browser Interface für das Repository. Webové rozhraní pro prohlížení úložiště. Interface web do repositório. + category: URIRef # A category of project. Une catégorie de projet. Una categoría de proyecto. Eine Kategorie eines Projektes. Kategorie projektu. Uma categoría de projeto. + created: URIRef # Date when something was created, in YYYY-MM-DD form. e.g. 2004-04-05 Date à laquelle a été créé quelque chose, au format AAAA-MM-JJ (par ex. 2004-04-05) Fecha en la que algo fue creado, en formato AAAA-MM-DD. e.g. 2004-04-05 Erstellungsdatum von Irgendwas, angegeben im YYYY-MM-DD Format, z.B. 2004-04-05. Datum, kdy bylo něco vytvořeno ve formátu RRRR-MM-DD, např. 2004-04-05 Data em que algo foi criado, no formato AAAA-MM-DD. e.g. 2004-04-05 + description: URIRef # Plain text description of a project, of 2-4 sentences in length. Texte descriptif d'un projet, long de 2 à 4 phrases. Descripción en texto plano de un proyecto, de 2 a 4 enunciados de longitud. Beschreibung eines Projekts als einfacher Text mit der Länge von 2 bis 4 Sätzen. Čistě textový, 2 až 4 věty dlouhý popis projektu. Descrição de um projeto em texto apenas, com 2 a 4 frases de comprimento. + developer: URIRef # Developer of software for the project. Développeur pour le projet. Desarrollador de software para el proyecto. Software-Entwickler für das Projekt. Vývojář softwaru projektu. Programador de software para o projeto. + documentation: ( + URIRef # Documentation of the project. Aide pour l’utilisation de ce projet. + ) + documenter: URIRef # Contributor of documentation to the project. Collaborateur à la documentation du projet. Proveedor de documentación para el proyecto. Mitarbeiter an der Dokumentation des Projektes. Spoluautor dokumentace projektu. Contribuidor para a documentação do projeto. + helper: URIRef # Project contributor. Collaborateur au projet. Colaborador del proyecto. Projekt-Mitarbeiter. Spoluautor projektu. Ajudante ou colaborador do projeto. + homepage: URIRef # URL of a project's homepage, associated with exactly one project. L'URL de la page web d'un projet, associée avec un unique projet. El URL de la página de un proyecto, asociada con exactamente un proyecto. URL der Projekt-Homepage, verbunden mit genau einem Projekt. URL adresa domovské stránky projektu asociované s právě jedním projektem. O URL da página de um projeto, asociada com exactamente um projeto. + implements: URIRef # A specification that a project implements. Could be a standard, API or legally defined level of conformance. Uma especificação que um projeto implementa. Pode ser uma padrão, API ou um nível de conformidade definida legalmente. + language: URIRef # BCP47 language code a project has been translated into Código de idioma BCP47 do projeto para o qual foi traduzido + license: URIRef # The URI of an RDF description of the license the software is distributed under. E.g. a SPDX reference L'URI d'une description RDF de la licence sous laquelle le programme est distribué. El URI de una descripción RDF de la licencia bajo la cuál se distribuye el software. Die URI einer RDF-Beschreibung einer Lizenz unter der die Software herausgegeben wird. z.B. eine SPDX Referenz URI adresa RDF popisu licence, pod kterou je software distribuován. O URI de uma descrição RDF da licença do software sob a qual é distribuída. Ex.: referência SPDX + location: URIRef # Location of a repository. Emplacement d'un dépôt. lugar de un repositorio. Lokation eines Repositorys. Umístění úložiště. Localização de um repositório. + maintainer: URIRef # Maintainer of a project, a project leader. Développeur principal d'un projet, un meneur du projet. Desarrollador principal de un proyecto, un líder de proyecto. Hauptentwickler eines Projektes, der Projektleiter Správce projektu, vedoucí projektu. Programador principal de um projeto, um líder de projeto. + module: URIRef # Module name of a Subversion, CVS, BitKeeper or Arch repository. Nom du module d'un dépôt Subversion, CVS, BitKeeper ou Arch. Nombre del módulo de un repositorio Subversion, CVS, BitKeeper o Arch. Modul-Name eines Subversion, CVS, BitKeeper oder Arch Repositorys. Jméno modulu v CVS, BitKeeper nebo Arch úložišti. Nome do módulo de um repositório Subversion, CVS, BitKeeper ou Arch. + name: URIRef # A name of something. Le nom de quelque chose. El nombre de algo. Der Name von Irgendwas Jméno něčeho. O nome de alguma coisa. + os: URIRef # Operating system that a project is limited to. Omit this property if the project is not OS-specific. Système d'exploitation auquel est limité le projet. Omettez cette propriété si le projet n'est pas limité à un système d'exploitation. Sistema opertivo al cuál está limitado el proyecto. Omita esta propiedad si el proyecto no es específico de un sistema opertaivo en particular. Betriebssystem auf dem das Projekt eingesetzt werden kann. Diese Eigenschaft kann ausgelassen werden, wenn das Projekt nicht BS-spezifisch ist. Operační systém, na jehož použití je projekt limitován. Vynechejte tuto vlastnost, pokud je projekt nezávislý na operačním systému. Sistema operativo a que o projeto está limitado. Omita esta propriedade se o projeto não é condicionado pelo SO usado. + platform: URIRef # Indicator of software platform (non-OS specific), e.g. Java, Firefox, ECMA CLR Indicador da plataforma do software (não específico a nenhum SO), ex.: Java, Firefox, ECMA CLR + release: URIRef # A project release. Une release (révision) d'un projet. Un release (versión) de un proyecto. Ein Release (Version) eines Projekts. Relase (verze) projektu. A publicação de um projeto. + repository: URIRef # Source code repository. Dépôt du code source. Repositorio del código fuente. Quellcode-Versionierungssystem. Úložiště zdrojových kódů. Repositório do código fonte. + repositoryOf: URIRef # The project that uses a repository. + revision: URIRef # Revision identifier of a software release. Identifiant de révision d'une release du programme. Indentificador de la versión de un release de software. Versionsidentifikator eines Software-Releases. Identifikátor zpřístupněné revize softwaru. Identificador do lançamento da revisão do software. + screenshots: URIRef # Web page with screenshots of project. Page web avec des captures d'écran du projet. Página web con capturas de pantalla del proyecto. Web-Seite mit Screenshots eines Projektes. Webová stránka projektu se snímky obrazovky. Página web com as capturas de ecrãn do projeto. + shortdesc: URIRef # Short (8 or 9 words) plain text description of a project. Texte descriptif concis (8 ou 9 mots) d'un projet. Descripción corta (8 o 9 palabras) en texto plano de un proyecto. Kurzbeschreibung (8 oder 9 Wörter) eines Projekts als einfacher Text. Krátký (8 nebo 9 slov) čistě textový popis projektu. Descrição curta (com 8 ou 9 palavras) de um projeto em texto apenas. + tester: URIRef # A tester or other quality control contributor. Un testeur ou un collaborateur au contrôle qualité. Un tester u otro proveedor de control de calidad. Ein Tester oder anderer Mitarbeiter der Qualitätskontrolle. Tester nebo jiný spoluautor kontrolující kvalitu. Um controlador ou outro contribuidor para o controlo de qualidade. + translator: URIRef # Contributor of translations to the project. Collaborateur à la traduction du projet. Proveedor de traducciones al proyecto. Mitarbeiter an den Übersetzungen des Projektes. Spoluautor překladu projektu. Contribuidor das traduções para o projeto. + vendor: URIRef # Vendor organization: commercial, free or otherwise + wiki: URIRef # URL of Wiki for collaborative discussion of project. L'URL du Wiki pour la discussion collaborative sur le projet. URL del Wiki para discusión colaborativa del proyecto. Wiki-URL für die kollaborative Dikussion eines Projektes. URL adresa wiki projektu pro společné diskuse. URL da Wiki para discussão em grupo do projeto. + + # Valid non-python identifiers + _extras = [ + "anon-root", # Repository for anonymous access. Dépôt pour accès anonyme. Repositorio para acceso anónimo. Repository für anonymen Zugriff Úložiště pro anonymní přístup. Repositório para acesso anónimo. + "bug-database", # Bug tracker for a project. Suivi des bugs pour un projet. Bug tracker para un proyecto. Fehlerdatenbank eines Projektes. Správa chyb projektu. Bug tracker para um projeto. + "developer-forum", # A forum or community for developers of this project. + "download-mirror", # Mirror of software download web page. Miroir de la page de téléchargement du programme. Mirror de la página web de descarga. Spiegel der Seite von die Projekt-Software heruntergeladen werden kann. Zrcadlo stránky pro stažení softwaru. Mirror da página web para fazer download. + "download-page", # Web page from which the project software can be downloaded. Page web à partir de laquelle on peut télécharger le programme. Página web de la cuál se puede bajar el software. Web-Seite von der die Projekt-Software heruntergeladen werden kann. Webová stránka, na které lze stáhnout projektový software. Página web da qual o projeto de software pode ser descarregado. + "file-release", # URI of download associated with this release. URI adresa stažení asociované s revizí. URI para download associado com a publicação. + "mailing-list", # Mailing list home page or email address. Page web de la liste de diffusion, ou adresse de courriel. Página web de la lista de correo o dirección de correo. Homepage der Mailing Liste oder E-Mail Adresse. Domovská stránka nebo e–mailová adresa e–mailové diskuse. Página web da lista de distribuição de e-mail ou dos endereços. + "old-homepage", # URL of a project's past homepage, associated with exactly one project. L'URL d'une ancienne page web d'un projet, associée avec un unique projet. El URL de la antigua página de un proyecto, asociada con exactamente un proyecto. URL der letzten Projekt-Homepage, verbunden mit genau einem Projekt. URL adresa předešlé domovské stránky projektu asociované s právě jedním projektem. O URL antigo da página de um projeto, associada com exactamente um projeto. + "programming-language", # Programming language a project is implemented in or intended for use with. Langage de programmation avec lequel un projet est implémenté, ou avec lequel il est prévu de l'utiliser. Lenguaje de programación en el que un proyecto es implementado o con el cuál pretende usarse. Programmiersprache in der ein Projekt implementiert ist oder intendiert wird zu benutzen. Programovací jazyk, ve kterém je projekt implementován nebo pro který je zamýšlen k použití. Linguagem de programação que o projeto usa ou é para ser utilizada. + "security-contact", # The Agent that should be contacted if security issues are found with the project. + "security-policy", # URL of the security policy of a project. + "service-endpoint", # The URI of a web service endpoint where software as a service may be accessed + "support-forum", # A forum or community that supports this project. + ] diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_FOAF.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_FOAF.py new file mode 100644 index 0000000000000000000000000000000000000000..18aa4af72dec2b7b9b5596fe6c521050e02e4014 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_FOAF.py @@ -0,0 +1,105 @@ +from rdflib.namespace import DefinedNamespace, Namespace +from rdflib.term import URIRef + + +class FOAF(DefinedNamespace): + """ + Friend of a Friend (FOAF) vocabulary + + The Friend of a Friend (FOAF) RDF vocabulary, described using W3C RDF Schema and the Web Ontology Language. + + Generated from: http://xmlns.com/foaf/spec/index.rdf + Date: 2020-05-26 14:20:01.597998 + + """ + + _fail = True + + # http://www.w3.org/1999/02/22-rdf-syntax-ns#Property + account: URIRef # Indicates an account held by this agent. + accountName: ( + URIRef # Indicates the name (identifier) associated with this online account. + ) + accountServiceHomepage: ( + URIRef # Indicates a homepage of the service provide for this online account. + ) + age: URIRef # The age in years of some agent. + based_near: URIRef # A location that something is based near, for some broadly human notion of near. + birthday: URIRef # The birthday of this Agent, represented in mm-dd string form, eg. '12-31'. + currentProject: URIRef # A current project this person works on. + depiction: URIRef # A depiction of some thing. + depicts: URIRef # A thing depicted in this representation. + dnaChecksum: URIRef # A checksum for the DNA of some thing. Joke. + familyName: URIRef # The family name of some person. + family_name: URIRef # The family name of some person. + firstName: URIRef # The first name of a person. + focus: URIRef # The underlying or 'focal' entity associated with some SKOS-described concept. + fundedBy: URIRef # An organization funding a project or person. + geekcode: URIRef # A textual geekcode for this person, see http://www.geekcode.com/geek.html + gender: URIRef # The gender of this Agent (typically but not necessarily 'male' or 'female'). + givenName: URIRef # The given name of some person. + givenname: URIRef # The given name of some person. + holdsAccount: URIRef # Indicates an account held by this agent. + img: URIRef # An image that can be used to represent some thing (ie. those depictions which are particularly representative of something, eg. one's photo on a homepage). + interest: URIRef # A page about a topic of interest to this person. + knows: URIRef # A person known by this person (indicating some level of reciprocated interaction between the parties). + lastName: URIRef # The last name of a person. + made: URIRef # Something that was made by this agent. + maker: URIRef # An agent that made this thing. + member: URIRef # Indicates a member of a Group + membershipClass: ( + URIRef # Indicates the class of individuals that are a member of a Group + ) + myersBriggs: URIRef # A Myers Briggs (MBTI) personality classification. + name: URIRef # A name for some thing. + nick: URIRef # A short informal nickname characterising an agent (includes login identifiers, IRC and other chat nicknames). + page: URIRef # A page or document about this thing. + pastProject: URIRef # A project this person has previously worked on. + phone: URIRef # A phone, specified using fully qualified tel: URI scheme (refs: http://www.w3.org/Addressing/schemes.html#tel). + plan: URIRef # A .plan comment, in the tradition of finger and '.plan' files. + primaryTopic: URIRef # The primary topic of some page or document. + publications: URIRef # A link to the publications of this person. + schoolHomepage: URIRef # A homepage of a school attended by the person. + sha1: URIRef # A sha1sum hash, in hex. + skypeID: URIRef # A Skype ID + status: URIRef # A string expressing what the user is happy for the general public (normally) to know about their current activity. + surname: URIRef # The surname of some person. + theme: URIRef # A theme. + thumbnail: URIRef # A derived thumbnail image. + tipjar: URIRef # A tipjar document for this agent, describing means for payment and reward. + title: URIRef # Title (Mr, Mrs, Ms, Dr. etc) + topic: URIRef # A topic of some page or document. + topic_interest: URIRef # A thing of interest to this person. + workInfoHomepage: URIRef # A work info homepage of some person; a page about their work for some organization. + workplaceHomepage: URIRef # A workplace homepage of some person; the homepage of an organization they work for. + + # http://www.w3.org/2000/01/rdf-schema#Class + Agent: URIRef # An agent (eg. person, group, software or physical artifact). + Document: URIRef # A document. + Group: URIRef # A class of Agents. + Image: URIRef # An image. + LabelProperty: URIRef # A foaf:LabelProperty is any RDF property with textual values that serve as labels. + OnlineAccount: URIRef # An online account. + OnlineChatAccount: URIRef # An online chat account. + OnlineEcommerceAccount: URIRef # An online e-commerce account. + OnlineGamingAccount: URIRef # An online gaming account. + Organization: URIRef # An organization. + Person: URIRef # A person. + PersonalProfileDocument: URIRef # A personal profile RDF document. + Project: URIRef # A project (a collective endeavour of some kind). + + # http://www.w3.org/2002/07/owl#InverseFunctionalProperty + aimChatID: URIRef # An AIM chat ID + homepage: URIRef # A homepage for some thing. + icqChatID: URIRef # An ICQ chat ID + isPrimaryTopicOf: URIRef # A document that this thing is the primary topic of. + jabberID: URIRef # A jabber ID for something. + logo: URIRef # A logo representing some thing. + mbox: URIRef # A personal mailbox, ie. an Internet mailbox associated with exactly one owner, the first owner of this mailbox. This is a 'static inverse functional property', in that there is (across time and change) at most one individual that ever has any particular value for foaf:mbox. + mbox_sha1sum: URIRef # The sha1sum of the URI of an Internet mailbox associated with exactly one owner, the first owner of the mailbox. + msnChatID: URIRef # An MSN chat ID + openid: URIRef # An OpenID for an Agent. + weblog: URIRef # A weblog of some thing (whether person, group, company etc.). + yahooChatID: URIRef # A Yahoo chat ID + + _NS = Namespace("http://xmlns.com/foaf/0.1/") diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_GEO.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_GEO.py new file mode 100644 index 0000000000000000000000000000000000000000..2542c1e4f0186c7858659fe456bfe1baa1032834 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_GEO.py @@ -0,0 +1,111 @@ +from rdflib.namespace import DefinedNamespace, Namespace +from rdflib.term import URIRef + + +class GEO(DefinedNamespace): + """ + An RDF/OWL vocabulary for representing spatial information + + Generated from: http://schemas.opengis.net/geosparql/1.0/geosparql_vocab_all.rdf + Date: 2021-12-27 17:38:15.101187 + + ```turtle + dc:creator "Open Geospatial Consortium"^^xsd:string + dc:date "2012-04-30"^^xsd:date + dc:source + "OGC GeoSPARQL – A Geographic Query Language for RDF Data OGC 11-052r5"^^xsd:string + rdfs:seeAlso + + + owl:imports dc: + + + + owl:versionInfo "OGC GeoSPARQL 1.0"^^xsd:string + ``` + """ + + # http://www.w3.org/2000/01/rdf-schema#Datatype + dggsLiteral: URIRef # A DGGS serialization of a geometry object. + geoJSONLiteral: URIRef # A GeoJSON serialization of a geometry object. + gmlLiteral: URIRef # A GML serialization of a geometry object. + kmlLiteral: URIRef # A KML serialization of a geometry object. + wktLiteral: URIRef # A Well-known Text serialization of a geometry object. + + # http://www.w3.org/2002/07/owl#Class + Feature: URIRef # This class represents the top-level feature type. This class is equivalent to GFI_Feature defined in ISO 19156:2011, and it is superclass of all feature types. + FeatureCollection: URIRef # A collection of individual Features. + Geometry: URIRef # The class represents the top-level geometry type. This class is equivalent to the UML class GM_Object defined in ISO 19107, and it is superclass of all geometry types. + GeometryCollection: URIRef # A collection of individual Geometries. + SpatialObject: URIRef # The class spatial-object represents everything that can have a spatial representation. It is superclass of feature and geometry. + SpatialObjectCollection: URIRef # A collection of individual Spatial Objects. This is the superclass of Feature Collection and Geometry Collection. + + # http://www.w3.org/2002/07/owl#DatatypeProperty + asGML: URIRef # The GML serialization of a geometry + asWKT: URIRef # The WKT serialization of a geometry + asGeoJSON: URIRef # The GeoJSON serialization of a geometry + asKML: URIRef # The KML serialization of a geometry + asDGGS: URIRef # The DGGS serialization of a geometry + coordinateDimension: URIRef # The number of measurements or axes needed to describe the position of this geometry in a coordinate system. + dimension: URIRef # The topological dimension of this geometric object, which must be less than or equal to the coordinate dimension. In non-homogeneous collections, this will return the largest topological dimension of the contained objects. + hasMetricArea: URIRef # The area of a Spatial Object in square meters. + hasMetricLength: URIRef # The length of a Spatial Object in meters. + hasMetricPerimeterLength: ( + URIRef # The length of the perimeter of a Spatial Object in meters. + ) + hasMetricSpatialAccuracy: URIRef # The spatial resolution of a Geometry in meters. + hasMetricSpatialResolution: ( + URIRef # The spatial resolution of a Geometry in meters. + ) + hasMetricSize: URIRef # Subproperties of this property are used to indicate the size of a Spatial Object as a measurement or estimate of one or more dimensions of the Spatial Object's spatial presence. Units are always metric (meter, square meter or cubic meter) + hasMetricVolume: URIRef # The volume of a Spatial Object in cubic meters. + hasSerialization: ( + URIRef # Connects a geometry object with its text-based serialization. + ) + isEmpty: URIRef # (true) if this geometric object is the empty Geometry. If true, then this geometric object represents the empty point set for the coordinate space. + isSimple: URIRef # (true) if this geometric object has no anomalous geometric points, such as self intersection or self tangency. + spatialDimension: URIRef # The number of measurements or axes needed to describe the spatial position of this geometry in a coordinate system. + + # http://www.w3.org/2002/07/owl#ObjectProperty + defaultGeometry: URIRef # The default geometry to be used in spatial calculations. It is Usually the most detailed geometry. + ehContains: URIRef # Exists if the subject SpatialObject spatially contains the object SpatialObject. DE-9IM: T*TFF*FF* + ehCoveredBy: URIRef # Exists if the subject SpatialObject is spatially covered by the object SpatialObject. DE-9IM: TFF*TFT** + ehCovers: URIRef # Exists if the subject SpatialObject spatially covers the object SpatialObject. DE-9IM: T*TFT*FF* + ehDisjoint: URIRef # Exists if the subject SpatialObject is spatially disjoint from the object SpatialObject. DE-9IM: FF*FF**** + ehEquals: URIRef # Exists if the subject SpatialObject spatially equals the object SpatialObject. DE-9IM: TFFFTFFFT + ehInside: URIRef # Exists if the subject SpatialObject is spatially inside the object SpatialObject. DE-9IM: TFF*FFT** + ehMeet: URIRef # Exists if the subject SpatialObject spatially meets the object SpatialObject. DE-9IM: FT******* ^ F**T***** ^ F***T**** + ehOverlap: URIRef # Exists if the subject SpatialObject spatially overlaps the object SpatialObject. DE-9IM: T*T***T** + hasArea: URIRef # The area of a Spatial Object. + hasBoundingBox: ( + URIRef # The minimum or smallest bounding or enclosing box of a given Feature. + ) + hasCentroid: URIRef # The arithmetic mean position of all the geometry points of a given Feature. + hasDefaultGeometry: URIRef # The default geometry to be used in spatial calculations, usually the most detailed geometry. + hasGeometry: URIRef # A spatial representation for a given feature. + hasLength: URIRef # The length of a Spatial Object. + hasPerimeterLength: URIRef # The length of the perimeter of a Spatial Object. + hasSize: URIRef # Subproperties of this property are used to indicate the size of a Spatial Object as a measurement or estimate of one or more dimensions of the Spatial Object's spatial presence. + hasSpatialAccuracy: ( + URIRef # The positional accuracy of the coordinates of a Geometry. + ) + hasSpatialResolution: URIRef # The spatial resolution of a Geometry. + hasVolume: URIRef # he volume of a three-dimensional Spatial Object. + rcc8dc: URIRef # Exists if the subject SpatialObject is spatially disjoint from the object SpatialObject. DE-9IM: FFTFFTTTT + rcc8ec: URIRef # Exists if the subject SpatialObject spatially meets the object SpatialObject. DE-9IM: FFTFTTTTT + rcc8eq: URIRef # Exists if the subject SpatialObject spatially equals the object SpatialObject. DE-9IM: TFFFTFFFT + rcc8ntpp: URIRef # Exists if the subject SpatialObject is spatially inside the object SpatialObject. DE-9IM: TFFTFFTTT + rcc8ntppi: URIRef # Exists if the subject SpatialObject spatially contains the object SpatialObject. DE-9IM: TTTFFTFFT + rcc8po: URIRef # Exists if the subject SpatialObject spatially overlaps the object SpatialObject. DE-9IM: TTTTTTTTT + rcc8tpp: URIRef # Exists if the subject SpatialObject is spatially covered by the object SpatialObject. DE-9IM: TFFTTFTTT + rcc8tppi: URIRef # Exists if the subject SpatialObject spatially covers the object SpatialObject. DE-9IM: TTTFTTFFT + sfContains: URIRef # Exists if the subject SpatialObject spatially contains the object SpatialObject. DE-9IM: T*****FF* + sfCrosses: URIRef # Exists if the subject SpatialObject spatially crosses the object SpatialObject. DE-9IM: T*T****** + sfDisjoint: URIRef # Exists if the subject SpatialObject is spatially disjoint from the object SpatialObject. DE-9IM: FF*FF**** + sfEquals: URIRef # Exists if the subject SpatialObject spatially equals the object SpatialObject. DE-9IM: TFFFTFFFT + sfIntersects: URIRef # Exists if the subject SpatialObject is not spatially disjoint from the object SpatialObject. DE-9IM: T******** ^ *T******* ^ ***T***** ^ ****T**** + sfOverlaps: URIRef # Exists if the subject SpatialObject spatially overlaps the object SpatialObject. DE-9IM: T*T***T** + sfTouches: URIRef # Exists if the subject SpatialObject spatially touches the object SpatialObject. DE-9IM: FT******* ^ F**T***** ^ F***T**** + sfWithin: URIRef # Exists if the subject SpatialObject is spatially within the object SpatialObject. DE-9IM: T*F**F*** + + _NS = Namespace("http://www.opengis.net/ont/geosparql#") diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_ODRL2.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_ODRL2.py new file mode 100644 index 0000000000000000000000000000000000000000..acb0b5b56242b2b13aedddd529dfd59ee2a64c54 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_ODRL2.py @@ -0,0 +1,283 @@ +from rdflib.namespace import DefinedNamespace, Namespace +from rdflib.term import URIRef + + +class ODRL2(DefinedNamespace): + """ + ODRL Version 2.2 + + The ODRL Vocabulary and Expression defines a set of concepts and terms (the vocabulary) and encoding mechanism + (the expression) for permissions and obligations statements describing digital content usage based on the ODRL + Information Model. + + Generated from: https://www.w3.org/ns/odrl/2/ODRL22.ttl + Date: 2020-05-26 14:20:02.352356 + + """ + + _fail = True + + # http://www.w3.org/1999/02/22-rdf-syntax-ns#Property + action: URIRef # The operation relating to the Asset for which the Rule is being subjected. + andSequence: URIRef # The relation is satisfied when each of the Constraints are satisfied in the order specified. + assignee: URIRef # The Party is the recipient of the Rule. + assigneeOf: URIRef # Identifies an ODRL Policy for which the identified Party undertakes the assignee functional role. + assigner: URIRef # The Party is the issuer of the Rule. + assignerOf: URIRef # Identifies an ODRL Policy for which the identified Party undertakes the assigner functional role. + attributedParty: URIRef # The Party to be attributed. + attributingParty: URIRef # The Party who undertakes the attribution. + compensatedParty: URIRef # The Party is the recipient of the compensation. + compensatingParty: URIRef # The Party that is the provider of the compensation. + conflict: URIRef # The conflict-resolution strategy for a Policy. + consentedParty: URIRef # The Party who obtains the consent. + consentingParty: URIRef # The Party to obtain consent from. + consequence: URIRef # Relates a Duty to another Duty, the latter being a consequence of not fulfilling the former. + constraint: URIRef # Constraint applied to a Rule + contractedParty: URIRef # The Party who is being contracted. + contractingParty: URIRef # The Party who is offering the contract. + dataType: URIRef # The datatype of the value of the rightOperand or rightOperandReference of a Constraint. + duty: URIRef # Relates an individual Duty to a Permission. + failure: URIRef # Failure is an abstract property that defines the violation (or unmet) relationship between Rules. + function: URIRef # Function is an abstract property whose sub-properties define the functional roles which may be fulfilled by a party in relation to a Rule. + hasPolicy: URIRef # Identifies an ODRL Policy for which the identified Asset is the target Asset to all the Rules. + implies: URIRef # An Action asserts that another Action is not prohibited to enable its operational semantics. + includedIn: URIRef # An Action transitively asserts that another Action that encompasses its operational semantics. + informedParty: URIRef # The Party to be informed of all uses. + informingParty: URIRef # The Party who provides the inform use data. + inheritAllowed: URIRef # Indicates if the Policy entity can be inherited. + inheritFrom: URIRef # Relates a (child) policy to another (parent) policy from which terms are inherited. + inheritRelation: URIRef # Identifies the type of inheritance. + leftOperand: URIRef # The left operand in a constraint expression. + obligation: URIRef # Relates an individual Duty to a Policy. + operand: URIRef # Operand is an abstract property for a logical relationship. + operator: URIRef # The operator function applied to operands of a Constraint + output: URIRef # The output property specifies the Asset which is created from the output of the Action. + partOf: URIRef # Identifies an Asset/PartyCollection that the Asset/Party is a member of. + payeeParty: URIRef # The Party is the recipient of the payment. + permission: URIRef # Relates an individual Permission to a Policy. + profile: URIRef # The identifier(s) of an ODRL Profile that the Policy conforms to. + prohibition: URIRef # Relates an individual Prohibition to a Policy. + proximity: URIRef # An value indicating the closeness or nearness. + refinement: URIRef # Constraint used to refine the semantics of an Action, or Party/Asset Collection + relation: URIRef # Relation is an abstract property which creates an explicit link between an Action and an Asset. + remedy: URIRef # Relates an individual remedy Duty to a Prohibition. + rightOperand: URIRef # The value of the right operand in a constraint expression. + rightOperandReference: URIRef # A reference to a web resource providing the value for the right operand of a Constraint. + scope: URIRef # The identifier of a scope that provides context to the extent of the entity. + source: URIRef # Reference to a Asset/PartyCollection + status: URIRef # the value generated from the leftOperand action or a value related to the leftOperand set as the reference for the comparison. + target: URIRef # The target property indicates the Asset that is the primary subject to which the Rule action directly applies. + timedCount: URIRef # The number of seconds after which timed metering use of the asset begins. + trackedParty: URIRef # The Party whose usage is being tracked. + trackingParty: URIRef # The Party who is tracking usage. + uid: URIRef # An unambiguous identifier + undefined: ( + URIRef # Relates the strategy used for handling undefined actions to a Policy. + ) + unit: URIRef # The unit of measurement of the value of the rightOperand or rightOperandReference of a Constraint. + xone: URIRef # The relation is satisfied when only one, and not more, of the Constraints is satisfied + + # http://www.w3.org/2002/07/owl#NamedIndividual + All: URIRef # Specifies that the scope of the relationship is all of the collective individuals within a context. + All2ndConnections: URIRef # Specifies that the scope of the relationship is all of the second-level connections to the Party. + AllConnections: URIRef # Specifies that the scope of the relationship is all of the first-level connections of the Party. + AllGroups: URIRef # Specifies that the scope of the relationship is all of the group connections of the Party. + Group: URIRef # Specifies that the scope of the relationship is the defined group with multiple individual members. + Individual: URIRef # Specifies that the scope of the relationship is the single Party individual. + absolutePosition: URIRef # A point in space or time defined with absolute coordinates for the positioning of the target Asset. + absoluteSize: URIRef # Measure(s) of one or two axes for 2D-objects or measure(s) of one to tree axes for 3D-objects of the target Asset. + absoluteSpatialPosition: URIRef # The absolute spatial positions of four corners of a rectangle on a 2D-canvas or the eight corners of a cuboid in a 3D-space for the target Asset to fit. + absoluteTemporalPosition: URIRef # The absolute temporal positions in a media stream the target Asset has to fit. + count: URIRef # Numeric count of executions of the action of the Rule. + dateTime: URIRef # The date (and optional time and timezone) of exercising the action of the Rule. Right operand value MUST be an xsd:date or xsd:dateTime as defined by [[xmlschema11-2]]. + delayPeriod: URIRef # A time delay period prior to exercising the action of the Rule. The point in time triggering this period MAY be defined by another temporal Constraint combined by a Logical Constraint (utilising the odrl:andSequence operand). Right operand value MUST be an xsd:duration as defined by [[xmlschema11-2]]. + deliveryChannel: ( + URIRef # The delivery channel used for exercising the action of the Rule. + ) + device: URIRef # An identified device used for exercising the action of the Rule. + elapsedTime: URIRef # A continuous elapsed time period which may be used for exercising of the action of the Rule. Right operand value MUST be an xsd:duration as defined by [[xmlschema11-2]]. + eq: URIRef # Indicating that a given value equals the right operand of the Constraint. + event: URIRef # An identified event setting a context for exercising the action of the Rule. + fileFormat: URIRef # A transformed file format of the target Asset. + gt: URIRef # Indicating that a given value is greater than the right operand of the Constraint. + gteq: URIRef # Indicating that a given value is greater than or equal to the right operand of the Constraint. + hasPart: URIRef # A set-based operator indicating that a given value contains the right operand of the Constraint. + ignore: URIRef # The Action is to be ignored and is not part of the policy – and the policy remains valid. + industry: URIRef # A defined industry sector setting a context for exercising the action of the Rule. + invalid: URIRef # The policy is void. + isA: URIRef # A set-based operator indicating that a given value is an instance of the right operand of the Constraint. + isAllOf: URIRef # A set-based operator indicating that a given value is all of the right operand of the Constraint. + isAnyOf: URIRef # A set-based operator indicating that a given value is any of the right operand of the Constraint. + isNoneOf: URIRef # A set-based operator indicating that a given value is none of the right operand of the Constraint. + isPartOf: URIRef # A set-based operator indicating that a given value is contained by the right operand of the Constraint. + language: URIRef # A natural language used by the target Asset. + lt: URIRef # Indicating that a given value is less than the right operand of the Constraint. + lteq: URIRef # Indicating that a given value is less than or equal to the right operand of the Constraint. + media: URIRef # Category of a media asset setting a context for exercising the action of the Rule. + meteredTime: URIRef # An accumulated amount of one to many metered time periods which were used for exercising the action of the Rule. Right operand value MUST be an xsd:duration as defined by [[xmlschema11-2]]. + neq: URIRef # Indicating that a given value is not equal to the right operand of the Constraint. + payAmount: URIRef # The amount of a financial payment. Right operand value MUST be an xsd:decimal. + percentage: URIRef # A percentage amount of the target Asset relevant for exercising the action of the Rule. Right operand value MUST be an xsd:decimal from 0 to 100. + perm: URIRef # Permissions take preference over prohibitions. + policyUsage: ( + URIRef # Indicates the actual datetime the action of the Rule was exercised. + ) + product: URIRef # Category of product or service setting a context for exercising the action of the Rule. + prohibit: URIRef # Prohibitions take preference over permissions. + purpose: URIRef # A defined purpose for exercising the action of the Rule. + recipient: URIRef # The party receiving the result/outcome of exercising the action of the Rule. + relativePosition: URIRef # A point in space or time defined with coordinates relative to full measures the positioning of the target Asset. + relativeSize: URIRef # Measure(s) of one or two axes for 2D-objects or measure(s) of one to tree axes for 3D-objects - expressed as percentages of full values - of the target Asset. + relativeSpatialPosition: URIRef # The relative spatial positions - expressed as percentages of full values - of four corners of a rectangle on a 2D-canvas or the eight corners of a cuboid in a 3D-space of the target Asset. + relativeTemporalPosition: URIRef # A point in space or time defined with coordinates relative to full measures the positioning of the target Asset. + resolution: URIRef # Resolution of the rendition of the target Asset. + spatial: URIRef # A named and identified geospatial area with defined borders which is used for exercising the action of the Rule. An IRI MUST be used to represent this value. + spatialCoordinates: URIRef # A set of coordinates setting the borders of a geospatial area used for exercising the action of the Rule. The coordinates MUST include longitude and latitude, they MAY include altitude and the geodetic datum. + support: URIRef # The Action is to be supported as part of the policy – and the policy remains valid. + system: URIRef # An identified computing system used for exercising the action of the Rule. + systemDevice: URIRef # An identified computing system or computing device used for exercising the action of the Rule. + timeInterval: URIRef # A recurring period of time before the next execution of the action of the Rule. Right operand value MUST be an xsd:duration as defined by [[xmlschema11-2]]. + unitOfCount: URIRef # The unit of measure used for counting the executions of the action of the Rule. + version: URIRef # The version of the target Asset. + virtualLocation: URIRef # An identified location of the IT communication space which is relevant for exercising the action of the Rule. + + # http://www.w3.org/2004/02/skos/core#Collection + + # http://www.w3.org/2004/02/skos/core#Concept + Action: URIRef # An operation on an Asset. + Agreement: URIRef # A Policy that grants the assignee a Rule over an Asset from an assigner. + Assertion: URIRef # A Policy that asserts a Rule over an Asset from parties. + Asset: URIRef # A resource or a collection of resources that are the subject of a Rule. + AssetCollection: URIRef # An Asset that is collection of individual resources + AssetScope: URIRef # Scopes for Asset Scope expressions. + ConflictTerm: URIRef # Used to establish strategies to resolve conflicts that arise from the merging of Policies or conflicts between Permissions and Prohibitions in the same Policy. + Constraint: URIRef # A boolean expression that refines the semantics of an Action and Party/Asset Collection or declare the conditions applicable to a Rule. + Duty: URIRef # The obligation to perform an Action + LeftOperand: URIRef # Left operand for a constraint expression. + LogicalConstraint: URIRef # A logical expression that refines the semantics of an Action and Party/Asset Collection or declare the conditions applicable to a Rule. + Offer: URIRef # A Policy that proposes a Rule over an Asset from an assigner. + Operator: URIRef # Operator for constraint expression. + Party: ( + URIRef # An entity or a collection of entities that undertake Roles in a Rule. + ) + PartyCollection: URIRef # A Party that is a group of individual entities + PartyScope: URIRef # Scopes for Party Scope expressions. + Permission: URIRef # The ability to perform an Action over an Asset. + Policy: URIRef # A non-empty group of Permissions and/or Prohibitions. + Privacy: URIRef # A Policy that expresses a Rule over an Asset containing personal information. + Prohibition: URIRef # The inability to perform an Action over an Asset. + Request: URIRef # A Policy that proposes a Rule over an Asset from an assignee. + RightOperand: URIRef # Right operand for constraint expression. + Rule: URIRef # An abstract concept that represents the common characteristics of Permissions, Prohibitions, and Duties. + Set: URIRef # A Policy that expresses a Rule over an Asset. + Ticket: ( + URIRef # A Policy that grants the holder a Rule over an Asset from an assigner. + ) + UndefinedTerm: URIRef # Is used to indicate how to support Actions that are not part of any vocabulary or profile in the policy expression system. + acceptTracking: URIRef # To accept that the use of the Asset may be tracked. + adHocShare: URIRef # The act of sharing the asset to parties in close proximity to the owner. + aggregate: ( + URIRef # To use the Asset or parts of it as part of a composite collection. + ) + annotate: URIRef # To add explanatory notations/commentaries to the Asset without modifying the Asset in any other way. + anonymize: URIRef # To anonymize all or parts of the Asset. + append: URIRef # The act of adding to the end of an asset. + appendTo: URIRef # The act of appending data to the Asset without modifying the Asset in any other way. + archive: URIRef # To store the Asset (in a non-transient form). + attachPolicy: URIRef # The act of keeping the policy notice with the asset. + attachSource: ( + URIRef # The act of attaching the source of the asset and its derivatives. + ) + attribute: URIRef # To attribute the use of the Asset. + commercialize: URIRef # The act of using the asset in a business environment. + compensate: URIRef # To compensate by transfer of some amount of value, if defined, for using or selling the Asset. + concurrentUse: URIRef # To create multiple copies of the Asset that are being concurrently used. + copy: URIRef # The act of making an exact reproduction of the asset. + core: URIRef # Identifier for the ODRL Core Profile + delete: ( + URIRef # To permanently remove all copies of the Asset after it has been used. + ) + derive: URIRef # To create a new derivative Asset from this Asset and to edit or modify the derivative. + digitize: URIRef # To produce a digital copy of (or otherwise digitize) the Asset from its analogue form. + display: URIRef # To create a static and transient rendition of an Asset. + distribute: URIRef # To supply the Asset to third-parties. + ensureExclusivity: URIRef # To ensure that the Rule on the Asset is exclusive. + execute: URIRef # To run the computer program Asset. + export: URIRef # The act of transforming the asset into a new form. + extract: URIRef # To extract parts of the Asset and to use it as a new Asset. + extractChar: URIRef # The act of extracting (replicating) unchanged characters from the asset. + extractPage: ( + URIRef # The act of extracting (replicating) unchanged pages from the asset. + ) + extractWord: ( + URIRef # The act of extracting (replicating) unchanged words from the asset. + ) + give: URIRef # To transfer the ownership of the Asset to a third party without compensation and while deleting the original asset. + grantUse: URIRef # To grant the use of the Asset to third parties. + include: URIRef # To include other related assets in the Asset. + index: URIRef # To record the Asset in an index. + inform: URIRef # To inform that an action has been performed on or in relation to the Asset. + install: URIRef # To load the computer program Asset onto a storage device which allows operating or running the Asset. + lease: URIRef # The act of making available the asset to a third-party for a fixed period of time with exchange of value. + lend: URIRef # The act of making available the asset to a third-party for a fixed period of time without exchange of value. + license: URIRef # The act of granting the right to use the asset to a third-party. + modify: URIRef # To change existing content of the Asset. A new asset is not created by this action. + move: URIRef # To move the Asset from one digital location to another including deleting the original copy. + nextPolicy: URIRef # To grant the specified Policy to a third party for their use of the Asset. + obtainConsent: URIRef # To obtain verifiable consent to perform the requested action in relation to the Asset. + pay: URIRef # The act of paying a financial amount to a party for use of the asset. + play: URIRef # To create a sequential and transient rendition of an Asset. + present: URIRef # To publicly perform the Asset. + preview: URIRef # The act of providing a short preview of the asset. + print: URIRef # To create a tangible and permanent rendition of an Asset. + read: URIRef # To obtain data from the Asset. + reproduce: URIRef # To make duplicate copies the Asset in any material form. + reviewPolicy: URIRef # To review the Policy applicable to the Asset. + secondaryUse: URIRef # The act of using the asset for a purpose other than the purpose it was intended for. + sell: URIRef # To transfer the ownership of the Asset to a third party with compensation and while deleting the original asset. + share: URIRef # The act of the non-commercial reproduction and distribution of the asset to third-parties. + shareAlike: URIRef # The act of distributing any derivative asset under the same terms as the original asset. + stream: URIRef # To deliver the Asset in real-time. + synchronize: URIRef # To use the Asset in timed relations with media (audio/visual) elements of another Asset. + textToSpeech: URIRef # To have a text Asset read out loud. + transfer: URIRef # To transfer the ownership of the Asset in perpetuity. + transform: URIRef # To convert the Asset into a different format. + translate: URIRef # To translate the original natural language of an Asset into another natural language. + uninstall: URIRef # To unload and delete the computer program Asset from a storage device and disable its readiness for operation. + use: URIRef # To use the Asset + watermark: URIRef # To apply a watermark to the Asset. + write: URIRef # The act of writing to the Asset. + writeTo: URIRef # The act of adding data to the Asset. + + # Valid non-python identifiers + _extras = [ + "and", + "or", + "#actionConcepts", + "#actions", + "#actionsCommon", + "#assetConcepts", + "#assetParty", + "#assetRelations", + "#assetRelationsCommon", + "#conflictConcepts", + "#constraintLeftOperandCommon", + "#constraintLogicalOperands", + "#constraintRelationalOperators", + "#constraintRightOpCommon", + "#constraints", + "#deprecatedTerms", + "#duties", + "#logicalConstraints", + "#partyConcepts", + "#partyRoles", + "#partyRolesCommon", + "#permissions", + "#policyConcepts", + "#policySubClasses", + "#policySubClassesCommon", + "#prohibitions", + "#ruleConcepts", + ] + + _NS = Namespace("http://www.w3.org/ns/odrl/2/") diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_ORG.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_ORG.py new file mode 100644 index 0000000000000000000000000000000000000000..1d6e187fd412e4af249af60ff1404bc441541d3d --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_ORG.py @@ -0,0 +1,70 @@ +from rdflib.namespace import DefinedNamespace, Namespace +from rdflib.term import URIRef + + +class ORG(DefinedNamespace): + """ + Core organization ontology + + Vocabulary for describing organizational structures, specializable to a broad variety of types of + organization. + + Generated from: http://www.w3.org/ns/org# + Date: 2020-05-26 14:20:02.908408 + + """ + + _fail = True + + # http://www.w3.org/1999/02/22-rdf-syntax-ns#Property + basedAt: URIRef # Indicates the site at which a person is based. We do not restrict the possibility that a person is based at multiple sites. + changedBy: URIRef # Indicates a change event which resulted in a change to this organization. Depending on the event the organization may or may not have continued to exist after the event. Inverse of `org:originalOrganization`. + classification: URIRef # Indicates a classification for this Organization within some classification scheme. Extension vocabularies may wish to specialize this property to have a range corresponding to a specific `skos:ConceptScheme`. This property is under discussion and may be revised or removed - in many cases organizations are best categorized by defining a sub-class hierarchy in an extension vocabulary. + hasMember: URIRef # Indicates a person who is a member of the subject Organization. Inverse of `org:memberOf`, see that property for further clarification. Provided for compatibility with `foaf:member`. + hasMembership: URIRef # Indicates a membership relationship that the Agent plays. Inverse of `org:member`. + hasPost: URIRef # Indicates a Post which exists within the Organization. + hasPrimarySite: URIRef # Indicates a primary site for the Organization, this is the default means by which an Organization can be contacted and is not necessarily the formal headquarters. + hasRegisteredSite: URIRef # Indicates the legally registered site for the organization, in many legal jurisdictions there is a requirement that FormalOrganizations such as Companies or Charities have such a primary designed site. + hasSite: URIRef # Indicates a site at which the Organization has some presence even if only indirect (e.g. virtual office or a professional service which is acting as the registered address for a company). Inverse of `org:siteOf`. + hasSubOrganization: URIRef # Represents hierarchical containment of Organizations or Organizational Units; indicates an organization which is a sub-part or child of this organization. Inverse of `org:subOrganizationOf`. + hasUnit: URIRef # Indicates a unit which is part of this Organization, e.g. a Department within a larger FormalOrganization. Inverse of `org:unitOf`. + headOf: URIRef # Indicates that a person is the leader or formal head of the Organization. This will normally mean that they are the root of the `org:reportsTo` (acyclic) graph, though an organization may have more than one head. + heldBy: URIRef # Indicates an Agent which holds a Post. + holds: URIRef # Indicates a Post held by some Agent. + identifier: URIRef # Gives an identifier, such as a company registration number, that can be used to used to uniquely identify the organization. Many different national and international identier schemes are available. The org ontology is neutral to which schemes are used. The particular identifier scheme should be indicated by the datatype of the identifier value. Using datatypes to distinguish the notation scheme used is consistent with recommended best practice for `skos:notation` of which this property is a specialization. + linkedTo: URIRef # Indicates an arbitrary relationship between two organizations. Specializations of this can be used to, for example, denote funding or supply chain relationships. + location: URIRef # Gives a location description for a person within the organization, for example a _Mail Stop_ for internal posting purposes. + member: URIRef # Indicates the Person (or other Agent including Organization) involved in the Membership relationship. Inverse of `org:hasMembership` + memberDuring: URIRef # Optional property to indicate the interval for which the membership is/was valid. + memberOf: URIRef # Indicates that a person is a member of the Organization with no indication of the nature of that membership or the role played. Note that the choice of property name is not meant to limit the property to only formal membership arrangements, it is also intended to cover related concepts such as affilliation or other involvement in the organization. Extensions can specialize this relationship to indicate particular roles within the organization or more nuanced relationships to the organization. Has an optional inverse, `org:hasmember`. + organization: URIRef # Indicates Organization in which the Agent is a member. + originalOrganization: URIRef # Indicates one or more organizations that existed before the change event. Depending on the event they may or may not have continued to exist after the event. Inverse of `org:changedBy`. + postIn: URIRef # Indicates the Organization in which the Post exists. + purpose: URIRef # Indicates the purpose of this Organization. There can be many purposes at different levels of abstraction but the nature of an organization is to have a reason for existence and this property is a means to document that reason. An Organization may have multiple purposes. It is recommended that the purpose be denoted by a controlled term or code list, ideally a `skos:Concept`. However, the range is left open to allow for other types of descriptive schemes. It is expected that specializations or application profiles of this vocabulary will constrain the range of the purpose. Alternative names: _remit_ _responsibility_ (esp. if applied to OrganizationalUnits such as Government Departments). + remuneration: URIRef # Indicates a salary or other reward associated with the role. Typically this will be denoted using an existing representation scheme such as `gr:PriceSpecification` but the range is left open to allow applications to specialize it (e.g. to remunerationInGBP). + reportsTo: URIRef # Indicates a reporting relationship as might be depicted on an organizational chart. The precise semantics of the reporting relationship will vary by organization but is intended to encompass both direct supervisory relationships (e.g. carrying objective and salary setting authority) and more general reporting or accountability relationships (e.g. so called _dotted line_ reporting). + resultedFrom: URIRef # Indicates an event which resulted in this organization. Inverse of `org:resultingOrganization`. + resultingOrganization: URIRef # Indicates an organization which was created or changed as a result of the event. Inverse of `org:resultedFrom`. + role: URIRef # Indicates the Role that the Agent plays in a Membership relationship with an Organization. + roleProperty: URIRef # This is a metalevel property which is used to annotate an `org:Role` instance with a sub-property of `org:memberOf` that can be used to directly indicate the role for easy of query. The intended semantics is a Membership relation involving the Role implies the existence of a direct property relationship through an inference rule of the form: `{ [] org:member ?p; org:organization ?o; org:role [org:roleProperty ?r] } -> {?p ?r ?o}`. + siteAddress: URIRef # Indicates an address for the site in a suitable encoding. Use of vCard (using the http://www.w3.org/TR/vcard-rdf/ vocabulary) is encouraged but the range is left open to allow other encodings to be used. The address may include email, telephone, and geo-location information and is not restricted to a physical address. + siteOf: URIRef # Indicates an Organization which has some presence at the given site. This is the inverse of `org:hasSite`. + subOrganizationOf: URIRef # Represents hierarchical containment of Organizations or OrganizationalUnits; indicates an Organization which contains this Organization. Inverse of `org:hasSubOrganization`. + transitiveSubOrganizationOf: URIRef # The transitive closure of subOrganizationOf, giving a representation of all organizations that contain this one. Note that technically this is a super property of the transitive closure so it could contain additional assertions but such usage is discouraged. + unitOf: URIRef # Indicates an Organization of which this Unit is a part, e.g. a Department within a larger FormalOrganization. This is the inverse of `org:hasUnit`. + + # http://www.w3.org/2000/01/rdf-schema#Class + ChangeEvent: URIRef # Represents an event which resulted in a major change to an organization such as a merger or complete restructuring. It is intended for situations where the resulting organization is sufficient distinct from the original organizations that it has a distinct identity and distinct URI. Extension vocabularies should define sub-classes of this to denote particular categories of event. The instant or interval at which the event occurred should be given by `prov:startAtTime` and `prov:endedAtTime`, a description should be given by `dct:description`. + FormalOrganization: URIRef # An Organization which is recognized in the world at large, in particular in legal jurisdictions, with associated rights and responsibilities. Examples include a Corporation, Charity, Government or Church. Note that this is a super class of `gr:BusinessEntity` and it is recommended to use the GoodRelations vocabulary to denote Business classifications such as DUNS or NAICS. + Membership: URIRef # Indicates the nature of an Agent's membership of an organization. Represents an n-ary relation between an Agent, an Organization and a Role. It is possible to directly indicate membership, independent of the specific Role, through use of the `org:memberOf` property. + Organization: URIRef # Represents a collection of people organized together into a community or other social, commercial or political structure. The group has some common purpose or reason for existence which goes beyond the set of people belonging to it and can act as an Agent. Organizations are often decomposable into hierarchical structures. It is recommended that SKOS lexical labels should be used to label the Organization. In particular `skos:prefLabel` for the primary (possibly legally recognized name), `skos:altLabel` for alternative names (trading names, colloquial names) and `skos:notation` to denote a code from a code list. Alternative names: _Collective_ _Body_ _Org_ _Group_ + OrganizationalCollaboration: URIRef # A collaboration between two or more Organizations such as a project. It meets the criteria for being an Organization in that it has an identity and defining purpose independent of its particular members but is neither a formally recognized legal entity nor a sub-unit within some larger organization. Might typically have a shorter lifetime than the Organizations within it, but not necessarily. All members are `org:Organization`s rather than individuals and those Organizations can play particular roles within the venture. Alternative names: _Project_ _Venture_ _Endeavour_ _Consortium_ _Endeavour_ + OrganizationalUnit: URIRef # An Organization such as a University Support Unit which is part of some larger FormalOrganization and only has full recognition within the context of that FormalOrganization, it is not a Legal Entity in its own right. Units can be large and complex containing other Units and even FormalOrganizations. Alternative names: _OU_ _Unit_ _Department_ + Post: URIRef # A Post represents some position within an organization that exists independently of the person or persons filling it. Posts may be used to represent situations where a person is a member of an organization ex officio (for example the Secretary of State for Scotland is part of UK Cabinet by virtue of being Secretary of State for Scotland, not as an individual person). A post can be held by multiple people and hence can be treated as a organization in its own right. + Role: URIRef # Denotes a role that a Person or other Agent can take in an organization. Instances of this class describe the abstract role; to denote a specific instance of a person playing that role in a specific organization use an instance of `org:Membership`. It is common for roles to be arranged in some taxonomic structure and we use SKOS to represent that. The normal SKOS lexical properties should be used when labelling the Role. Additional descriptive properties for the Role, such as a Salary band, may be added by extension vocabularies. + Site: URIRef # An office or other premise at which the organization is located. Many organizations are spread across multiple sites and many sites will host multiple locations. In most cases a Site will be a physical location. However, we don't exclude the possibility of non-physical sites such as a virtual office with an associated post box and phone reception service. Extensions may provide subclasses to denote particular types of site. + + # http://www.w3.org/ns/org#Role + Head: URIRef # head + + _NS = Namespace("http://www.w3.org/ns/org#") diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_OWL.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_OWL.py new file mode 100644 index 0000000000000000000000000000000000000000..47ad4e5fd244f56b1779877606d0661a96563a00 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_OWL.py @@ -0,0 +1,140 @@ +from rdflib.namespace import DefinedNamespace, Namespace +from rdflib.term import URIRef + + +class OWL(DefinedNamespace): + """ + The OWL 2 Schema vocabulary (OWL 2) + + This ontology partially describes the built-in classes and properties that together form the basis of + the RDF/XML syntax of OWL 2. The content of this ontology is based on Tables 6.1 and 6.2 in Section 6.4 + of the OWL 2 RDF-Based Semantics specification, available at http://www.w3.org/TR/owl2-rdf-based- + semantics/. Please note that those tables do not include the different annotations (labels, comments and + rdfs:isDefinedBy links) used in this file. Also note that the descriptions provided in this ontology do not + provide a complete and correct formal description of either the syntax or the semantics of the introduced + terms (please see the OWL 2 recommendations for the complete and normative specifications). Furthermore, + the information provided by this ontology may be misleading if not used with care. This ontology SHOULD NOT + be imported into OWL ontologies. Importing this file into an OWL 2 DL ontology will cause it to become + an OWL 2 Full ontology and may have other, unexpected, consequences. + + Generated from: http://www.w3.org/2002/07/owl# + Date: 2020-05-26 14:20:03.193795 + + """ + + _fail = True + + # http://www.w3.org/1999/02/22-rdf-syntax-ns#Property + allValuesFrom: URIRef # The property that determines the class that a universal property restriction refers to. + annotatedProperty: URIRef # The property that determines the predicate of an annotated axiom or annotated annotation. + annotatedSource: URIRef # The property that determines the subject of an annotated axiom or annotated annotation. + annotatedTarget: URIRef # The property that determines the object of an annotated axiom or annotated annotation. + assertionProperty: URIRef # The property that determines the predicate of a negative property assertion. + cardinality: URIRef # The property that determines the cardinality of an exact cardinality restriction. + complementOf: URIRef # The property that determines that a given class is the complement of another class. + datatypeComplementOf: URIRef # The property that determines that a given data range is the complement of another data range with respect to the data domain. + differentFrom: ( + URIRef # The property that determines that two given individuals are different. + ) + disjointUnionOf: URIRef # The property that determines that a given class is equivalent to the disjoint union of a collection of other classes. + disjointWith: ( + URIRef # The property that determines that two given classes are disjoint. + ) + distinctMembers: URIRef # The property that determines the collection of pairwise different individuals in a owl:AllDifferent axiom. + equivalentClass: URIRef # The property that determines that two given classes are equivalent, and that is used to specify datatype definitions. + equivalentProperty: ( + URIRef # The property that determines that two given properties are equivalent. + ) + hasKey: URIRef # The property that determines the collection of properties that jointly build a key. + hasSelf: URIRef # The property that determines the property that a self restriction refers to. + hasValue: URIRef # The property that determines the individual that a has-value restriction refers to. + intersectionOf: URIRef # The property that determines the collection of classes or data ranges that build an intersection. + inverseOf: ( + URIRef # The property that determines that two given properties are inverse. + ) + maxCardinality: URIRef # The property that determines the cardinality of a maximum cardinality restriction. + maxQualifiedCardinality: URIRef # The property that determines the cardinality of a maximum qualified cardinality restriction. + members: URIRef # The property that determines the collection of members in either a owl:AllDifferent, owl:AllDisjointClasses or owl:AllDisjointProperties axiom. + minCardinality: URIRef # The property that determines the cardinality of a minimum cardinality restriction. + minQualifiedCardinality: URIRef # The property that determines the cardinality of a minimum qualified cardinality restriction. + onClass: URIRef # The property that determines the class that a qualified object cardinality restriction refers to. + onDataRange: URIRef # The property that determines the data range that a qualified data cardinality restriction refers to. + onDatatype: URIRef # The property that determines the datatype that a datatype restriction refers to. + onProperties: URIRef # The property that determines the n-tuple of properties that a property restriction on an n-ary data range refers to. + onProperty: URIRef # The property that determines the property that a property restriction refers to. + oneOf: URIRef # The property that determines the collection of individuals or data values that build an enumeration. + propertyChainAxiom: URIRef # The property that determines the n-tuple of properties that build a sub property chain of a given property. + propertyDisjointWith: ( + URIRef # The property that determines that two given properties are disjoint. + ) + qualifiedCardinality: URIRef # The property that determines the cardinality of an exact qualified cardinality restriction. + sameAs: URIRef # The property that determines that two given individuals are equal. + someValuesFrom: URIRef # The property that determines the class that an existential property restriction refers to. + sourceIndividual: URIRef # The property that determines the subject of a negative property assertion. + targetIndividual: URIRef # The property that determines the object of a negative object property assertion. + targetValue: URIRef # The property that determines the value of a negative data property assertion. + unionOf: URIRef # The property that determines the collection of classes or data ranges that build a union. + withRestrictions: URIRef # The property that determines the collection of facet-value pairs that define a datatype restriction. + + # http://www.w3.org/2000/01/rdf-schema#Class + AllDifferent: URIRef # The class of collections of pairwise different individuals. + AllDisjointClasses: URIRef # The class of collections of pairwise disjoint classes. + AllDisjointProperties: ( + URIRef # The class of collections of pairwise disjoint properties. + ) + Annotation: URIRef # The class of annotated annotations for which the RDF serialization consists of an annotated subject, predicate and object. + AnnotationProperty: URIRef # The class of annotation properties. + AsymmetricProperty: URIRef # The class of asymmetric properties. + Axiom: URIRef # The class of annotated axioms for which the RDF serialization consists of an annotated subject, predicate and object. + Class: URIRef # The class of OWL classes. + DataRange: URIRef # The class of OWL data ranges, which are special kinds of datatypes. Note: The use of the IRI owl:DataRange has been deprecated as of OWL 2. The IRI rdfs:Datatype SHOULD be used instead. + DatatypeProperty: URIRef # The class of data properties. + DeprecatedClass: URIRef # The class of deprecated classes. + DeprecatedProperty: URIRef # The class of deprecated properties. + FunctionalProperty: URIRef # The class of functional properties. + InverseFunctionalProperty: URIRef # The class of inverse-functional properties. + IrreflexiveProperty: URIRef # The class of irreflexive properties. + NamedIndividual: URIRef # The class of named individuals. + NegativePropertyAssertion: URIRef # The class of negative property assertions. + ObjectProperty: URIRef # The class of object properties. + Ontology: URIRef # The class of ontologies. + OntologyProperty: URIRef # The class of ontology properties. + ReflexiveProperty: URIRef # The class of reflexive properties. + Restriction: URIRef # The class of property restrictions. + SymmetricProperty: URIRef # The class of symmetric properties. + TransitiveProperty: URIRef # The class of transitive properties. + + # http://www.w3.org/2002/07/owl#AnnotationProperty + backwardCompatibleWith: URIRef # The annotation property that indicates that a given ontology is backward compatible with another ontology. + deprecated: URIRef # The annotation property that indicates that a given entity has been deprecated. + incompatibleWith: URIRef # The annotation property that indicates that a given ontology is incompatible with another ontology. + priorVersion: URIRef # The annotation property that indicates the predecessor ontology of a given ontology. + versionInfo: URIRef # The annotation property that provides version information for an ontology or another OWL construct. + + # http://www.w3.org/2002/07/owl#Class + Nothing: URIRef # This is the empty class. + Thing: URIRef # The class of OWL individuals. + + # http://www.w3.org/2002/07/owl#DatatypeProperty + bottomDataProperty: URIRef # The data property that does not relate any individual to any data value. + topDataProperty: ( + URIRef # The data property that relates every individual to every data value. + ) + + # http://www.w3.org/2002/07/owl#ObjectProperty + bottomObjectProperty: ( + URIRef # The object property that does not relate any two individuals. + ) + topObjectProperty: URIRef # The object property that relates every two individuals. + + # http://www.w3.org/2002/07/owl#OntologyProperty + imports: URIRef # The property that is used for importing other ontologies into a given ontology. + versionIRI: URIRef # The property that identifies the version IRI of an ontology. + + # http://www.w3.org/2000/01/rdf-schema#Datatype + # NOTE: the following two elements don't appear in the OWL RDF documents but are defined in the OWL2 Recommentation + # at https://www.w3.org/TR/owl2-syntax/#Datatype_Maps + rational: URIRef # The value space is the set of all rational numbers. The lexical form is numerator '/' denominator, where both are integers. + real: URIRef # The value space is the set of all real numbers. Does not directly provide any lexical forms. + + _NS = Namespace("http://www.w3.org/2002/07/owl#") diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_PROF.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_PROF.py new file mode 100644 index 0000000000000000000000000000000000000000..b0e26dad91e4920c2434af3fabece2245c070e13 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_PROF.py @@ -0,0 +1,39 @@ +from rdflib.namespace import DefinedNamespace, Namespace +from rdflib.term import URIRef + + +class PROF(DefinedNamespace): + """ + Profiles Vocabulary + + This vocabulary is for describing relationships between standards/specifications, profiles of them and + supporting artifacts such as validating resources. This model starts with + [http://dublincore.org/2012/06/14/dcterms#Standard](dct:Standard) entities which can either be Base + Specifications (a standard not profiling any other Standard) or Profiles (Standards which do profile others). + Base Specifications or Profiles can have Resource Descriptors associated with them that defines implementing + rules for the it. Resource Descriptors must indicate the role they play (to guide, to validate etc.) and the + formalism they adhere to (dct:format) to allow for content negotiation. A vocabulary of Resource Roles are + provided alongside this vocabulary but that list is extensible. + + Generated from: https://www.w3.org/ns/dx/prof/profilesont.ttl + Date: 2020-05-26 14:20:03.542924 + + """ + + # http://www.w3.org/2002/07/owl#Class + Profile: URIRef # A named set of constraints on one or more identified base specifications or other profiles, including the identification of any implementing subclasses of datatypes, semantic interpretations, vocabularies, options and parameters of those base specifications necessary to accomplish a particular function. This definition includes what are often called "application profiles", "metadata application profiles", or "metadata profiles". + ResourceDescriptor: URIRef # A resource that defines an aspect - a particular part or feature - of a Profile + ResourceRole: URIRef # The role that an Resource plays + + # http://www.w3.org/2002/07/owl#DatatypeProperty + hasToken: URIRef # A preferred alternative identifier for the Profile + + # http://www.w3.org/2002/07/owl#ObjectProperty + hasArtifact: URIRef # The URL of a downloadable file with particulars such as its format and role indicated by a Resource Descriptor + hasResource: URIRef # A resource which describes the nature of an artifact and the role it plays in relation to a profile + hasRole: URIRef # The function of the described artifactresource in the expression of the Profile, such as a specification, guidance documentation, SHACL file etc. + isInheritedFrom: URIRef # This property indicates a Resource Descriptor described by this Profile’s base specification that is to be considered a Resource Descriptor for this Profile also + isProfileOf: URIRef # A Profile is a profile of a dct:Standard (or a Base Specification or another Profile) + isTransitiveProfileOf: URIRef # A base specification an Profile conforms to + + _NS = Namespace("http://www.w3.org/ns/dx/prof/") diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_PROV.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_PROV.py new file mode 100644 index 0000000000000000000000000000000000000000..6a7970d5fd1d6ef44d730aaf65f8291746176ad3 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_PROV.py @@ -0,0 +1,250 @@ +from rdflib.namespace import DefinedNamespace, Namespace +from rdflib.term import URIRef + + +class PROV(DefinedNamespace): + """ + W3C PROVenance Interchange Ontology (PROV-O) + + This document is published by the Provenance Working Group (http://www.w3.org/2011/prov/wiki/Main_Page). If + you wish to make comments regarding this document, please send them to public-prov-comments@w3.org (subscribe + public-prov-comments-request@w3.org, archives http://lists.w3.org/Archives/Public/public-prov-comments/). All + feedback is welcome. + + PROV Access and Query Ontology + + This document is published by the Provenance Working Group (http://www.w3.org/2011/prov/wiki/Main_Page). If + you wish to make comments regarding this document, please send them to public-prov-comments@w3.org (subscribe + public-prov-comments-request@w3.org, archives http://lists.w3.org/Archives/Public/public-prov-comments/). All + feedback is welcome. + + Dublin Core extensions of the W3C PROVenance Interchange Ontology (PROV-O) + + This document is published by the Provenance Working Group (http://www.w3.org/2011/prov/wiki/Main_Page). If + you wish to make comments regarding this document, please send them to public-prov-comments@w3.org (subscribe + public-prov-comments-request@w3.org, archives http://lists.w3.org/Archives/Public/public-prov-comments/). All + feedback is welcome. + + W3C PROV Linking Across Provenance Bundles Ontology (PROV-LINKS) + + This document is published by the Provenance Working Group (http://www.w3.org/2011/prov/wiki/Main_Page). If + you wish to make comments regarding this document, please send them to public-prov-comments@w3.org (subscribe + public-prov-comments-request@w3.org, archives http://lists.w3.org/Archives/Public/public-prov-comments/ ). All + feedback is welcome. + + W3C PROVenance Interchange Ontology (PROV-O) Dictionary Extension + + This document is published by the Provenance Working Group (http://www.w3.org/2011/prov/wiki/Main_Page). + If you wish to make comments regarding this document, please send them to public-prov-comments@w3.org + (subscribe public-prov-comments-request@w3.org, archives http://lists.w3.org/Archives/Public/public-prov- + comments/). All feedback is welcome. + + W3C PROVenance Interchange + + This document is published by the Provenance Working Group (http://www.w3.org/2011/prov/wiki/Main_Page). If + you wish to make comments regarding this document, please send them to public-prov-comments@w3.org (subscribe + public-prov-comments-request@w3.org, archives http://lists.w3.org/ Archives/Public/public-prov-comments/). All + feedback is welcome. + + Generated from: http://www.w3.org/ns/prov + Date: 2020-05-26 14:20:04.650279 + + """ + + _fail = True + + # http://www.w3.org/2000/01/rdf-schema#Resource + activityOfInfluence: URIRef # activityOfInfluence + agentOfInfluence: URIRef # agentOfInfluence + contributed: URIRef # contributed + ended: URIRef # ended + entityOfInfluence: URIRef # entityOfInfluence + generalizationOf: URIRef # generalizationOf + generatedAsDerivation: URIRef # generatedAsDerivation + hadDelegate: URIRef # hadDelegate + hadDerivation: URIRef # hadDerivation + hadInfluence: URIRef # hadInfluence + hadRevision: URIRef # hadRevision + informed: URIRef # informed + locationOf: URIRef # locationOf + qualifiedAssociationOf: URIRef # qualifiedAssociationOf + qualifiedAttributionOf: URIRef # qualifiedAttributionOf + qualifiedCommunicationOf: URIRef # qualifiedCommunicationOf + qualifiedDelegationOf: URIRef # qualifiedDelegationOf + qualifiedDerivationOf: URIRef # qualifiedDerivationOf + qualifiedEndOf: URIRef # qualifiedEndOf + qualifiedGenerationOf: URIRef # qualifiedGenerationOf + qualifiedInfluenceOf: URIRef # qualifiedInfluenceOf + qualifiedInvalidationOf: URIRef # qualifiedInvalidationOf + qualifiedQuotationOf: URIRef # qualifiedQuotationOf + qualifiedSourceOf: URIRef # qualifiedSourceOf + qualifiedStartOf: URIRef # qualifiedStartOf + qualifiedUsingActivity: URIRef # qualifiedUsingActivity + quotedAs: URIRef # quotedAs + revisedEntity: URIRef # revisedEntity + started: URIRef # started + wasActivityOfInfluence: URIRef # wasActivityOfInfluence + wasAssociateFor: URIRef # wasAssociateFor + wasMemberOf: URIRef # wasMemberOf + wasPlanOf: URIRef # wasPlanOf + wasPrimarySourceOf: URIRef # wasPrimarySourceOf + wasRoleIn: URIRef # wasRoleIn + wasUsedBy: URIRef # wasUsedBy + wasUsedInDerivation: URIRef # wasUsedInDerivation + + # http://www.w3.org/2002/07/owl#AnnotationProperty + aq: URIRef # + category: URIRef # Classify prov-o terms into three categories, including 'starting-point', 'qualifed', and 'extended'. This classification is used by the prov-o html document to gently introduce prov-o terms to its users. + component: URIRef # Classify prov-o terms into six components according to prov-dm, including 'agents-responsibility', 'alternate', 'annotations', 'collections', 'derivations', and 'entities-activities'. This classification is used so that readers of prov-o specification can find its correspondence with the prov-dm specification. + constraints: URIRef # A reference to the principal section of the PROV-CONSTRAINTS document that describes this concept. + definition: URIRef # A definition quoted from PROV-DM or PROV-CONSTRAINTS that describes the concept expressed with this OWL term. + dm: URIRef # A reference to the principal section of the PROV-DM document that describes this concept. + editorialNote: URIRef # A note by the OWL development team about how this term expresses the PROV-DM concept, or how it should be used in context of semantic web or linked data. + editorsDefinition: URIRef # When the prov-o term does not have a definition drawn from prov-dm, and the prov-o editor provides one. + inverse: URIRef # PROV-O does not define all property inverses. The directionalities defined in PROV-O should be given preference over those not defined. However, if users wish to name the inverse of a PROV-O property, the local name given by prov:inverse should be used. + n: URIRef # A reference to the principal section of the PROV-M document that describes this concept. + order: URIRef # The position that this OWL term should be listed within documentation. The scope of the documentation (e.g., among all terms, among terms within a prov:category, among properties applying to a particular class, etc.) is unspecified. + qualifiedForm: URIRef # This annotation property links a subproperty of prov:wasInfluencedBy with the subclass of prov:Influence and the qualifying property that are used to qualify it. Example annotation: prov:wasGeneratedBy prov:qualifiedForm prov:qualifiedGeneration, prov:Generation . Then this unqualified assertion: :entity1 prov:wasGeneratedBy :activity1 . can be qualified by adding: :entity1 prov:qualifiedGeneration :entity1Gen . :entity1Gen a prov:Generation, prov:Influence; prov:activity :activity1; :customValue 1337 . Note how the value of the unqualified influence (prov:wasGeneratedBy :activity1) is mirrored as the value of the prov:activity (or prov:entity, or prov:agent) property on the influence class. + sharesDefinitionWith: URIRef # + specializationOf: URIRef # specializationOf + todo: URIRef # + unqualifiedForm: URIRef # Classes and properties used to qualify relationships are annotated with prov:unqualifiedForm to indicate the property used to assert an unqualified provenance relation. + wasRevisionOf: URIRef # A revision is a derivation that revises an entity into a revised version. + + # http://www.w3.org/2002/07/owl#Class + Accept: URIRef # Accept + Activity: URIRef # Activity + ActivityInfluence: URIRef # ActivityInfluence provides additional descriptions of an Activity's binary influence upon any other kind of resource. Instances of ActivityInfluence use the prov:activity property to cite the influencing Activity. + Agent: URIRef # Agent + AgentInfluence: URIRef # AgentInfluence provides additional descriptions of an Agent's binary influence upon any other kind of resource. Instances of AgentInfluence use the prov:agent property to cite the influencing Agent. + Association: URIRef # An instance of prov:Association provides additional descriptions about the binary prov:wasAssociatedWith relation from an prov:Activity to some prov:Agent that had some responsibility for it. For example, :baking prov:wasAssociatedWith :baker; prov:qualifiedAssociation [ a prov:Association; prov:agent :baker; :foo :bar ]. + Attribution: URIRef # An instance of prov:Attribution provides additional descriptions about the binary prov:wasAttributedTo relation from an prov:Entity to some prov:Agent that had some responsible for it. For example, :cake prov:wasAttributedTo :baker; prov:qualifiedAttribution [ a prov:Attribution; prov:entity :baker; :foo :bar ]. + Bundle: URIRef # Note that there are kinds of bundles (e.g. handwritten letters, audio recordings, etc.) that are not expressed in PROV-O, but can be still be described by PROV-O. + Collection: URIRef # Collection + Communication: URIRef # An instance of prov:Communication provides additional descriptions about the binary prov:wasInformedBy relation from an informed prov:Activity to the prov:Activity that informed it. For example, :you_jumping_off_bridge prov:wasInformedBy :everyone_else_jumping_off_bridge; prov:qualifiedCommunication [ a prov:Communication; prov:activity :everyone_else_jumping_off_bridge; :foo :bar ]. + Contribute: URIRef # Contribute + Contributor: URIRef # Contributor + Copyright: URIRef # Copyright + Create: URIRef # Create + Creator: URIRef # Creator + Delegation: URIRef # An instance of prov:Delegation provides additional descriptions about the binary prov:actedOnBehalfOf relation from a performing prov:Agent to some prov:Agent for whom it was performed. For example, :mixing prov:wasAssociatedWith :toddler . :toddler prov:actedOnBehalfOf :mother; prov:qualifiedDelegation [ a prov:Delegation; prov:entity :mother; :foo :bar ]. + Derivation: URIRef # The more specific forms of prov:Derivation (i.e., prov:Revision, prov:Quotation, prov:PrimarySource) should be asserted if they apply. + Dictionary: URIRef # This concept allows for the provenance of the dictionary, but also of its constituents to be expressed. Such a notion of dictionary corresponds to a wide variety of concrete data structures, such as a maps or associative arrays. + DirectQueryService: URIRef # Type for a generic provenance query service. Mainly for use in RDF provenance query service descriptions, to facilitate discovery in linked data environments. + EmptyDictionary: URIRef # Empty Dictionary + End: URIRef # An instance of prov:End provides additional descriptions about the binary prov:wasEndedBy relation from some ended prov:Activity to an prov:Entity that ended it. For example, :ball_game prov:wasEndedBy :buzzer; prov:qualifiedEnd [ a prov:End; prov:entity :buzzer; :foo :bar; prov:atTime '2012-03-09T08:05:08-05:00'^^xsd:dateTime ]. + Entity: URIRef # Entity + EntityInfluence: URIRef # It is not recommended that the type EntityInfluence be asserted without also asserting one of its more specific subclasses. + Generation: URIRef # An instance of prov:Generation provides additional descriptions about the binary prov:wasGeneratedBy relation from a generated prov:Entity to the prov:Activity that generated it. For example, :cake prov:wasGeneratedBy :baking; prov:qualifiedGeneration [ a prov:Generation; prov:activity :baking; :foo :bar ]. + Influence: URIRef # Because prov:Influence is a broad relation, its most specific subclasses (e.g. prov:Communication, prov:Delegation, prov:End, prov:Revision, etc.) should be used when applicable. + Insertion: URIRef # Insertion + InstantaneousEvent: URIRef # An instantaneous event, or event for short, happens in the world and marks a change in the world, in its activities and in its entities. The term 'event' is commonly used in process algebra with a similar meaning. Events represent communications or interactions; they are assumed to be atomic and instantaneous. + Invalidation: URIRef # An instance of prov:Invalidation provides additional descriptions about the binary prov:wasInvalidatedBy relation from an invalidated prov:Entity to the prov:Activity that invalidated it. For example, :uncracked_egg prov:wasInvalidatedBy :baking; prov:qualifiedInvalidation [ a prov:Invalidation; prov:activity :baking; :foo :bar ]. + KeyEntityPair: URIRef # Key-Entity Pair + Location: URIRef # Location + Modify: URIRef # Modify + Organization: URIRef # Organization + Person: URIRef # Person + Plan: URIRef # There exist no prescriptive requirement on the nature of plans, their representation, the actions or steps they consist of, or their intended goals. Since plans may evolve over time, it may become necessary to track their provenance, so plans themselves are entities. Representing the plan explicitly in the provenance can be useful for various tasks: for example, to validate the execution as represented in the provenance record, to manage expectation failures, or to provide explanations. + PrimarySource: URIRef # An instance of prov:PrimarySource provides additional descriptions about the binary prov:hadPrimarySource relation from some secondary prov:Entity to an earlier, primary prov:Entity. For example, :blog prov:hadPrimarySource :newsArticle; prov:qualifiedPrimarySource [ a prov:PrimarySource; prov:entity :newsArticle; :foo :bar ] . + Publish: URIRef # Publish + Publisher: URIRef # Publisher + Quotation: URIRef # An instance of prov:Quotation provides additional descriptions about the binary prov:wasQuotedFrom relation from some taken prov:Entity from an earlier, larger prov:Entity. For example, :here_is_looking_at_you_kid prov:wasQuotedFrom :casablanca_script; prov:qualifiedQuotation [ a prov:Quotation; prov:entity :casablanca_script; :foo :bar ]. + Removal: URIRef # Removal + Replace: URIRef # Replace + Revision: URIRef # An instance of prov:Revision provides additional descriptions about the binary prov:wasRevisionOf relation from some newer prov:Entity to an earlier prov:Entity. For example, :draft_2 prov:wasRevisionOf :draft_1; prov:qualifiedRevision [ a prov:Revision; prov:entity :draft_1; :foo :bar ]. + RightsAssignment: URIRef # RightsAssignment + RightsHolder: URIRef # RightsHolder + Role: URIRef # Role + ServiceDescription: URIRef # Type for a generic provenance query service. Mainly for use in RDF provenance query service descriptions, to facilitate discovery in linked data environments. + SoftwareAgent: URIRef # SoftwareAgent + Start: URIRef # An instance of prov:Start provides additional descriptions about the binary prov:wasStartedBy relation from some started prov:Activity to an prov:Entity that started it. For example, :foot_race prov:wasStartedBy :bang; prov:qualifiedStart [ a prov:Start; prov:entity :bang; :foo :bar; prov:atTime '2012-03-09T08:05:08-05:00'^^xsd:dateTime ] . + Submit: URIRef # Submit + Usage: URIRef # An instance of prov:Usage provides additional descriptions about the binary prov:used relation from some prov:Activity to an prov:Entity that it used. For example, :keynote prov:used :podium; prov:qualifiedUsage [ a prov:Usage; prov:entity :podium; :foo :bar ]. + + # http://www.w3.org/2002/07/owl#DatatypeProperty + atTime: URIRef # The time at which an InstantaneousEvent occurred, in the form of xsd:dateTime. + endedAtTime: ( + URIRef # The time at which an activity ended. See also prov:startedAtTime. + ) + generatedAtTime: URIRef # The time at which an entity was completely created and is available for use. + invalidatedAtTime: ( + URIRef # The time at which an entity was invalidated (i.e., no longer usable). + ) + provenanceUriTemplate: URIRef # Relates a provenance service to a URI template string for constructing provenance-URIs. + removedKey: URIRef # removedKey + startedAtTime: ( + URIRef # The time at which an activity started. See also prov:endedAtTime. + ) + value: URIRef # value + + # http://www.w3.org/2002/07/owl#FunctionalProperty + pairEntity: URIRef # pairKey + pairKey: URIRef # pairKey + + # http://www.w3.org/2002/07/owl#NamedIndividual + EmptyCollection: URIRef # EmptyCollection + + # http://www.w3.org/2002/07/owl#ObjectProperty + actedOnBehalfOf: URIRef # An object property to express the accountability of an agent towards another agent. The subordinate agent acted on behalf of the responsible agent in an actual activity. + activity: URIRef # activity + agent: URIRef # agent + alternateOf: URIRef # alternateOf + asInBundle: URIRef # prov:asInBundle is used to specify which bundle the general entity of a prov:mentionOf property is described. When :x prov:mentionOf :y and :y is described in Bundle :b, the triple :x prov:asInBundle :b is also asserted to cite the Bundle in which :y was described. + atLocation: URIRef # The Location of any resource. + derivedByInsertionFrom: URIRef # derivedByInsertionFrom + derivedByRemovalFrom: URIRef # derivedByRemovalFrom + describesService: URIRef # relates a generic provenance query service resource (type prov:ServiceDescription) to a specific query service description (e.g. a prov:DirectQueryService or a sd:Service). + dictionary: URIRef # dictionary + entity: URIRef # entity + generated: URIRef # generated + hadActivity: URIRef # The _optional_ Activity of an Influence, which used, generated, invalidated, or was the responsibility of some Entity. This property is _not_ used by ActivityInfluence (use prov:activity instead). + hadDictionaryMember: URIRef # hadDictionaryMember + hadGeneration: ( + URIRef # The _optional_ Generation involved in an Entity's Derivation. + ) + hadMember: URIRef # hadMember + hadPlan: URIRef # The _optional_ Plan adopted by an Agent in Association with some Activity. Plan specifications are out of the scope of this specification. + hadPrimarySource: URIRef # hadPrimarySource + hadRole: URIRef # This property has multiple RDFS domains to suit multiple OWL Profiles. See PROV-O OWL Profile. + hadUsage: URIRef # The _optional_ Usage involved in an Entity's Derivation. + has_anchor: ( + URIRef # Indicates anchor URI for a potentially dynamic resource instance. + ) + has_provenance: URIRef # Indicates a provenance-URI for a resource; the resource identified by this property presents a provenance record about its subject or anchor resource. + has_query_service: URIRef # Indicates a provenance query service that can access provenance related to its subject or anchor resource. + influenced: URIRef # influenced + influencer: URIRef # Subproperties of prov:influencer are used to cite the object of an unqualified PROV-O triple whose predicate is a subproperty of prov:wasInfluencedBy (e.g. prov:used, prov:wasGeneratedBy). prov:influencer is used much like rdf:object is used. + insertedKeyEntityPair: URIRef # insertedKeyEntityPair + invalidated: URIRef # invalidated + mentionOf: URIRef # prov:mentionOf is used to specialize an entity as described in another bundle. It is to be used in conjunction with prov:asInBundle. prov:asInBundle is used to cite the Bundle in which the generalization was mentioned. + pingback: URIRef # Relates a resource to a provenance pingback service that may receive additional provenance links about the resource. + qualifiedAssociation: URIRef # If this Activity prov:wasAssociatedWith Agent :ag, then it can qualify the Association using prov:qualifiedAssociation [ a prov:Association; prov:agent :ag; :foo :bar ]. + qualifiedAttribution: URIRef # If this Entity prov:wasAttributedTo Agent :ag, then it can qualify how it was influenced using prov:qualifiedAttribution [ a prov:Attribution; prov:agent :ag; :foo :bar ]. + qualifiedCommunication: URIRef # If this Activity prov:wasInformedBy Activity :a, then it can qualify how it was influenced using prov:qualifiedCommunication [ a prov:Communication; prov:activity :a; :foo :bar ]. + qualifiedDelegation: URIRef # If this Agent prov:actedOnBehalfOf Agent :ag, then it can qualify how with prov:qualifiedResponsibility [ a prov:Responsibility; prov:agent :ag; :foo :bar ]. + qualifiedDerivation: URIRef # If this Entity prov:wasDerivedFrom Entity :e, then it can qualify how it was derived using prov:qualifiedDerivation [ a prov:Derivation; prov:entity :e; :foo :bar ]. + qualifiedEnd: URIRef # If this Activity prov:wasEndedBy Entity :e1, then it can qualify how it was ended using prov:qualifiedEnd [ a prov:End; prov:entity :e1; :foo :bar ]. + qualifiedGeneration: URIRef # If this Activity prov:generated Entity :e, then it can qualify how it performed the Generation using prov:qualifiedGeneration [ a prov:Generation; prov:entity :e; :foo :bar ]. + qualifiedInfluence: URIRef # Because prov:qualifiedInfluence is a broad relation, the more specific relations (qualifiedCommunication, qualifiedDelegation, qualifiedEnd, etc.) should be used when applicable. + qualifiedInsertion: URIRef # qualifiedInsertion + qualifiedInvalidation: URIRef # If this Entity prov:wasInvalidatedBy Activity :a, then it can qualify how it was invalidated using prov:qualifiedInvalidation [ a prov:Invalidation; prov:activity :a; :foo :bar ]. + qualifiedPrimarySource: URIRef # If this Entity prov:hadPrimarySource Entity :e, then it can qualify how using prov:qualifiedPrimarySource [ a prov:PrimarySource; prov:entity :e; :foo :bar ]. + qualifiedQuotation: URIRef # If this Entity prov:wasQuotedFrom Entity :e, then it can qualify how using prov:qualifiedQuotation [ a prov:Quotation; prov:entity :e; :foo :bar ]. + qualifiedRemoval: URIRef # qualifiedRemoval + qualifiedRevision: URIRef # If this Entity prov:wasRevisionOf Entity :e, then it can qualify how it was revised using prov:qualifiedRevision [ a prov:Revision; prov:entity :e; :foo :bar ]. + qualifiedStart: URIRef # If this Activity prov:wasStartedBy Entity :e1, then it can qualify how it was started using prov:qualifiedStart [ a prov:Start; prov:entity :e1; :foo :bar ]. + qualifiedUsage: URIRef # If this Activity prov:used Entity :e, then it can qualify how it used it using prov:qualifiedUsage [ a prov:Usage; prov:entity :e; :foo :bar ]. + used: URIRef # A prov:Entity that was used by this prov:Activity. For example, :baking prov:used :spoon, :egg, :oven . + wasAssociatedWith: URIRef # An prov:Agent that had some (unspecified) responsibility for the occurrence of this prov:Activity. + wasAttributedTo: URIRef # Attribution is the ascribing of an entity to an agent. + wasDerivedFrom: URIRef # The more specific subproperties of prov:wasDerivedFrom (i.e., prov:wasQuotedFrom, prov:wasRevisionOf, prov:hadPrimarySource) should be used when applicable. + wasEndedBy: URIRef # End is when an activity is deemed to have ended. An end may refer to an entity, known as trigger, that terminated the activity. + wasGeneratedBy: URIRef # wasGeneratedBy + wasInfluencedBy: URIRef # This property has multiple RDFS domains to suit multiple OWL Profiles. See PROV-O OWL Profile. + wasInformedBy: URIRef # An activity a2 is dependent on or informed by another activity a1, by way of some unspecified entity that is generated by a1 and used by a2. + wasInvalidatedBy: URIRef # wasInvalidatedBy + wasQuotedFrom: URIRef # An entity is derived from an original entity by copying, or 'quoting', some or all of it. + wasStartedBy: URIRef # Start is when an activity is deemed to have started. A start may refer to an entity, known as trigger, that initiated the activity. + + _NS = Namespace("http://www.w3.org/ns/prov#") diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_QB.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_QB.py new file mode 100644 index 0000000000000000000000000000000000000000..6494fd53ac249ac0cf284230579cf68fb16b61c7 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_QB.py @@ -0,0 +1,63 @@ +from rdflib.namespace import DefinedNamespace, Namespace +from rdflib.term import URIRef + + +class QB(DefinedNamespace): + """ + Vocabulary for multi-dimensional (e.g. statistical) data publishing + + This vocabulary allows multi-dimensional data, such as statistics, to be published in RDF. It is based on the + core information model from SDMX (and thus also DDI). + + Generated from: http://purl.org/linked-data/cube# + Date: 2020-05-26 14:20:05.485176 + + """ + + _fail = True + + # http://www.w3.org/1999/02/22-rdf-syntax-ns#Property + attribute: URIRef # An alternative to qb:componentProperty which makes explicit that the component is a attribute + codeList: URIRef # gives the code list associated with a CodedProperty + component: URIRef # indicates a component specification which is included in the structure of the dataset + componentAttachment: URIRef # Indicates the level at which the component property should be attached, this might an qb:DataSet, qb:Slice or qb:Observation, or a qb:MeasureProperty. + componentProperty: URIRef # indicates a ComponentProperty (i.e. attribute/dimension) expected on a DataSet, or a dimension fixed in a SliceKey + componentRequired: URIRef # Indicates whether a component property is required (true) or optional (false) in the context of a DSD. Only applicable to components correspond to an attribute. Defaults to false (optional). + concept: URIRef # gives the concept which is being measured or indicated by a ComponentProperty + dataSet: URIRef # indicates the data set of which this observation is a part + dimension: URIRef # An alternative to qb:componentProperty which makes explicit that the component is a dimension + hierarchyRoot: URIRef # Specifies a root of the hierarchy. A hierarchy may have multiple roots but must have at least one. + measure: URIRef # An alternative to qb:componentProperty which makes explicit that the component is a measure + measureDimension: URIRef # An alternative to qb:componentProperty which makes explicit that the component is a measure dimension + measureType: URIRef # Generic measure dimension, the value of this dimension indicates which measure (from the set of measures in the DSD) is being given by the obsValue (or other primary measure) + observation: ( + URIRef # indicates a observation contained within this slice of the data set + ) + observationGroup: URIRef # Indicates a group of observations. The domain of this property is left open so that a group may be attached to different resources and need not be restricted to a single DataSet + order: URIRef # indicates a priority order for the components of sets with this structure, used to guide presentations - lower order numbers come before higher numbers, un-numbered components come last + parentChildProperty: URIRef # Specifies a property which relates a parent concept in the hierarchy to a child concept. + slice: URIRef # Indicates a subset of a DataSet defined by fixing a subset of the dimensional values + sliceKey: URIRef # indicates a slice key which is used for slices in this dataset + sliceStructure: URIRef # indicates the sub-key corresponding to this slice + structure: URIRef # indicates the structure to which this data set conforms + + # http://www.w3.org/2000/01/rdf-schema#Class + Attachable: URIRef # Abstract superclass for everything that can have attributes and dimensions + AttributeProperty: URIRef # The class of components which represent attributes of observations in the cube, e.g. unit of measurement + CodedProperty: URIRef # Superclass of all coded ComponentProperties + ComponentProperty: URIRef # Abstract super-property of all properties representing dimensions, attributes or measures + ComponentSet: URIRef # Abstract class of things which reference one or more ComponentProperties + ComponentSpecification: URIRef # Used to define properties of a component (attribute, dimension etc) which are specific to its usage in a DSD. + DataSet: URIRef # Represents a collection of observations, possibly organized into various slices, conforming to some common dimensional structure. + DataStructureDefinition: URIRef # Defines the structure of a DataSet or slice + DimensionProperty: ( + URIRef # The class of components which represent the dimensions of the cube + ) + HierarchicalCodeList: URIRef # Represents a generalized hierarchy of concepts which can be used for coding. The hierarchy is defined by one or more roots together with a property which relates concepts in the hierarchy to their child concept . The same concepts may be members of multiple hierarchies provided that different qb:parentChildProperty values are used for each hierarchy. + MeasureProperty: URIRef # The class of components which represent the measured value of the phenomenon being observed + Observation: URIRef # A single observation in the cube, may have one or more associated measured values + ObservationGroup: URIRef # A, possibly arbitrary, group of observations. + Slice: URIRef # Denotes a subset of a DataSet defined by fixing a subset of the dimensional values, component properties on the Slice + SliceKey: URIRef # Denotes a subset of the component properties of a DataSet which are fixed in the corresponding slices + + _NS = Namespace("http://purl.org/linked-data/cube#") diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_RDF.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_RDF.py new file mode 100644 index 0000000000000000000000000000000000000000..ef1fde5dcd3d451b9b353375e97fba9120f01ace --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_RDF.py @@ -0,0 +1,51 @@ +from rdflib.namespace import DefinedNamespace, Namespace +from rdflib.term import URIRef + + +class RDF(DefinedNamespace): + """ + The RDF Concepts Vocabulary (RDF) + + This is the RDF Schema for the RDF vocabulary terms in the RDF Namespace, defined in RDF 1.1 Concepts. + + Generated from: http://www.w3.org/1999/02/22-rdf-syntax-ns# + Date: 2020-05-26 14:20:05.642859 + + dc:date "2019-12-16" + + """ + + _fail = True + _underscore_num = True + + # http://www.w3.org/1999/02/22-rdf-syntax-ns#List + nil: URIRef # The empty list, with no items in it. If the rest of a list is nil then the list has no more items in it. + + # http://www.w3.org/1999/02/22-rdf-syntax-ns#Property + direction: URIRef # The base direction component of a CompoundLiteral. + first: URIRef # The first item in the subject RDF list. + language: URIRef # The language component of a CompoundLiteral. + object: URIRef # The object of the subject RDF statement. + predicate: URIRef # The predicate of the subject RDF statement. + rest: URIRef # The rest of the subject RDF list after the first item. + subject: URIRef # The subject of the subject RDF statement. + type: URIRef # The subject is an instance of a class. + value: URIRef # Idiomatic property used for structured values. + + # http://www.w3.org/2000/01/rdf-schema#Class + Alt: URIRef # The class of containers of alternatives. + Bag: URIRef # The class of unordered containers. + CompoundLiteral: URIRef # A class representing a compound literal. + List: URIRef # The class of RDF Lists. + Property: URIRef # The class of RDF properties. + Seq: URIRef # The class of ordered containers. + Statement: URIRef # The class of RDF statements. + + # http://www.w3.org/2000/01/rdf-schema#Datatype + HTML: URIRef # The datatype of RDF literals storing fragments of HTML content + JSON: URIRef # The datatype of RDF literals storing JSON content. + PlainLiteral: URIRef # The class of plain (i.e. untyped) literal values, as used in RIF and OWL 2 + XMLLiteral: URIRef # The datatype of XML literal values. + langString: URIRef # The datatype of language-tagged string values + + _NS = Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#") diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_RDFS.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_RDFS.py new file mode 100644 index 0000000000000000000000000000000000000000..273b114880e7c568133a69fb59ec07920ef17595 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_RDFS.py @@ -0,0 +1,35 @@ +from rdflib.namespace import DefinedNamespace, Namespace +from rdflib.term import URIRef + + +class RDFS(DefinedNamespace): + """ + The RDF Schema vocabulary (RDFS) + + Generated from: http://www.w3.org/2000/01/rdf-schema# + Date: 2020-05-26 14:20:05.794866 + + """ + + _fail = True + + # http://www.w3.org/1999/02/22-rdf-syntax-ns#Property + comment: URIRef # A description of the subject resource. + domain: URIRef # A domain of the subject property. + isDefinedBy: URIRef # The definition of the subject resource. + label: URIRef # A human-readable name for the subject. + member: URIRef # A member of the subject resource. + range: URIRef # A range of the subject property. + seeAlso: URIRef # Further information about the subject resource. + subClassOf: URIRef # The subject is a subclass of a class. + subPropertyOf: URIRef # The subject is a subproperty of a property. + + # http://www.w3.org/2000/01/rdf-schema#Class + Class: URIRef # The class of classes. + Container: URIRef # The class of RDF containers. + ContainerMembershipProperty: URIRef # The class of container membership properties, rdf:_1, rdf:_2, ..., all of which are sub-properties of 'member'. + Datatype: URIRef # The class of RDF datatypes. + Literal: URIRef # The class of literal values, eg. textual strings and integers. + Resource: URIRef # The class resource, everything. + + _NS = Namespace("http://www.w3.org/2000/01/rdf-schema#") diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_SDO.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_SDO.py new file mode 100644 index 0000000000000000000000000000000000000000..634fe4322dd0d735fda158e8f1c4d9decb003554 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_SDO.py @@ -0,0 +1,3278 @@ +from rdflib.namespace import DefinedNamespace, Namespace +from rdflib.term import URIRef + + +class SDO(DefinedNamespace): + """ + schema.org namespace elements + + 3DModel, True, False & yield are not available as they collde with Python terms + + Generated from: https://schema.org/version/latest/schemaorg-current-https.jsonld + Date: 2021-12-01 + By: Nicholas J. Car + """ + + _NS = Namespace("https://schema.org/") + + # 3DModel: URIRef # A 3D model represents some kind of 3D content, which may have [[encoding]]s in one or more [[MediaObject]]s. Many 3D formats are available (e.g. see [Wikipedia](https://en.wikipedia.org/wiki/Category:3D_graphics_file_formats)); specific encoding formats can be represented using the [[encodingFormat]] property applied to the relevant [[MediaObject]]. For the case of a single file published after Zip compression, the convention of appending '+zip' to the [[encodingFormat]] can be used. Geospatial, AR/VR, artistic/animation, gaming, engineering and scientific content can all be represented using [[3DModel]]. + AMRadioChannel: URIRef # A radio channel that uses AM. + APIReference: ( + URIRef # Reference documentation for application programming interfaces (APIs). + ) + Abdomen: URIRef # Abdomen clinical examination. + AboutPage: URIRef # Web page type: About page. + AcceptAction: URIRef # The act of committing to/adopting an object.\n\nRelated actions:\n\n* [[RejectAction]]: The antonym of AcceptAction. + Accommodation: URIRef # An accommodation is a place that can accommodate human beings, e.g. a hotel room, a camping pitch, or a meeting room. Many accommodations are for overnight stays, but this is not a mandatory requirement. For more specific types of accommodations not defined in schema.org, one can use additionalType with external vocabularies.

See also the dedicated document on the use of schema.org for marking up hotels and other forms of accommodations. + AccountingService: URIRef # Accountancy business.\n\nAs a [[LocalBusiness]] it can be described as a [[provider]] of one or more [[Service]]\(s). + AchieveAction: URIRef # The act of accomplishing something via previous efforts. It is an instantaneous action rather than an ongoing process. + Action: URIRef # An action performed by a direct agent and indirect participants upon a direct object. Optionally happens at a location with the help of an inanimate instrument. The execution of the action may produce a result. Specific action sub-type documentation specifies the exact expectation of each argument/role.\n\nSee also [blog post](http://blog.schema.org/2014/04/announcing-schemaorg-actions.html) and [Actions overview document](https://schema.org/docs/actions.html). + ActionAccessSpecification: URIRef # A set of requirements that a must be fulfilled in order to perform an Action. + ActionStatusType: URIRef # The status of an Action. + ActivateAction: URIRef # The act of starting or activating a device or application (e.g. starting a timer or turning on a flashlight). + ActivationFee: URIRef # Represents the activation fee part of the total price for an offered product, for example a cellphone contract. + ActiveActionStatus: URIRef # An in-progress action (e.g, while watching the movie, or driving to a location). + ActiveNotRecruiting: URIRef # Active, but not recruiting new participants. + AddAction: URIRef # The act of editing by adding an object to a collection. + AdministrativeArea: URIRef # A geographical region, typically under the jurisdiction of a particular government. + AdultEntertainment: URIRef # An adult entertainment establishment. + AdvertiserContentArticle: URIRef # An [[Article]] that an external entity has paid to place or to produce to its specifications. Includes [advertorials](https://en.wikipedia.org/wiki/Advertorial), sponsored content, native advertising and other paid content. + AerobicActivity: URIRef # Physical activity of relatively low intensity that depends primarily on the aerobic energy-generating process; during activity, the aerobic metabolism uses oxygen to adequately meet energy demands during exercise. + AggregateOffer: URIRef # When a single product is associated with multiple offers (for example, the same pair of shoes is offered by different merchants), then AggregateOffer can be used.\n\nNote: AggregateOffers are normally expected to associate multiple offers that all share the same defined [[businessFunction]] value, or default to http://purl.org/goodrelations/v1#Sell if businessFunction is not explicitly defined. + AggregateRating: URIRef # The average rating based on multiple ratings or reviews. + AgreeAction: URIRef # The act of expressing a consistency of opinion with the object. An agent agrees to/about an object (a proposition, topic or theme) with participants. + Airline: URIRef # An organization that provides flights for passengers. + Airport: URIRef # An airport. + AlbumRelease: URIRef # AlbumRelease. + AlignmentObject: URIRef # An intangible item that describes an alignment between a learning resource and a node in an educational framework. Should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency. + AllWheelDriveConfiguration: URIRef # All-wheel Drive is a transmission layout where the engine drives all four wheels. + AllergiesHealthAspect: ( + URIRef # Content about the allergy-related aspects of a health topic. + ) + AllocateAction: URIRef # The act of organizing tasks/objects/events by associating resources to it. + AmpStory: URIRef # A creative work with a visual storytelling format intended to be viewed online, particularly on mobile devices. + AmusementPark: URIRef # An amusement park. + AnaerobicActivity: URIRef # Physical activity that is of high-intensity which utilizes the anaerobic metabolism of the body. + AnalysisNewsArticle: URIRef # An AnalysisNewsArticle is a [[NewsArticle]] that, while based on factual reporting, incorporates the expertise of the author/producer, offering interpretations and conclusions. + AnatomicalStructure: URIRef # Any part of the human body, typically a component of an anatomical system. Organs, tissues, and cells are all anatomical structures. + AnatomicalSystem: URIRef # An anatomical system is a group of anatomical structures that work together to perform a certain task. Anatomical systems, such as organ systems, are one organizing principle of anatomy, and can includes circulatory, digestive, endocrine, integumentary, immune, lymphatic, muscular, nervous, reproductive, respiratory, skeletal, urinary, vestibular, and other systems. + Anesthesia: URIRef # A specific branch of medical science that pertains to study of anesthetics and their application. + AnimalShelter: URIRef # Animal shelter. + Answer: URIRef # An answer offered to a question; perhaps correct, perhaps opinionated or wrong. + Apartment: URIRef # An apartment (in American English) or flat (in British English) is a self-contained housing unit (a type of residential real estate) that occupies only part of a building (Source: Wikipedia, the free encyclopedia, see http://en.wikipedia.org/wiki/Apartment). + ApartmentComplex: URIRef # Residence type: Apartment complex. + Appearance: URIRef # Appearance assessment with clinical examination. + AppendAction: URIRef # The act of inserting at the end if an ordered collection. + ApplyAction: URIRef # The act of registering to an organization/service without the guarantee to receive it.\n\nRelated actions:\n\n* [[RegisterAction]]: Unlike RegisterAction, ApplyAction has no guarantees that the application will be accepted. + ApprovedIndication: URIRef # An indication for a medical therapy that has been formally specified or approved by a regulatory body that regulates use of the therapy; for example, the US FDA approves indications for most drugs in the US. + Aquarium: URIRef # Aquarium. + ArchiveComponent: URIRef # An intangible type to be applied to any archive content, carrying with it a set of properties required to describe archival items and collections. + ArchiveOrganization: URIRef # An organization with archival holdings. An organization which keeps and preserves archival material and typically makes it accessible to the public. + ArriveAction: URIRef # The act of arriving at a place. An agent arrives at a destination from a fromLocation, optionally with participants. + ArtGallery: URIRef # An art gallery. + Artery: URIRef # A type of blood vessel that specifically carries blood away from the heart. + Article: URIRef # An article, such as a news article or piece of investigative report. Newspapers and magazines have articles of many different types and this is intended to cover them all.\n\nSee also [blog post](http://blog.schema.org/2014/09/schemaorg-support-for-bibliographic_2.html). + AskAction: URIRef # The act of posing a question / favor to someone.\n\nRelated actions:\n\n* [[ReplyAction]]: Appears generally as a response to AskAction. + AskPublicNewsArticle: URIRef # A [[NewsArticle]] expressing an open call by a [[NewsMediaOrganization]] asking the public for input, insights, clarifications, anecdotes, documentation, etc., on an issue, for reporting purposes. + AssessAction: URIRef # The act of forming one's opinion, reaction or sentiment. + AssignAction: URIRef # The act of allocating an action/event/task to some destination (someone or something). + Atlas: URIRef # A collection or bound volume of maps, charts, plates or tables, physical or in media form illustrating any subject. + Attorney: URIRef # Professional service: Attorney. \n\nThis type is deprecated - [[LegalService]] is more inclusive and less ambiguous. + Audience: URIRef # Intended audience for an item, i.e. the group for whom the item was created. + AudioObject: URIRef # An audio file. + AudioObjectSnapshot: URIRef # A specific and exact (byte-for-byte) version of an [[AudioObject]]. Two byte-for-byte identical files, for the purposes of this type, considered identical. If they have different embedded metadata the files will differ. Different external facts about the files, e.g. creator or dateCreated that aren't represented in their actual content, do not affect this notion of identity. + Audiobook: URIRef # An audiobook. + AudiobookFormat: URIRef # Book format: Audiobook. This is an enumerated value for use with the bookFormat property. There is also a type 'Audiobook' in the bib extension which includes Audiobook specific properties. + AuthoritativeLegalValue: URIRef # Indicates that the publisher gives some special status to the publication of the document. ("The Queens Printer" version of a UK Act of Parliament, or the PDF version of a Directive published by the EU Office of Publications). Something "Authoritative" is considered to be also [[OfficialLegalValue]]". + AuthorizeAction: URIRef # The act of granting permission to an object. + AutoBodyShop: URIRef # Auto body shop. + AutoDealer: URIRef # An car dealership. + AutoPartsStore: URIRef # An auto parts store. + AutoRental: URIRef # A car rental business. + AutoRepair: URIRef # Car repair business. + AutoWash: URIRef # A car wash business. + AutomatedTeller: URIRef # ATM/cash machine. + AutomotiveBusiness: URIRef # Car repair, sales, or parts. + Ayurvedic: URIRef # A system of medicine that originated in India over thousands of years and that focuses on integrating and balancing the body, mind, and spirit. + BackOrder: URIRef # Indicates that the item is available on back order. + BackgroundNewsArticle: URIRef # A [[NewsArticle]] providing historical context, definition and detail on a specific topic (aka "explainer" or "backgrounder"). For example, an in-depth article or frequently-asked-questions ([FAQ](https://en.wikipedia.org/wiki/FAQ)) document on topics such as Climate Change or the European Union. Other kinds of background material from a non-news setting are often described using [[Book]] or [[Article]], in particular [[ScholarlyArticle]]. See also [[NewsArticle]] for related vocabulary from a learning/education perspective. + Bacteria: URIRef # Pathogenic bacteria that cause bacterial infection. + Bakery: URIRef # A bakery. + Balance: URIRef # Physical activity that is engaged to help maintain posture and balance. + BankAccount: URIRef # A product or service offered by a bank whereby one may deposit, withdraw or transfer money and in some cases be paid interest. + BankOrCreditUnion: URIRef # Bank or credit union. + BarOrPub: URIRef # A bar or pub. + Barcode: URIRef # An image of a visual machine-readable code such as a barcode or QR code. + BasicIncome: URIRef # BasicIncome: this is a benefit for basic income. + Beach: URIRef # Beach. + BeautySalon: URIRef # Beauty salon. + BedAndBreakfast: URIRef # Bed and breakfast.

See also the dedicated document on the use of schema.org for marking up hotels and other forms of accommodations. + BedDetails: URIRef # An entity holding detailed information about the available bed types, e.g. the quantity of twin beds for a hotel room. For the single case of just one bed of a certain type, you can use bed directly with a text. See also [[BedType]] (under development). + BedType: URIRef # A type of bed. This is used for indicating the bed or beds available in an accommodation. + BefriendAction: URIRef # The act of forming a personal connection with someone (object) mutually/bidirectionally/symmetrically.\n\nRelated actions:\n\n* [[FollowAction]]: Unlike FollowAction, BefriendAction implies that the connection is reciprocal. + BenefitsHealthAspect: URIRef # Content about the benefits and advantages of usage or utilization of topic. + BikeStore: URIRef # A bike store. + BioChemEntity: URIRef # Any biological, chemical, or biochemical thing. For example: a protein; a gene; a chemical; a synthetic chemical. + Blog: URIRef # A [blog](https://en.wikipedia.org/wiki/Blog), sometimes known as a "weblog". Note that the individual posts ([[BlogPosting]]s) in a [[Blog]] are often colloqually referred to by the same term. + BlogPosting: URIRef # A blog post. + BloodTest: URIRef # A medical test performed on a sample of a patient's blood. + BoardingPolicyType: URIRef # A type of boarding policy used by an airline. + BoatReservation: URIRef # A reservation for boat travel. Note: This type is for information about actual reservations, e.g. in confirmation emails or HTML pages with individual confirmations of reservations. For offers of tickets, use [[Offer]]. + BoatTerminal: URIRef # A terminal for boats, ships, and other water vessels. + BoatTrip: URIRef # A trip on a commercial ferry line. + BodyMeasurementArm: URIRef # Arm length (measured between arms/shoulder line intersection and the prominent wrist bone). Used, for example, to fit shirts. + BodyMeasurementBust: ( + URIRef # Maximum girth of bust. Used, for example, to fit women's suits. + ) + BodyMeasurementChest: ( + URIRef # Maximum girth of chest. Used, for example, to fit men's suits. + ) + BodyMeasurementFoot: URIRef # Foot length (measured between end of the most prominent toe and the most prominent part of the heel). Used, for example, to measure socks. + BodyMeasurementHand: URIRef # Maximum hand girth (measured over the knuckles of the open right hand excluding thumb, fingers together). Used, for example, to fit gloves. + BodyMeasurementHead: ( + URIRef # Maximum girth of head above the ears. Used, for example, to fit hats. + ) + BodyMeasurementHeight: URIRef # Body height (measured between crown of head and soles of feet). Used, for example, to fit jackets. + BodyMeasurementHips: URIRef # Girth of hips (measured around the buttocks). Used, for example, to fit skirts. + BodyMeasurementInsideLeg: URIRef # Inside leg (measured between crotch and soles of feet). Used, for example, to fit pants. + BodyMeasurementNeck: URIRef # Girth of neck. Used, for example, to fit shirts. + BodyMeasurementTypeEnumeration: URIRef # Enumerates types (or dimensions) of a person's body measurements, for example for fitting of clothes. + BodyMeasurementUnderbust: URIRef # Girth of body just below the bust. Used, for example, to fit women's swimwear. + BodyMeasurementWaist: URIRef # Girth of natural waistline (between hip bones and lower ribs). Used, for example, to fit pants. + BodyMeasurementWeight: ( + URIRef # Body weight. Used, for example, to measure pantyhose. + ) + BodyOfWater: URIRef # A body of water, such as a sea, ocean, or lake. + Bone: URIRef # Rigid connective tissue that comprises up the skeletal structure of the human body. + Book: URIRef # A book. + BookFormatType: URIRef # The publication format of the book. + BookSeries: URIRef # A series of books. Included books can be indicated with the hasPart property. + BookStore: URIRef # A bookstore. + BookmarkAction: URIRef # An agent bookmarks/flags/labels/tags/marks an object. + Boolean: URIRef # Boolean: True or False. + BorrowAction: URIRef # The act of obtaining an object under an agreement to return it at a later date. Reciprocal of LendAction.\n\nRelated actions:\n\n* [[LendAction]]: Reciprocal of BorrowAction. + BowlingAlley: URIRef # A bowling alley. + BrainStructure: URIRef # Any anatomical structure which pertains to the soft nervous tissue functioning as the coordinating center of sensation and intellectual and nervous activity. + Brand: URIRef # A brand is a name used by an organization or business person for labeling a product, product group, or similar. + BreadcrumbList: URIRef # A BreadcrumbList is an ItemList consisting of a chain of linked Web pages, typically described using at least their URL and their name, and typically ending with the current page.\n\nThe [[position]] property is used to reconstruct the order of the items in a BreadcrumbList The convention is that a breadcrumb list has an [[itemListOrder]] of [[ItemListOrderAscending]] (lower values listed first), and that the first items in this list correspond to the "top" or beginning of the breadcrumb trail, e.g. with a site or section homepage. The specific values of 'position' are not assigned meaning for a BreadcrumbList, but they should be integers, e.g. beginning with '1' for the first item in the list. + Brewery: URIRef # Brewery. + Bridge: URIRef # A bridge. + BroadcastChannel: URIRef # A unique instance of a BroadcastService on a CableOrSatelliteService lineup. + BroadcastEvent: URIRef # An over the air or online broadcast event. + BroadcastFrequencySpecification: URIRef # The frequency in MHz and the modulation used for a particular BroadcastService. + BroadcastRelease: URIRef # BroadcastRelease. + BroadcastService: URIRef # A delivery service through which content is provided via broadcast over the air or online. + BrokerageAccount: URIRef # An account that allows an investor to deposit funds and place investment orders with a licensed broker or brokerage firm. + BuddhistTemple: URIRef # A Buddhist temple. + BusOrCoach: URIRef # A bus (also omnibus or autobus) is a road vehicle designed to carry passengers. Coaches are luxury busses, usually in service for long distance travel. + BusReservation: URIRef # A reservation for bus travel. \n\nNote: This type is for information about actual reservations, e.g. in confirmation emails or HTML pages with individual confirmations of reservations. For offers of tickets, use [[Offer]]. + BusStation: URIRef # A bus station. + BusStop: URIRef # A bus stop. + BusTrip: URIRef # A trip on a commercial bus line. + BusinessAudience: URIRef # A set of characteristics belonging to businesses, e.g. who compose an item's target audience. + BusinessEntityType: URIRef # A business entity type is a conceptual entity representing the legal form, the size, the main line of business, the position in the value chain, or any combination thereof, of an organization or business person.\n\nCommonly used values:\n\n* http://purl.org/goodrelations/v1#Business\n* http://purl.org/goodrelations/v1#Enduser\n* http://purl.org/goodrelations/v1#PublicInstitution\n* http://purl.org/goodrelations/v1#Reseller + BusinessEvent: URIRef # Event type: Business event. + BusinessFunction: URIRef # The business function specifies the type of activity or access (i.e., the bundle of rights) offered by the organization or business person through the offer. Typical are sell, rental or lease, maintenance or repair, manufacture / produce, recycle / dispose, engineering / construction, or installation. Proprietary specifications of access rights are also instances of this class.\n\nCommonly used values:\n\n* http://purl.org/goodrelations/v1#ConstructionInstallation\n* http://purl.org/goodrelations/v1#Dispose\n* http://purl.org/goodrelations/v1#LeaseOut\n* http://purl.org/goodrelations/v1#Maintain\n* http://purl.org/goodrelations/v1#ProvideService\n* http://purl.org/goodrelations/v1#Repair\n* http://purl.org/goodrelations/v1#Sell\n* http://purl.org/goodrelations/v1#Buy + BusinessSupport: ( + URIRef # BusinessSupport: this is a benefit for supporting businesses. + ) + BuyAction: URIRef # The act of giving money to a seller in exchange for goods or services rendered. An agent buys an object, product, or service from a seller for a price. Reciprocal of SellAction. + CDCPMDRecord: URIRef # A CDCPMDRecord is a data structure representing a record in a CDC tabular data format used for hospital data reporting. See [documentation](/docs/cdc-covid.html) for details, and the linked CDC materials for authoritative definitions used as the source here. + CDFormat: URIRef # CDFormat. + CT: URIRef # X-ray computed tomography imaging. + CableOrSatelliteService: URIRef # A service which provides access to media programming like TV or radio. Access may be via cable or satellite. + CafeOrCoffeeShop: URIRef # A cafe or coffee shop. + Campground: URIRef # A camping site, campsite, or [[Campground]] is a place used for overnight stay in the outdoors, typically containing individual [[CampingPitch]] locations. \n\n In British English a campsite is an area, usually divided into a number of pitches, where people can camp overnight using tents or camper vans or caravans; this British English use of the word is synonymous with the American English expression campground. In American English the term campsite generally means an area where an individual, family, group, or military unit can pitch a tent or park a camper; a campground may contain many campsites (Source: Wikipedia see [https://en.wikipedia.org/wiki/Campsite](https://en.wikipedia.org/wiki/Campsite)).\n\n See also the dedicated [document on the use of schema.org for marking up hotels and other forms of accommodations](/docs/hotels.html). + CampingPitch: URIRef # A [[CampingPitch]] is an individual place for overnight stay in the outdoors, typically being part of a larger camping site, or [[Campground]].\n\n In British English a campsite, or campground, is an area, usually divided into a number of pitches, where people can camp overnight using tents or camper vans or caravans; this British English use of the word is synonymous with the American English expression campground. In American English the term campsite generally means an area where an individual, family, group, or military unit can pitch a tent or park a camper; a campground may contain many campsites. (Source: Wikipedia see [https://en.wikipedia.org/wiki/Campsite](https://en.wikipedia.org/wiki/Campsite)).\n\n See also the dedicated [document on the use of schema.org for marking up hotels and other forms of accommodations](/docs/hotels.html). + Canal: URIRef # A canal, like the Panama Canal. + CancelAction: URIRef # The act of asserting that a future event/action is no longer going to happen.\n\nRelated actions:\n\n* [[ConfirmAction]]: The antonym of CancelAction. + Car: URIRef # A car is a wheeled, self-powered motor vehicle used for transportation. + CarUsageType: URIRef # A value indicating a special usage of a car, e.g. commercial rental, driving school, or as a taxi. + Cardiovascular: URIRef # A specific branch of medical science that pertains to diagnosis and treatment of disorders of heart and vasculature. + CardiovascularExam: ( + URIRef # Cardiovascular system assessment withclinical examination. + ) + CaseSeries: URIRef # A case series (also known as a clinical series) is a medical research study that tracks patients with a known exposure given similar treatment or examines their medical records for exposure and outcome. A case series can be retrospective or prospective and usually involves a smaller number of patients than the more powerful case-control studies or randomized controlled trials. Case series may be consecutive or non-consecutive, depending on whether all cases presenting to the reporting authors over a period of time were included, or only a selection. + Casino: URIRef # A casino. + CassetteFormat: URIRef # CassetteFormat. + CategoryCode: URIRef # A Category Code. + CategoryCodeSet: URIRef # A set of Category Code values. + CatholicChurch: URIRef # A Catholic church. + CausesHealthAspect: URIRef # Information about the causes and main actions that gave rise to the topic. + Cemetery: URIRef # A graveyard. + Chapter: URIRef # One of the sections into which a book is divided. A chapter usually has a section number or a name. + CharitableIncorporatedOrganization: URIRef # CharitableIncorporatedOrganization: Non-profit type referring to a Charitable Incorporated Organization (UK). + CheckAction: URIRef # An agent inspects, determines, investigates, inquires, or examines an object's accuracy, quality, condition, or state. + CheckInAction: URIRef # The act of an agent communicating (service provider, social media, etc) their arrival by registering/confirming for a previously reserved service (e.g. flight check in) or at a place (e.g. hotel), possibly resulting in a result (boarding pass, etc).\n\nRelated actions:\n\n* [[CheckOutAction]]: The antonym of CheckInAction.\n* [[ArriveAction]]: Unlike ArriveAction, CheckInAction implies that the agent is informing/confirming the start of a previously reserved service.\n* [[ConfirmAction]]: Unlike ConfirmAction, CheckInAction implies that the agent is informing/confirming the *start* of a previously reserved service rather than its validity/existence. + CheckOutAction: URIRef # The act of an agent communicating (service provider, social media, etc) their departure of a previously reserved service (e.g. flight check in) or place (e.g. hotel).\n\nRelated actions:\n\n* [[CheckInAction]]: The antonym of CheckOutAction.\n* [[DepartAction]]: Unlike DepartAction, CheckOutAction implies that the agent is informing/confirming the end of a previously reserved service.\n* [[CancelAction]]: Unlike CancelAction, CheckOutAction implies that the agent is informing/confirming the end of a previously reserved service. + CheckoutPage: URIRef # Web page type: Checkout page. + ChemicalSubstance: URIRef # A chemical substance is 'a portion of matter of constant composition, composed of molecular entities of the same type or of different types' (source: [ChEBI:59999](https://www.ebi.ac.uk/chebi/searchId.do?chebiId=59999)). + ChildCare: URIRef # A Childcare center. + ChildrensEvent: URIRef # Event type: Children's event. + Chiropractic: URIRef # A system of medicine focused on the relationship between the body's structure, mainly the spine, and its functioning. + ChooseAction: URIRef # The act of expressing a preference from a set of options or a large or unbounded set of choices/options. + Church: URIRef # A church. + City: URIRef # A city or town. + CityHall: URIRef # A city hall. + CivicStructure: URIRef # A public structure, such as a town hall or concert hall. + Claim: URIRef # A [[Claim]] in Schema.org represents a specific, factually-oriented claim that could be the [[itemReviewed]] in a [[ClaimReview]]. The content of a claim can be summarized with the [[text]] property. Variations on well known claims can have their common identity indicated via [[sameAs]] links, and summarized with a [[name]]. Ideally, a [[Claim]] description includes enough contextual information to minimize the risk of ambiguity or inclarity. In practice, many claims are better understood in the context in which they appear or the interpretations provided by claim reviews. Beyond [[ClaimReview]], the Claim type can be associated with related creative works - for example a [[ScholarlyArticle]] or [[Question]] might be [[about]] some [[Claim]]. At this time, Schema.org does not define any types of relationship between claims. This is a natural area for future exploration. + ClaimReview: URIRef # A fact-checking review of claims made (or reported) in some creative work (referenced via itemReviewed). + Class: URIRef # A class, also often called a 'Type'; equivalent to rdfs:Class. + CleaningFee: URIRef # Represents the cleaning fee part of the total price for an offered product, for example a vacation rental. + Clinician: URIRef # Medical clinicians, including practicing physicians and other medical professionals involved in clinical practice. + Clip: URIRef # A short TV or radio program or a segment/part of a program. + ClothingStore: URIRef # A clothing store. + CoOp: URIRef # Play mode: CoOp. Co-operative games, where you play on the same team with friends. + Code: URIRef # Computer programming source code. Example: Full (compile ready) solutions, code snippet samples, scripts, templates. + CohortStudy: URIRef # Also known as a panel study. A cohort study is a form of longitudinal study used in medicine and social science. It is one type of study design and should be compared with a cross-sectional study. A cohort is a group of people who share a common characteristic or experience within a defined period (e.g., are born, leave school, lose their job, are exposed to a drug or a vaccine, etc.). The comparison group may be the general population from which the cohort is drawn, or it may be another cohort of persons thought to have had little or no exposure to the substance under investigation, but otherwise similar. Alternatively, subgroups within the cohort may be compared with each other. + Collection: URIRef # A collection of items e.g. creative works or products. + CollectionPage: URIRef # Web page type: Collection page. + CollegeOrUniversity: ( + URIRef # A college, university, or other third-level educational institution. + ) + ComedyClub: URIRef # A comedy club. + ComedyEvent: URIRef # Event type: Comedy event. + ComicCoverArt: URIRef # The artwork on the cover of a comic. + ComicIssue: URIRef # Individual comic issues are serially published as part of a larger series. For the sake of consistency, even one-shot issues belong to a series comprised of a single issue. All comic issues can be uniquely identified by: the combination of the name and volume number of the series to which the issue belongs; the issue number; and the variant description of the issue (if any). + ComicSeries: URIRef # A sequential publication of comic stories under a unifying title, for example "The Amazing Spider-Man" or "Groo the Wanderer". + ComicStory: URIRef # The term "story" is any indivisible, re-printable unit of a comic, including the interior stories, covers, and backmatter. Most comics have at least two stories: a cover (ComicCoverArt) and an interior story. + Comment: URIRef # A comment on an item - for example, a comment on a blog post. The comment's content is expressed via the [[text]] property, and its topic via [[about]], properties shared with all CreativeWorks. + CommentAction: URIRef # The act of generating a comment about a subject. + CommentPermission: URIRef # Permission to add comments to the document. + CommunicateAction: URIRef # The act of conveying information to another person via a communication medium (instrument) such as speech, email, or telephone conversation. + CommunityHealth: URIRef # A field of public health focusing on improving health characteristics of a defined population in relation with their geographical or environment areas. + CompilationAlbum: URIRef # CompilationAlbum. + CompleteDataFeed: URIRef # A [[CompleteDataFeed]] is a [[DataFeed]] whose standard representation includes content for every item currently in the feed. This is the equivalent of Atom's element as defined in Feed Paging and Archiving [RFC 5005](https://tools.ietf.org/html/rfc5005), For example (and as defined for Atom), when using data from a feed that represents a collection of items that varies over time (e.g. "Top Twenty Records") there is no need to have newer entries mixed in alongside older, obsolete entries. By marking this feed as a CompleteDataFeed, old entries can be safely discarded when the feed is refreshed, since we can assume the feed has provided descriptions for all current items. + Completed: URIRef # Completed. + CompletedActionStatus: URIRef # An action that has already taken place. + CompoundPriceSpecification: URIRef # A compound price specification is one that bundles multiple prices that all apply in combination for different dimensions of consumption. Use the name property of the attached unit price specification for indicating the dimension of a price component (e.g. "electricity" or "final cleaning"). + ComputerLanguage: URIRef # This type covers computer programming languages such as Scheme and Lisp, as well as other language-like computer representations. Natural languages are best represented with the [[Language]] type. + ComputerStore: URIRef # A computer store. + ConfirmAction: URIRef # The act of notifying someone that a future event/action is going to happen as expected.\n\nRelated actions:\n\n* [[CancelAction]]: The antonym of ConfirmAction. + Consortium: URIRef # A Consortium is a membership [[Organization]] whose members are typically Organizations. + ConsumeAction: URIRef # The act of ingesting information/resources/food. + ContactPage: URIRef # Web page type: Contact page. + ContactPoint: ( + URIRef # A contact point—for example, a Customer Complaints department. + ) + ContactPointOption: URIRef # Enumerated options related to a ContactPoint. + ContagiousnessHealthAspect: URIRef # Content about contagion mechanisms and contagiousness information over the topic. + Continent: URIRef # One of the continents (for example, Europe or Africa). + ControlAction: URIRef # An agent controls a device or application. + ConvenienceStore: URIRef # A convenience store. + Conversation: URIRef # One or more messages between organizations or people on a particular topic. Individual messages can be linked to the conversation with isPartOf or hasPart properties. + CookAction: URIRef # The act of producing/preparing food. + Corporation: URIRef # Organization: A business corporation. + CorrectionComment: URIRef # A [[comment]] that corrects [[CreativeWork]]. + Country: URIRef # A country. + Course: URIRef # A description of an educational course which may be offered as distinct instances at which take place at different times or take place at different locations, or be offered through different media or modes of study. An educational course is a sequence of one or more educational events and/or creative works which aims to build knowledge, competence or ability of learners. + CourseInstance: URIRef # An instance of a [[Course]] which is distinct from other instances because it is offered at a different time or location or through different media or modes of study or to a specific section of students. + Courthouse: URIRef # A courthouse. + CoverArt: URIRef # The artwork on the outer surface of a CreativeWork. + CovidTestingFacility: URIRef # A CovidTestingFacility is a [[MedicalClinic]] where testing for the COVID-19 Coronavirus disease is available. If the facility is being made available from an established [[Pharmacy]], [[Hotel]], or other non-medical organization, multiple types can be listed. This makes it easier to re-use existing schema.org information about that place e.g. contact info, address, opening hours. Note that in an emergency, such information may not always be reliable. + CreateAction: URIRef # The act of deliberately creating/producing/generating/building a result out of the agent. + CreativeWork: URIRef # The most generic kind of creative work, including books, movies, photographs, software programs, etc. + CreativeWorkSeason: URIRef # A media season e.g. tv, radio, video game etc. + CreativeWorkSeries: URIRef # A CreativeWorkSeries in schema.org is a group of related items, typically but not necessarily of the same kind. CreativeWorkSeries are usually organized into some order, often chronological. Unlike [[ItemList]] which is a general purpose data structure for lists of things, the emphasis with CreativeWorkSeries is on published materials (written e.g. books and periodicals, or media such as tv, radio and games).\n\nSpecific subtypes are available for describing [[TVSeries]], [[RadioSeries]], [[MovieSeries]], [[BookSeries]], [[Periodical]] and [[VideoGameSeries]]. In each case, the [[hasPart]] / [[isPartOf]] properties can be used to relate the CreativeWorkSeries to its parts. The general CreativeWorkSeries type serves largely just to organize these more specific and practical subtypes.\n\nIt is common for properties applicable to an item from the series to be usefully applied to the containing group. Schema.org attempts to anticipate some of these cases, but publishers should be free to apply properties of the series parts to the series as a whole wherever they seem appropriate. + CreditCard: URIRef # A card payment method of a particular brand or name. Used to mark up a particular payment method and/or the financial product/service that supplies the card account.\n\nCommonly used values:\n\n* http://purl.org/goodrelations/v1#AmericanExpress\n* http://purl.org/goodrelations/v1#DinersClub\n* http://purl.org/goodrelations/v1#Discover\n* http://purl.org/goodrelations/v1#JCB\n* http://purl.org/goodrelations/v1#MasterCard\n* http://purl.org/goodrelations/v1#VISA + Crematorium: URIRef # A crematorium. + CriticReview: URIRef # A [[CriticReview]] is a more specialized form of Review written or published by a source that is recognized for its reviewing activities. These can include online columns, travel and food guides, TV and radio shows, blogs and other independent Web sites. [[CriticReview]]s are typically more in-depth and professionally written. For simpler, casually written user/visitor/viewer/customer reviews, it is more appropriate to use the [[UserReview]] type. Review aggregator sites such as Metacritic already separate out the site's user reviews from selected critic reviews that originate from third-party sources. + CrossSectional: URIRef # Studies carried out on pre-existing data (usually from 'snapshot' surveys), such as that collected by the Census Bureau. Sometimes called Prevalence Studies. + CssSelectorType: URIRef # Text representing a CSS selector. + CurrencyConversionService: ( + URIRef # A service to convert funds from one currency to another currency. + ) + DDxElement: URIRef # An alternative, closely-related condition typically considered later in the differential diagnosis process along with the signs that are used to distinguish it. + DJMixAlbum: URIRef # DJMixAlbum. + DVDFormat: URIRef # DVDFormat. + DamagedCondition: URIRef # Indicates that the item is damaged. + DanceEvent: URIRef # Event type: A social dance. + DanceGroup: URIRef # A dance group—for example, the Alvin Ailey Dance Theater or Riverdance. + DataCatalog: URIRef # A collection of datasets. + DataDownload: URIRef # A dataset in downloadable form. + DataFeed: URIRef # A single feed providing structured information about one or more entities or topics. + DataFeedItem: URIRef # A single item within a larger data feed. + DataType: URIRef # The basic data types such as Integers, Strings, etc. + Dataset: ( + URIRef # A body of structured information describing some topic(s) of interest. + ) + Date: URIRef # A date value in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601). + DateTime: URIRef # A combination of date and time of day in the form [-]CCYY-MM-DDThh:mm:ss[Z|(+|-)hh:mm] (see Chapter 5.4 of ISO 8601). + DatedMoneySpecification: URIRef # A DatedMoneySpecification represents monetary values with optional start and end dates. For example, this could represent an employee's salary over a specific period of time. __Note:__ This type has been superseded by [[MonetaryAmount]] use of that type is recommended + DayOfWeek: URIRef # The day of the week, e.g. used to specify to which day the opening hours of an OpeningHoursSpecification refer. Originally, URLs from [GoodRelations](http://purl.org/goodrelations/v1) were used (for [[Monday]], [[Tuesday]], [[Wednesday]], [[Thursday]], [[Friday]], [[Saturday]], [[Sunday]] plus a special entry for [[PublicHolidays]]); these have now been integrated directly into schema.org. + DaySpa: URIRef # A day spa. + DeactivateAction: URIRef # The act of stopping or deactivating a device or application (e.g. stopping a timer or turning off a flashlight). + DecontextualizedContent: URIRef # Content coded 'missing context' in a [[MediaReview]], considered in the context of how it was published or shared. For a [[VideoObject]] to be 'missing context': Presenting unaltered video in an inaccurate manner that misrepresents the footage. For example, using incorrect dates or locations, altering the transcript or sharing brief clips from a longer video to mislead viewers. (A video rated 'original' can also be missing context.) For an [[ImageObject]] to be 'missing context': Presenting unaltered images in an inaccurate manner to misrepresent the image and mislead the viewer. For example, a common tactic is using an unaltered image but saying it came from a different time or place. (An image rated 'original' can also be missing context.) For an [[ImageObject]] with embedded text to be 'missing context': An unaltered image presented in an inaccurate manner to misrepresent the image and mislead the viewer. For example, a common tactic is using an unaltered image but saying it came from a different time or place. (An 'original' image with inaccurate text would generally fall in this category.) For an [[AudioObject]] to be 'missing context': Unaltered audio presented in an inaccurate manner that misrepresents it. For example, using incorrect dates or locations, or sharing brief clips from a longer recording to mislead viewers. (Audio rated “original” can also be missing context.) + DefenceEstablishment: ( + URIRef # A defence establishment, such as an army or navy base. + ) + DefinedRegion: URIRef # A DefinedRegion is a geographic area defined by potentially arbitrary (rather than political, administrative or natural geographical) criteria. Properties are provided for defining a region by reference to sets of postal codes. Examples: a delivery destination when shopping. Region where regional pricing is configured. Requirement 1: Country: US States: "NY", "CA" Requirement 2: Country: US PostalCode Set: { [94000-94585], [97000, 97999], [13000, 13599]} { [12345, 12345], [78945, 78945], } Region = state, canton, prefecture, autonomous community... + DefinedTerm: URIRef # A word, name, acronym, phrase, etc. with a formal definition. Often used in the context of category or subject classification, glossaries or dictionaries, product or creative work types, etc. Use the name property for the term being defined, use termCode if the term has an alpha-numeric code allocated, use description to provide the definition of the term. + DefinedTermSet: URIRef # A set of defined terms for example a set of categories or a classification scheme, a glossary, dictionary or enumeration. + DefinitiveLegalValue: URIRef # Indicates a document for which the text is conclusively what the law says and is legally binding. (e.g. The digitally signed version of an Official Journal.) Something "Definitive" is considered to be also [[AuthoritativeLegalValue]]. + DeleteAction: ( + URIRef # The act of editing a recipient by removing one of its objects. + ) + DeliveryChargeSpecification: URIRef # The price for the delivery of an offer using a particular delivery method. + DeliveryEvent: URIRef # An event involving the delivery of an item. + DeliveryMethod: URIRef # A delivery method is a standardized procedure for transferring the product or service to the destination of fulfillment chosen by the customer. Delivery methods are characterized by the means of transportation used, and by the organization or group that is the contracting party for the sending organization or person.\n\nCommonly used values:\n\n* http://purl.org/goodrelations/v1#DeliveryModeDirectDownload\n* http://purl.org/goodrelations/v1#DeliveryModeFreight\n* http://purl.org/goodrelations/v1#DeliveryModeMail\n* http://purl.org/goodrelations/v1#DeliveryModeOwnFleet\n* http://purl.org/goodrelations/v1#DeliveryModePickUp\n* http://purl.org/goodrelations/v1#DHL\n* http://purl.org/goodrelations/v1#FederalExpress\n* http://purl.org/goodrelations/v1#UPS + DeliveryTimeSettings: URIRef # A DeliveryTimeSettings represents re-usable pieces of shipping information, relating to timing. It is designed for publication on an URL that may be referenced via the [[shippingSettingsLink]] property of a [[OfferShippingDetails]]. Several occurrences can be published, distinguished (and identified/referenced) by their different values for [[transitTimeLabel]]. + Demand: URIRef # A demand entity represents the public, not necessarily binding, not necessarily exclusive, announcement by an organization or person to seek a certain type of goods or services. For describing demand using this type, the very same properties used for Offer apply. + DemoAlbum: URIRef # DemoAlbum. + Dentist: URIRef # A dentist. + Dentistry: URIRef # A branch of medicine that is involved in the dental care. + DepartAction: URIRef # The act of departing from a place. An agent departs from an fromLocation for a destination, optionally with participants. + DepartmentStore: URIRef # A department store. + DepositAccount: URIRef # A type of Bank Account with a main purpose of depositing funds to gain interest or other benefits. + Dermatologic: URIRef # Something relating to or practicing dermatology. + Dermatology: URIRef # A specific branch of medical science that pertains to diagnosis and treatment of disorders of skin. + DiabeticDiet: URIRef # A diet appropriate for people with diabetes. + Diagnostic: URIRef # A medical device used for diagnostic purposes. + DiagnosticLab: URIRef # A medical laboratory that offers on-site or off-site diagnostic services. + DiagnosticProcedure: URIRef # A medical procedure intended primarily for diagnostic, as opposed to therapeutic, purposes. + Diet: URIRef # A strategy of regulating the intake of food to achieve or maintain a specific health-related goal. + DietNutrition: URIRef # Dietetic and nutrition as a medical specialty. + DietarySupplement: URIRef # A product taken by mouth that contains a dietary ingredient intended to supplement the diet. Dietary ingredients may include vitamins, minerals, herbs or other botanicals, amino acids, and substances such as enzymes, organ tissues, glandulars and metabolites. + DigitalAudioTapeFormat: URIRef # DigitalAudioTapeFormat. + DigitalDocument: URIRef # An electronic file or document. + DigitalDocumentPermission: URIRef # A permission for a particular person or group to access a particular file. + DigitalDocumentPermissionType: URIRef # A type of permission which can be granted for accessing a digital document. + DigitalFormat: URIRef # DigitalFormat. + DisabilitySupport: ( + URIRef # DisabilitySupport: this is a benefit for disability support. + ) + DisagreeAction: URIRef # The act of expressing a difference of opinion with the object. An agent disagrees to/about an object (a proposition, topic or theme) with participants. + Discontinued: URIRef # Indicates that the item has been discontinued. + DiscoverAction: URIRef # The act of discovering/finding an object. + DiscussionForumPosting: URIRef # A posting to a discussion forum. + DislikeAction: URIRef # The act of expressing a negative sentiment about the object. An agent dislikes an object (a proposition, topic or theme) with participants. + Distance: URIRef # Properties that take Distances as values are of the form '<Number> <Length unit of measure>'. E.g., '7 ft'. + DistanceFee: URIRef # Represents the distance fee (e.g., price per km or mile) part of the total price for an offered product, for example a car rental. + Distillery: URIRef # A distillery. + DonateAction: URIRef # The act of providing goods, services, or money without compensation, often for philanthropic reasons. + DoseSchedule: URIRef # A specific dosing schedule for a drug or supplement. + DoubleBlindedTrial: URIRef # A trial design in which neither the researcher nor the patient knows the details of the treatment the patient was randomly assigned to. + DownloadAction: URIRef # The act of downloading an object. + Downpayment: URIRef # Represents the downpayment (up-front payment) price component of the total price for an offered product that has additional installment payments. + DrawAction: URIRef # The act of producing a visual/graphical representation of an object, typically with a pen/pencil and paper as instruments. + Drawing: URIRef # A picture or diagram made with a pencil, pen, or crayon rather than paint. + DrinkAction: URIRef # The act of swallowing liquids. + DriveWheelConfigurationValue: ( + URIRef # A value indicating which roadwheels will receive torque. + ) + DrivingSchoolVehicleUsage: ( + URIRef # Indicates the usage of the vehicle for driving school. + ) + Drug: URIRef # A chemical or biologic substance, used as a medical therapy, that has a physiological effect on an organism. Here the term drug is used interchangeably with the term medicine although clinical knowledge make a clear difference between them. + DrugClass: URIRef # A class of medical drugs, e.g., statins. Classes can represent general pharmacological class, common mechanisms of action, common physiological effects, etc. + DrugCost: URIRef # The cost per unit of a medical drug. Note that this type is not meant to represent the price in an offer of a drug for sale; see the Offer type for that. This type will typically be used to tag wholesale or average retail cost of a drug, or maximum reimbursable cost. Costs of medical drugs vary widely depending on how and where they are paid for, so while this type captures some of the variables, costs should be used with caution by consumers of this schema's markup. + DrugCostCategory: URIRef # Enumerated categories of medical drug costs. + DrugLegalStatus: URIRef # The legal availability status of a medical drug. + DrugPregnancyCategory: URIRef # Categories that represent an assessment of the risk of fetal injury due to a drug or pharmaceutical used as directed by the mother during pregnancy. + DrugPrescriptionStatus: URIRef # Indicates whether this drug is available by prescription or over-the-counter. + DrugStrength: URIRef # A specific strength in which a medical drug is available in a specific country. + DryCleaningOrLaundry: URIRef # A dry-cleaning business. + Duration: URIRef # Quantity: Duration (use [ISO 8601 duration format](http://en.wikipedia.org/wiki/ISO_8601)). + EBook: URIRef # Book format: Ebook. + EPRelease: URIRef # EPRelease. + EUEnergyEfficiencyCategoryA: URIRef # Represents EU Energy Efficiency Class A as defined in EU energy labeling regulations. + EUEnergyEfficiencyCategoryA1Plus: URIRef # Represents EU Energy Efficiency Class A+ as defined in EU energy labeling regulations. + EUEnergyEfficiencyCategoryA2Plus: URIRef # Represents EU Energy Efficiency Class A++ as defined in EU energy labeling regulations. + EUEnergyEfficiencyCategoryA3Plus: URIRef # Represents EU Energy Efficiency Class A+++ as defined in EU energy labeling regulations. + EUEnergyEfficiencyCategoryB: URIRef # Represents EU Energy Efficiency Class B as defined in EU energy labeling regulations. + EUEnergyEfficiencyCategoryC: URIRef # Represents EU Energy Efficiency Class C as defined in EU energy labeling regulations. + EUEnergyEfficiencyCategoryD: URIRef # Represents EU Energy Efficiency Class D as defined in EU energy labeling regulations. + EUEnergyEfficiencyCategoryE: URIRef # Represents EU Energy Efficiency Class E as defined in EU energy labeling regulations. + EUEnergyEfficiencyCategoryF: URIRef # Represents EU Energy Efficiency Class F as defined in EU energy labeling regulations. + EUEnergyEfficiencyCategoryG: URIRef # Represents EU Energy Efficiency Class G as defined in EU energy labeling regulations. + EUEnergyEfficiencyEnumeration: URIRef # Enumerates the EU energy efficiency classes A-G as well as A+, A++, and A+++ as defined in EU directive 2017/1369. + Ear: URIRef # Ear function assessment with clinical examination. + EatAction: URIRef # The act of swallowing solid objects. + EditedOrCroppedContent: URIRef # Content coded 'edited or cropped content' in a [[MediaReview]], considered in the context of how it was published or shared. For a [[VideoObject]] to be 'edited or cropped content': The video has been edited or rearranged. This category applies to time edits, including editing multiple videos together to alter the story being told or editing out large portions from a video. For an [[ImageObject]] to be 'edited or cropped content': Presenting a part of an image from a larger whole to mislead the viewer. For an [[ImageObject]] with embedded text to be 'edited or cropped content': Presenting a part of an image from a larger whole to mislead the viewer. For an [[AudioObject]] to be 'edited or cropped content': The audio has been edited or rearranged. This category applies to time edits, including editing multiple audio clips together to alter the story being told or editing out large portions from the recording. + EducationEvent: URIRef # Event type: Education event. + EducationalAudience: URIRef # An EducationalAudience. + EducationalOccupationalCredential: URIRef # An educational or occupational credential. A diploma, academic degree, certification, qualification, badge, etc., that may be awarded to a person or other entity that meets the requirements defined by the credentialer. + EducationalOccupationalProgram: URIRef # A program offered by an institution which determines the learning progress to achieve an outcome, usually a credential like a degree or certificate. This would define a discrete set of opportunities (e.g., job, courses) that together constitute a program with a clear start, end, set of requirements, and transition to a new occupational opportunity (e.g., a job), or sometimes a higher educational opportunity (e.g., an advanced degree). + EducationalOrganization: URIRef # An educational organization. + EffectivenessHealthAspect: ( + URIRef # Content about the effectiveness-related aspects of a health topic. + ) + Electrician: URIRef # An electrician. + ElectronicsStore: URIRef # An electronics store. + ElementarySchool: URIRef # An elementary school. + EmailMessage: URIRef # An email message. + Embassy: URIRef # An embassy. + Emergency: URIRef # A specific branch of medical science that deals with the evaluation and initial treatment of medical conditions caused by trauma or sudden illness. + EmergencyService: URIRef # An emergency service, such as a fire station or ER. + EmployeeRole: URIRef # A subclass of OrganizationRole used to describe employee relationships. + EmployerAggregateRating: URIRef # An aggregate rating of an Organization related to its role as an employer. + EmployerReview: URIRef # An [[EmployerReview]] is a review of an [[Organization]] regarding its role as an employer, written by a current or former employee of that organization. + EmploymentAgency: URIRef # An employment agency. + Endocrine: URIRef # A specific branch of medical science that pertains to diagnosis and treatment of disorders of endocrine glands and their secretions. + EndorseAction: ( + URIRef # An agent approves/certifies/likes/supports/sanction an object. + ) + EndorsementRating: URIRef # An EndorsementRating is a rating that expresses some level of endorsement, for example inclusion in a "critic's pick" blog, a "Like" or "+1" on a social network. It can be considered the [[result]] of an [[EndorseAction]] in which the [[object]] of the action is rated positively by some [[agent]]. As is common elsewhere in schema.org, it is sometimes more useful to describe the results of such an action without explicitly describing the [[Action]]. An [[EndorsementRating]] may be part of a numeric scale or organized system, but this is not required: having an explicit type for indicating a positive, endorsement rating is particularly useful in the absence of numeric scales as it helps consumers understand that the rating is broadly positive. + Energy: URIRef # Properties that take Energy as values are of the form '<Number> <Energy unit of measure>'. + EnergyConsumptionDetails: URIRef # EnergyConsumptionDetails represents information related to the energy efficiency of a product that consumes energy. The information that can be provided is based on international regulations such as for example [EU directive 2017/1369](https://eur-lex.europa.eu/eli/reg/2017/1369/oj) for energy labeling and the [Energy labeling rule](https://www.ftc.gov/enforcement/rules/rulemaking-regulatory-reform-proceedings/energy-water-use-labeling-consumer) under the Energy Policy and Conservation Act (EPCA) in the US. + EnergyEfficiencyEnumeration: URIRef # Enumerates energy efficiency levels (also known as "classes" or "ratings") and certifications that are part of several international energy efficiency standards. + EnergyStarCertified: URIRef # Represents EnergyStar certification. + EnergyStarEnergyEfficiencyEnumeration: ( + URIRef # Used to indicate whether a product is EnergyStar certified. + ) + EngineSpecification: URIRef # Information about the engine of the vehicle. A vehicle can have multiple engines represented by multiple engine specification entities. + EnrollingByInvitation: URIRef # Enrolling participants by invitation only. + EntertainmentBusiness: URIRef # A business providing entertainment. + EntryPoint: URIRef # An entry point, within some Web-based protocol. + Enumeration: URIRef # Lists or enumerations—for example, a list of cuisines or music genres, etc. + Episode: URIRef # A media episode (e.g. TV, radio, video game) which can be part of a series or season. + Event: URIRef # An event happening at a certain time and location, such as a concert, lecture, or festival. Ticketing information may be added via the [[offers]] property. Repeated events may be structured as separate Event objects. + EventAttendanceModeEnumeration: URIRef # An EventAttendanceModeEnumeration value is one of potentially several modes of organising an event, relating to whether it is online or offline. + EventCancelled: URIRef # The event has been cancelled. If the event has multiple startDate values, all are assumed to be cancelled. Either startDate or previousStartDate may be used to specify the event's cancelled date(s). + EventMovedOnline: URIRef # Indicates that the event was changed to allow online participation. See [[eventAttendanceMode]] for specifics of whether it is now fully or partially online. + EventPostponed: URIRef # The event has been postponed and no new date has been set. The event's previousStartDate should be set. + EventRescheduled: URIRef # The event has been rescheduled. The event's previousStartDate should be set to the old date and the startDate should be set to the event's new date. (If the event has been rescheduled multiple times, the previousStartDate property may be repeated). + EventReservation: URIRef # A reservation for an event like a concert, sporting event, or lecture.\n\nNote: This type is for information about actual reservations, e.g. in confirmation emails or HTML pages with individual confirmations of reservations. For offers of tickets, use [[Offer]]. + EventScheduled: URIRef # The event is taking place or has taken place on the startDate as scheduled. Use of this value is optional, as it is assumed by default. + EventSeries: URIRef # A series of [[Event]]s. Included events can relate with the series using the [[superEvent]] property. An EventSeries is a collection of events that share some unifying characteristic. For example, "The Olympic Games" is a series, which is repeated regularly. The "2012 London Olympics" can be presented both as an [[Event]] in the series "Olympic Games", and as an [[EventSeries]] that included a number of sporting competitions as Events. The nature of the association between the events in an [[EventSeries]] can vary, but typical examples could include a thematic event series (e.g. topical meetups or classes), or a series of regular events that share a location, attendee group and/or organizers. EventSeries has been defined as a kind of Event to make it easy for publishers to use it in an Event context without worrying about which kinds of series are really event-like enough to call an Event. In general an EventSeries may seem more Event-like when the period of time is compact and when aspects such as location are fixed, but it may also sometimes prove useful to describe a longer-term series as an Event. + EventStatusType: URIRef # EventStatusType is an enumeration type whose instances represent several states that an Event may be in. + EventVenue: URIRef # An event venue. + EvidenceLevelA: URIRef # Data derived from multiple randomized clinical trials or meta-analyses. + EvidenceLevelB: ( + URIRef # Data derived from a single randomized trial, or nonrandomized studies. + ) + EvidenceLevelC: ( + URIRef # Only consensus opinion of experts, case studies, or standard-of-care. + ) + ExchangeRateSpecification: URIRef # A structured value representing exchange rate. + ExchangeRefund: URIRef # Specifies that a refund can be done as an exchange for the same product. + ExerciseAction: URIRef # The act of participating in exertive activity for the purposes of improving health and fitness. + ExerciseGym: URIRef # A gym. + ExercisePlan: URIRef # Fitness-related activity designed for a specific health-related purpose, including defined exercise routines as well as activity prescribed by a clinician. + ExhibitionEvent: URIRef # Event type: Exhibition event, e.g. at a museum, library, archive, tradeshow, ... + Eye: URIRef # Eye or ophtalmological function assessment with clinical examination. + FAQPage: URIRef # A [[FAQPage]] is a [[WebPage]] presenting one or more "[Frequently asked questions](https://en.wikipedia.org/wiki/FAQ)" (see also [[QAPage]]). + FDAcategoryA: URIRef # A designation by the US FDA signifying that adequate and well-controlled studies have failed to demonstrate a risk to the fetus in the first trimester of pregnancy (and there is no evidence of risk in later trimesters). + FDAcategoryB: URIRef # A designation by the US FDA signifying that animal reproduction studies have failed to demonstrate a risk to the fetus and there are no adequate and well-controlled studies in pregnant women. + FDAcategoryC: URIRef # A designation by the US FDA signifying that animal reproduction studies have shown an adverse effect on the fetus and there are no adequate and well-controlled studies in humans, but potential benefits may warrant use of the drug in pregnant women despite potential risks. + FDAcategoryD: URIRef # A designation by the US FDA signifying that there is positive evidence of human fetal risk based on adverse reaction data from investigational or marketing experience or studies in humans, but potential benefits may warrant use of the drug in pregnant women despite potential risks. + FDAcategoryX: URIRef # A designation by the US FDA signifying that studies in animals or humans have demonstrated fetal abnormalities and/or there is positive evidence of human fetal risk based on adverse reaction data from investigational or marketing experience, and the risks involved in use of the drug in pregnant women clearly outweigh potential benefits. + FDAnotEvaluated: URIRef # A designation that the drug in question has not been assigned a pregnancy category designation by the US FDA. + FMRadioChannel: URIRef # A radio channel that uses FM. + FailedActionStatus: URIRef # An action that failed to complete. The action's error property and the HTTP return code contain more information about the failure. + # False: URIRef # The boolean value false. + FastFoodRestaurant: URIRef # A fast-food restaurant. + Female: URIRef # The female gender. + Festival: URIRef # Event type: Festival. + FilmAction: URIRef # The act of capturing sound and moving images on film, video, or digitally. + FinancialProduct: URIRef # A product provided to consumers and businesses by financial institutions such as banks, insurance companies, brokerage firms, consumer finance companies, and investment companies which comprise the financial services industry. + FinancialService: URIRef # Financial services business. + FindAction: URIRef # The act of finding an object.\n\nRelated actions:\n\n* [[SearchAction]]: FindAction is generally lead by a SearchAction, but not necessarily. + FireStation: URIRef # A fire station. With firemen. + Flexibility: URIRef # Physical activity that is engaged in to improve joint and muscle flexibility. + Flight: URIRef # An airline flight. + FlightReservation: URIRef # A reservation for air travel.\n\nNote: This type is for information about actual reservations, e.g. in confirmation emails or HTML pages with individual confirmations of reservations. For offers of tickets, use [[Offer]]. + Float: URIRef # Data type: Floating number. + FloorPlan: URIRef # A FloorPlan is an explicit representation of a collection of similar accommodations, allowing the provision of common information (room counts, sizes, layout diagrams) and offers for rental or sale. In typical use, some [[ApartmentComplex]] has an [[accommodationFloorPlan]] which is a [[FloorPlan]]. A FloorPlan is always in the context of a particular place, either a larger [[ApartmentComplex]] or a single [[Apartment]]. The visual/spatial aspects of a floor plan (i.e. room layout, [see wikipedia](https://en.wikipedia.org/wiki/Floor_plan)) can be indicated using [[image]]. + Florist: URIRef # A florist. + FollowAction: URIRef # The act of forming a personal connection with someone/something (object) unidirectionally/asymmetrically to get updates polled from.\n\nRelated actions:\n\n* [[BefriendAction]]: Unlike BefriendAction, FollowAction implies that the connection is *not* necessarily reciprocal.\n* [[SubscribeAction]]: Unlike SubscribeAction, FollowAction implies that the follower acts as an active agent constantly/actively polling for updates.\n* [[RegisterAction]]: Unlike RegisterAction, FollowAction implies that the agent is interested in continuing receiving updates from the object.\n* [[JoinAction]]: Unlike JoinAction, FollowAction implies that the agent is interested in getting updates from the object.\n* [[TrackAction]]: Unlike TrackAction, FollowAction refers to the polling of updates of all aspects of animate objects rather than the location of inanimate objects (e.g. you track a package, but you don't follow it). + FoodEstablishment: URIRef # A food-related business. + FoodEstablishmentReservation: URIRef # A reservation to dine at a food-related business.\n\nNote: This type is for information about actual reservations, e.g. in confirmation emails or HTML pages with individual confirmations of reservations. + FoodEvent: URIRef # Event type: Food event. + FoodService: URIRef # A food service, like breakfast, lunch, or dinner. + FourWheelDriveConfiguration: URIRef # Four-wheel drive is a transmission layout where the engine primarily drives two wheels with a part-time four-wheel drive capability. + FreeReturn: ( + URIRef # Specifies that product returns are free of charge for the customer. + ) + Friday: URIRef # The day of the week between Thursday and Saturday. + FrontWheelDriveConfiguration: URIRef # Front-wheel drive is a transmission layout where the engine drives the front wheels. + FullRefund: URIRef # Specifies that a refund can be done in the full amount the customer paid for the product + FundingAgency: URIRef # A FundingAgency is an organization that implements one or more [[FundingScheme]]s and manages the granting process (via [[Grant]]s, typically [[MonetaryGrant]]s). A funding agency is not always required for grant funding, e.g. philanthropic giving, corporate sponsorship etc. Examples of funding agencies include ERC, REA, NIH, Bill and Melinda Gates Foundation... + FundingScheme: URIRef # A FundingScheme combines organizational, project and policy aspects of grant-based funding that sets guidelines, principles and mechanisms to support other kinds of projects and activities. Funding is typically organized via [[Grant]] funding. Examples of funding schemes: Swiss Priority Programmes (SPPs); EU Framework 7 (FP7); Horizon 2020; the NIH-R01 Grant Program; Wellcome institutional strategic support fund. For large scale public sector funding, the management and administration of grant awards is often handled by other, dedicated, organizations - [[FundingAgency]]s such as ERC, REA, ... + Fungus: URIRef # Pathogenic fungus. + FurnitureStore: URIRef # A furniture store. + Game: URIRef # The Game type represents things which are games. These are typically rule-governed recreational activities, e.g. role-playing games in which players assume the role of characters in a fictional setting. + GamePlayMode: ( + URIRef # Indicates whether this game is multi-player, co-op or single-player. + ) + GameServer: URIRef # Server that provides game interaction in a multiplayer game. + GameServerStatus: URIRef # Status of a game server. + GardenStore: URIRef # A garden store. + GasStation: URIRef # A gas station. + Gastroenterologic: URIRef # A specific branch of medical science that pertains to diagnosis and treatment of disorders of digestive system. + GatedResidenceCommunity: URIRef # Residence type: Gated community. + GenderType: URIRef # An enumeration of genders. + Gene: URIRef # A discrete unit of inheritance which affects one or more biological traits (Source: [https://en.wikipedia.org/wiki/Gene](https://en.wikipedia.org/wiki/Gene)). Examples include FOXP2 (Forkhead box protein P2), SCARNA21 (small Cajal body-specific RNA 21), A- (agouti genotype). + GeneralContractor: URIRef # A general contractor. + Genetic: URIRef # A specific branch of medical science that pertains to hereditary transmission and the variation of inherited characteristics and disorders. + Genitourinary: ( + URIRef # Genitourinary system function assessment with clinical examination. + ) + GeoCircle: URIRef # A GeoCircle is a GeoShape representing a circular geographic area. As it is a GeoShape it provides the simple textual property 'circle', but also allows the combination of postalCode alongside geoRadius. The center of the circle can be indicated via the 'geoMidpoint' property, or more approximately using 'address', 'postalCode'. + GeoCoordinates: URIRef # The geographic coordinates of a place or event. + GeoShape: URIRef # The geographic shape of a place. A GeoShape can be described using several properties whose values are based on latitude/longitude pairs. Either whitespace or commas can be used to separate latitude and longitude; whitespace should be used when writing a list of several such points. + GeospatialGeometry: URIRef # (Eventually to be defined as) a supertype of GeoShape designed to accommodate definitions from Geo-Spatial best practices. + Geriatric: URIRef # A specific branch of medical science that is concerned with the diagnosis and treatment of diseases, debilities and provision of care to the aged. + GettingAccessHealthAspect: URIRef # Content that discusses practical and policy aspects for getting access to specific kinds of healthcare (e.g. distribution mechanisms for vaccines). + GiveAction: URIRef # The act of transferring ownership of an object to a destination. Reciprocal of TakeAction.\n\nRelated actions:\n\n* [[TakeAction]]: Reciprocal of GiveAction.\n* [[SendAction]]: Unlike SendAction, GiveAction implies that ownership is being transferred (e.g. I may send my laptop to you, but that doesn't mean I'm giving it to you). + GlutenFreeDiet: URIRef # A diet exclusive of gluten. + GolfCourse: URIRef # A golf course. + GovernmentBenefitsType: URIRef # GovernmentBenefitsType enumerates several kinds of government benefits to support the COVID-19 situation. Note that this structure may not capture all benefits offered. + GovernmentBuilding: URIRef # A government building. + GovernmentOffice: ( + URIRef # A government office—for example, an IRS or DMV office. + ) + GovernmentOrganization: URIRef # A governmental organization or agency. + GovernmentPermit: URIRef # A permit issued by a government agency. + GovernmentService: URIRef # A service provided by a government organization, e.g. food stamps, veterans benefits, etc. + Grant: URIRef # A grant, typically financial or otherwise quantifiable, of resources. Typically a [[funder]] sponsors some [[MonetaryAmount]] to an [[Organization]] or [[Person]], sometimes not necessarily via a dedicated or long-lived [[Project]], resulting in one or more outputs, or [[fundedItem]]s. For financial sponsorship, indicate the [[funder]] of a [[MonetaryGrant]]. For non-financial support, indicate [[sponsor]] of [[Grant]]s of resources (e.g. office space). Grants support activities directed towards some agreed collective goals, often but not always organized as [[Project]]s. Long-lived projects are sometimes sponsored by a variety of grants over time, but it is also common for a project to be associated with a single grant. The amount of a [[Grant]] is represented using [[amount]] as a [[MonetaryAmount]]. + GraphicNovel: URIRef # Book format: GraphicNovel. May represent a bound collection of ComicIssue instances. + GroceryStore: URIRef # A grocery store. + GroupBoardingPolicy: ( + URIRef # The airline boards by groups based on check-in time, priority, etc. + ) + Guide: URIRef # [[Guide]] is a page or article that recommend specific products or services, or aspects of a thing for a user to consider. A [[Guide]] may represent a Buying Guide and detail aspects of products or services for a user to consider. A [[Guide]] may represent a Product Guide and recommend specific products or services. A [[Guide]] may represent a Ranked List and recommend specific products or services with ranking. + Gynecologic: URIRef # A specific branch of medical science that pertains to the health care of women, particularly in the diagnosis and treatment of disorders affecting the female reproductive system. + HVACBusiness: URIRef # A business that provide Heating, Ventilation and Air Conditioning services. + Hackathon: URIRef # A [hackathon](https://en.wikipedia.org/wiki/Hackathon) event. + HairSalon: URIRef # A hair salon. + HalalDiet: URIRef # A diet conforming to Islamic dietary practices. + Hardcover: URIRef # Book format: Hardcover. + HardwareStore: URIRef # A hardware store. + Head: URIRef # Head assessment with clinical examination. + HealthAndBeautyBusiness: URIRef # Health and beauty. + HealthAspectEnumeration: URIRef # HealthAspectEnumeration enumerates several aspects of health content online, each of which might be described using [[hasHealthAspect]] and [[HealthTopicContent]]. + HealthCare: URIRef # HealthCare: this is a benefit for health care. + HealthClub: URIRef # A health club. + HealthInsurancePlan: ( + URIRef # A US-style health insurance plan, including PPOs, EPOs, and HMOs. + ) + HealthPlanCostSharingSpecification: URIRef # A description of costs to the patient under a given network or formulary. + HealthPlanFormulary: URIRef # For a given health insurance plan, the specification for costs and coverage of prescription drugs. + HealthPlanNetwork: URIRef # A US-style health insurance plan network. + HealthTopicContent: URIRef # [[HealthTopicContent]] is [[WebContent]] that is about some aspect of a health topic, e.g. a condition, its symptoms or treatments. Such content may be comprised of several parts or sections and use different types of media. Multiple instances of [[WebContent]] (and hence [[HealthTopicContent]]) can be related using [[hasPart]] / [[isPartOf]] where there is some kind of content hierarchy, and their content described with [[about]] and [[mentions]] e.g. building upon the existing [[MedicalCondition]] vocabulary. + HearingImpairedSupported: ( + URIRef # Uses devices to support users with hearing impairments. + ) + Hematologic: URIRef # A specific branch of medical science that pertains to diagnosis and treatment of disorders of blood and blood producing organs. + HighSchool: URIRef # A high school. + HinduDiet: URIRef # A diet conforming to Hindu dietary practices, in particular, beef-free. + HinduTemple: URIRef # A Hindu temple. + HobbyShop: ( + URIRef # A store that sells materials useful or necessary for various hobbies. + ) + HomeAndConstructionBusiness: URIRef # A construction business.\n\nA HomeAndConstructionBusiness is a [[LocalBusiness]] that provides services around homes and buildings.\n\nAs a [[LocalBusiness]] it can be described as a [[provider]] of one or more [[Service]]\(s). + HomeGoodsStore: URIRef # A home goods store. + Homeopathic: URIRef # A system of medicine based on the principle that a disease can be cured by a substance that produces similar symptoms in healthy people. + Hospital: URIRef # A hospital. + Hostel: URIRef # A hostel - cheap accommodation, often in shared dormitories.

See also the dedicated document on the use of schema.org for marking up hotels and other forms of accommodations. + Hotel: URIRef # A hotel is an establishment that provides lodging paid on a short-term basis (Source: Wikipedia, the free encyclopedia, see http://en.wikipedia.org/wiki/Hotel).

See also the dedicated document on the use of schema.org for marking up hotels and other forms of accommodations. + HotelRoom: URIRef # A hotel room is a single room in a hotel.

See also the dedicated document on the use of schema.org for marking up hotels and other forms of accommodations. + House: URIRef # A house is a building or structure that has the ability to be occupied for habitation by humans or other creatures (Source: Wikipedia, the free encyclopedia, see http://en.wikipedia.org/wiki/House). + HousePainter: URIRef # A house painting service. + HowItWorksHealthAspect: URIRef # Content that discusses and explains how a particular health-related topic works, e.g. in terms of mechanisms and underlying science. + HowOrWhereHealthAspect: URIRef # Information about how or where to find a topic. Also may contain location data that can be used for where to look for help if the topic is observed. + HowTo: URIRef # Instructions that explain how to achieve a result by performing a sequence of steps. + HowToDirection: URIRef # A direction indicating a single action to do in the instructions for how to achieve a result. + HowToItem: URIRef # An item used as either a tool or supply when performing the instructions for how to to achieve a result. + HowToSection: URIRef # A sub-grouping of steps in the instructions for how to achieve a result (e.g. steps for making a pie crust within a pie recipe). + HowToStep: URIRef # A step in the instructions for how to achieve a result. It is an ordered list with HowToDirection and/or HowToTip items. + HowToSupply: URIRef # A supply consumed when performing the instructions for how to achieve a result. + HowToTip: URIRef # An explanation in the instructions for how to achieve a result. It provides supplementary information about a technique, supply, author's preference, etc. It can explain what could be done, or what should not be done, but doesn't specify what should be done (see HowToDirection). + HowToTool: URIRef # A tool used (but not consumed) when performing instructions for how to achieve a result. + HyperToc: URIRef # A HyperToc represents a hypertext table of contents for complex media objects, such as [[VideoObject]], [[AudioObject]]. Items in the table of contents are indicated using the [[tocEntry]] property, and typed [[HyperTocEntry]]. For cases where the same larger work is split into multiple files, [[associatedMedia]] can be used on individual [[HyperTocEntry]] items. + HyperTocEntry: URIRef # A HyperToEntry is an item within a [[HyperToc]], which represents a hypertext table of contents for complex media objects, such as [[VideoObject]], [[AudioObject]]. The media object itself is indicated using [[associatedMedia]]. Each section of interest within that content can be described with a [[HyperTocEntry]], with associated [[startOffset]] and [[endOffset]]. When several entries are all from the same file, [[associatedMedia]] is used on the overarching [[HyperTocEntry]]; if the content has been split into multiple files, they can be referenced using [[associatedMedia]] on each [[HyperTocEntry]]. + IceCreamShop: URIRef # An ice cream shop. + IgnoreAction: URIRef # The act of intentionally disregarding the object. An agent ignores an object. + ImageGallery: URIRef # Web page type: Image gallery page. + ImageObject: URIRef # An image file. + ImageObjectSnapshot: URIRef # A specific and exact (byte-for-byte) version of an [[ImageObject]]. Two byte-for-byte identical files, for the purposes of this type, considered identical. If they have different embedded metadata (e.g. XMP, EXIF) the files will differ. Different external facts about the files, e.g. creator or dateCreated that aren't represented in their actual content, do not affect this notion of identity. + ImagingTest: ( + URIRef # Any medical imaging modality typically used for diagnostic purposes. + ) + InForce: URIRef # Indicates that a legislation is in force. + InStock: URIRef # Indicates that the item is in stock. + InStoreOnly: ( + URIRef # Indicates that the item is available only at physical locations. + ) + IndividualProduct: URIRef # A single, identifiable product instance (e.g. a laptop with a particular serial number). + Infectious: URIRef # Something in medical science that pertains to infectious diseases i.e caused by bacterial, viral, fungal or parasitic infections. + InfectiousAgentClass: URIRef # Classes of agents or pathogens that transmit infectious diseases. Enumerated type. + InfectiousDisease: URIRef # An infectious disease is a clinically evident human disease resulting from the presence of pathogenic microbial agents, like pathogenic viruses, pathogenic bacteria, fungi, protozoa, multicellular parasites, and prions. To be considered an infectious disease, such pathogens are known to be able to cause this disease. + InformAction: URIRef # The act of notifying someone of information pertinent to them, with no expectation of a response. + IngredientsHealthAspect: ( + URIRef # Content discussing ingredients-related aspects of a health topic. + ) + InsertAction: ( + URIRef # The act of adding at a specific location in an ordered collection. + ) + InstallAction: URIRef # The act of installing an application. + Installment: URIRef # Represents the installment pricing component of the total price for an offered product. + InsuranceAgency: URIRef # An Insurance agency. + Intangible: URIRef # A utility class that serves as the umbrella for a number of 'intangible' things such as quantities, structured values, etc. + Integer: URIRef # Data type: Integer. + InteractAction: ( + URIRef # The act of interacting with another person or organization. + ) + InteractionCounter: URIRef # A summary of how users have interacted with this CreativeWork. In most cases, authors will use a subtype to specify the specific type of interaction. + InternationalTrial: URIRef # An international trial. + InternetCafe: URIRef # An internet cafe. + InvestmentFund: URIRef # A company or fund that gathers capital from a number of investors to create a pool of money that is then re-invested into stocks, bonds and other assets. + InvestmentOrDeposit: URIRef # A type of financial product that typically requires the client to transfer funds to a financial service in return for potential beneficial financial return. + InviteAction: URIRef # The act of asking someone to attend an event. Reciprocal of RsvpAction. + Invoice: URIRef # A statement of the money due for goods or services; a bill. + InvoicePrice: URIRef # Represents the invoice price of an offered product. + ItemAvailability: URIRef # A list of possible product availability options. + ItemList: URIRef # A list of items of any sort—for example, Top 10 Movies About Weathermen, or Top 100 Party Songs. Not to be confused with HTML lists, which are often used only for formatting. + ItemListOrderAscending: ( + URIRef # An ItemList ordered with lower values listed first. + ) + ItemListOrderDescending: ( + URIRef # An ItemList ordered with higher values listed first. + ) + ItemListOrderType: URIRef # Enumerated for values for itemListOrder for indicating how an ordered ItemList is organized. + ItemListUnordered: URIRef # An ItemList ordered with no explicit order. + ItemPage: URIRef # A page devoted to a single item, such as a particular product or hotel. + JewelryStore: URIRef # A jewelry store. + JobPosting: ( + URIRef # A listing that describes a job opening in a certain organization. + ) + JoinAction: URIRef # An agent joins an event/group with participants/friends at a location.\n\nRelated actions:\n\n* [[RegisterAction]]: Unlike RegisterAction, JoinAction refers to joining a group/team of people.\n* [[SubscribeAction]]: Unlike SubscribeAction, JoinAction does not imply that you'll be receiving updates.\n* [[FollowAction]]: Unlike FollowAction, JoinAction does not imply that you'll be polling for updates. + Joint: URIRef # The anatomical location at which two or more bones make contact. + KosherDiet: URIRef # A diet conforming to Jewish dietary practices. + LaboratoryScience: URIRef # A medical science pertaining to chemical, hematological, immunologic, microscopic, or bacteriological diagnostic analyses or research. + LakeBodyOfWater: URIRef # A lake (for example, Lake Pontrachain). + Landform: URIRef # A landform or physical feature. Landform elements include mountains, plains, lakes, rivers, seascape and oceanic waterbody interface features such as bays, peninsulas, seas and so forth, including sub-aqueous terrain features such as submersed mountain ranges, volcanoes, and the great ocean basins. + LandmarksOrHistoricalBuildings: URIRef # An historical landmark or building. + Language: URIRef # Natural languages such as Spanish, Tamil, Hindi, English, etc. Formal language code tags expressed in [BCP 47](https://en.wikipedia.org/wiki/IETF_language_tag) can be used via the [[alternateName]] property. The Language type previously also covered programming languages such as Scheme and Lisp, which are now best represented using [[ComputerLanguage]]. + LaserDiscFormat: URIRef # LaserDiscFormat. + LearningResource: URIRef # The LearningResource type can be used to indicate [[CreativeWork]]s (whether physical or digital) that have a particular and explicit orientation towards learning, education, skill acquisition, and other educational purposes. [[LearningResource]] is expected to be used as an addition to a primary type such as [[Book]], [[VideoObject]], [[Product]] etc. [[EducationEvent]] serves a similar purpose for event-like things (e.g. a [[Trip]]). A [[LearningResource]] may be created as a result of an [[EducationEvent]], for example by recording one. + LeaveAction: URIRef # An agent leaves an event / group with participants/friends at a location.\n\nRelated actions:\n\n* [[JoinAction]]: The antonym of LeaveAction.\n* [[UnRegisterAction]]: Unlike UnRegisterAction, LeaveAction implies leaving a group/team of people rather than a service. + LeftHandDriving: URIRef # The steering position is on the left side of the vehicle (viewed from the main direction of driving). + LegalForceStatus: ( + URIRef # A list of possible statuses for the legal force of a legislation. + ) + LegalService: URIRef # A LegalService is a business that provides legally-oriented services, advice and representation, e.g. law firms.\n\nAs a [[LocalBusiness]] it can be described as a [[provider]] of one or more [[Service]]\(s). + LegalValueLevel: ( + URIRef # A list of possible levels for the legal validity of a legislation. + ) + Legislation: URIRef # A legal document such as an act, decree, bill, etc. (enforceable or not) or a component of a legal act (like an article). + LegislationObject: URIRef # A specific object or file containing a Legislation. Note that the same Legislation can be published in multiple files. For example, a digitally signed PDF, a plain PDF and an HTML version. + LegislativeBuilding: ( + URIRef # A legislative building—for example, the state capitol. + ) + LeisureTimeActivity: URIRef # Any physical activity engaged in for recreational purposes. Examples may include ballroom dancing, roller skating, canoeing, fishing, etc. + LendAction: URIRef # The act of providing an object under an agreement that it will be returned at a later date. Reciprocal of BorrowAction.\n\nRelated actions:\n\n* [[BorrowAction]]: Reciprocal of LendAction. + Library: URIRef # A library. + LibrarySystem: URIRef # A [[LibrarySystem]] is a collaborative system amongst several libraries. + LifestyleModification: URIRef # A process of care involving exercise, changes to diet, fitness routines, and other lifestyle changes aimed at improving a health condition. + Ligament: URIRef # A short band of tough, flexible, fibrous connective tissue that functions to connect multiple bones, cartilages, and structurally support joints. + LikeAction: URIRef # The act of expressing a positive sentiment about the object. An agent likes an object (a proposition, topic or theme) with participants. + LimitedAvailability: URIRef # Indicates that the item has limited availability. + LimitedByGuaranteeCharity: URIRef # LimitedByGuaranteeCharity: Non-profit type referring to a charitable company that is limited by guarantee (UK). + LinkRole: URIRef # A Role that represents a Web link e.g. as expressed via the 'url' property. Its linkRelationship property can indicate URL-based and plain textual link types e.g. those in IANA link registry or others such as 'amphtml'. This structure provides a placeholder where details from HTML's link element can be represented outside of HTML, e.g. in JSON-LD feeds. + LiquorStore: URIRef # A shop that sells alcoholic drinks such as wine, beer, whisky and other spirits. + ListItem: URIRef # An list item, e.g. a step in a checklist or how-to description. + ListPrice: URIRef # Represents the list price (the price a product is actually advertised for) of an offered product. + ListenAction: URIRef # The act of consuming audio content. + LiteraryEvent: URIRef # Event type: Literary event. + LiveAlbum: URIRef # LiveAlbum. + LiveBlogPosting: URIRef # A [[LiveBlogPosting]] is a [[BlogPosting]] intended to provide a rolling textual coverage of an ongoing event through continuous updates. + LivingWithHealthAspect: ( + URIRef # Information about coping or life related to the topic. + ) + LoanOrCredit: URIRef # A financial product for the loaning of an amount of money, or line of credit, under agreed terms and charges. + LocalBusiness: URIRef # A particular physical business or branch of an organization. Examples of LocalBusiness include a restaurant, a particular branch of a restaurant chain, a branch of a bank, a medical practice, a club, a bowling alley, etc. + LocationFeatureSpecification: URIRef # Specifies a location feature by providing a structured value representing a feature of an accommodation as a property-value pair of varying degrees of formality. + LockerDelivery: ( + URIRef # A DeliveryMethod in which an item is made available via locker. + ) + Locksmith: URIRef # A locksmith. + LodgingBusiness: URIRef # A lodging business, such as a motel, hotel, or inn. + LodgingReservation: URIRef # A reservation for lodging at a hotel, motel, inn, etc.\n\nNote: This type is for information about actual reservations, e.g. in confirmation emails or HTML pages with individual confirmations of reservations. + Longitudinal: URIRef # Unlike cross-sectional studies, longitudinal studies track the same people, and therefore the differences observed in those people are less likely to be the result of cultural differences across generations. Longitudinal studies are also used in medicine to uncover predictors of certain diseases. + LoseAction: URIRef # The act of being defeated in a competitive activity. + LowCalorieDiet: URIRef # A diet focused on reduced calorie intake. + LowFatDiet: URIRef # A diet focused on reduced fat and cholesterol intake. + LowLactoseDiet: URIRef # A diet appropriate for people with lactose intolerance. + LowSaltDiet: URIRef # A diet focused on reduced sodium intake. + Lung: URIRef # Lung and respiratory system clinical examination. + LymphaticVessel: URIRef # A type of blood vessel that specifically carries lymph fluid unidirectionally toward the heart. + MRI: URIRef # Magnetic resonance imaging. + MSRP: URIRef # Represents the manufacturer suggested retail price ("MSRP") of an offered product. + Male: URIRef # The male gender. + Manuscript: URIRef # A book, document, or piece of music written by hand rather than typed or printed. + Map: URIRef # A map. + MapCategoryType: URIRef # An enumeration of several kinds of Map. + MarryAction: URIRef # The act of marrying a person. + Mass: URIRef # Properties that take Mass as values are of the form '<Number> <Mass unit of measure>'. E.g., '7 kg'. + MathSolver: URIRef # A math solver which is capable of solving a subset of mathematical problems. + MaximumDoseSchedule: URIRef # The maximum dosing schedule considered safe for a drug or supplement as recommended by an authority or by the drug/supplement's manufacturer. Capture the recommending authority in the recognizingAuthority property of MedicalEntity. + MayTreatHealthAspect: URIRef # Related topics may be treated by a Topic. + MeasurementTypeEnumeration: URIRef # Enumeration of common measurement types (or dimensions), for example "chest" for a person, "inseam" for pants, "gauge" for screws, or "wheel" for bicycles. + MediaGallery: URIRef # Web page type: Media gallery page. A mixed-media page that can contains media such as images, videos, and other multimedia. + MediaManipulationRatingEnumeration: URIRef # Codes for use with the [[mediaAuthenticityCategory]] property, indicating the authenticity of a media object (in the context of how it was published or shared). In general these codes are not mutually exclusive, although some combinations (such as 'original' versus 'transformed', 'edited' and 'staged') would be contradictory if applied in the same [[MediaReview]]. Note that the application of these codes is with regard to a piece of media shared or published in a particular context. + MediaObject: URIRef # A media object, such as an image, video, or audio object embedded in a web page or a downloadable dataset i.e. DataDownload. Note that a creative work may have many media objects associated with it on the same web page. For example, a page about a single song (MusicRecording) may have a music video (VideoObject), and a high and low bandwidth audio stream (2 AudioObject's). + MediaReview: URIRef # A [[MediaReview]] is a more specialized form of Review dedicated to the evaluation of media content online, typically in the context of fact-checking and misinformation. For more general reviews of media in the broader sense, use [[UserReview]], [[CriticReview]] or other [[Review]] types. This definition is a work in progress. While the [[MediaManipulationRatingEnumeration]] list reflects significant community review amongst fact-checkers and others working to combat misinformation, the specific structures for representing media objects, their versions and publication context, is still evolving. Similarly, best practices for the relationship between [[MediaReview]] and [[ClaimReview]] markup has not yet been finalized. + MediaReviewItem: URIRef # Represents an item or group of closely related items treated as a unit for the sake of evaluation in a [[MediaReview]]. Authorship etc. apply to the items rather than to the curation/grouping or reviewing party. + MediaSubscription: URIRef # A subscription which allows a user to access media including audio, video, books, etc. + MedicalAudience: URIRef # Target audiences for medical web pages. + MedicalAudienceType: ( + URIRef # Target audiences types for medical web pages. Enumerated type. + ) + MedicalBusiness: URIRef # A particular physical or virtual business of an organization for medical purposes. Examples of MedicalBusiness include differents business run by health professionals. + MedicalCause: URIRef # The causative agent(s) that are responsible for the pathophysiologic process that eventually results in a medical condition, symptom or sign. In this schema, unless otherwise specified this is meant to be the proximate cause of the medical condition, symptom or sign. The proximate cause is defined as the causative agent that most directly results in the medical condition, symptom or sign. For example, the HIV virus could be considered a cause of AIDS. Or in a diagnostic context, if a patient fell and sustained a hip fracture and two days later sustained a pulmonary embolism which eventuated in a cardiac arrest, the cause of the cardiac arrest (the proximate cause) would be the pulmonary embolism and not the fall. Medical causes can include cardiovascular, chemical, dermatologic, endocrine, environmental, gastroenterologic, genetic, hematologic, gynecologic, iatrogenic, infectious, musculoskeletal, neurologic, nutritional, obstetric, oncologic, otolaryngologic, pharmacologic, psychiatric, pulmonary, renal, rheumatologic, toxic, traumatic, or urologic causes; medical conditions can be causes as well. + MedicalClinic: URIRef # A facility, often associated with a hospital or medical school, that is devoted to the specific diagnosis and/or healthcare. Previously limited to outpatients but with evolution it may be open to inpatients as well. + MedicalCode: URIRef # A code for a medical entity. + MedicalCondition: URIRef # Any condition of the human body that affects the normal functioning of a person, whether physically or mentally. Includes diseases, injuries, disabilities, disorders, syndromes, etc. + MedicalConditionStage: ( + URIRef # A stage of a medical condition, such as 'Stage IIIa'. + ) + MedicalContraindication: URIRef # A condition or factor that serves as a reason to withhold a certain medical therapy. Contraindications can be absolute (there are no reasonable circumstances for undertaking a course of action) or relative (the patient is at higher risk of complications, but that these risks may be outweighed by other considerations or mitigated by other measures). + MedicalDevice: URIRef # Any object used in a medical capacity, such as to diagnose or treat a patient. + MedicalDevicePurpose: URIRef # Categories of medical devices, organized by the purpose or intended use of the device. + MedicalEntity: URIRef # The most generic type of entity related to health and the practice of medicine. + MedicalEnumeration: URIRef # Enumerations related to health and the practice of medicine: A concept that is used to attribute a quality to another concept, as a qualifier, a collection of items or a listing of all of the elements of a set in medicine practice. + MedicalEvidenceLevel: ( + URIRef # Level of evidence for a medical guideline. Enumerated type. + ) + MedicalGuideline: URIRef # Any recommendation made by a standard society (e.g. ACC/AHA) or consensus statement that denotes how to diagnose and treat a particular condition. Note: this type should be used to tag the actual guideline recommendation; if the guideline recommendation occurs in a larger scholarly article, use MedicalScholarlyArticle to tag the overall article, not this type. Note also: the organization making the recommendation should be captured in the recognizingAuthority base property of MedicalEntity. + MedicalGuidelineContraindication: URIRef # A guideline contraindication that designates a process as harmful and where quality of the data supporting the contraindication is sound. + MedicalGuidelineRecommendation: URIRef # A guideline recommendation that is regarded as efficacious and where quality of the data supporting the recommendation is sound. + MedicalImagingTechnique: URIRef # Any medical imaging modality typically used for diagnostic purposes. Enumerated type. + MedicalIndication: URIRef # A condition or factor that indicates use of a medical therapy, including signs, symptoms, risk factors, anatomical states, etc. + MedicalIntangible: URIRef # A utility class that serves as the umbrella for a number of 'intangible' things in the medical space. + MedicalObservationalStudy: URIRef # An observational study is a type of medical study that attempts to infer the possible effect of a treatment through observation of a cohort of subjects over a period of time. In an observational study, the assignment of subjects into treatment groups versus control groups is outside the control of the investigator. This is in contrast with controlled studies, such as the randomized controlled trials represented by MedicalTrial, where each subject is randomly assigned to a treatment group or a control group before the start of the treatment. + MedicalObservationalStudyDesign: ( + URIRef # Design models for observational medical studies. Enumerated type. + ) + MedicalOrganization: URIRef # A medical organization (physical or not), such as hospital, institution or clinic. + MedicalProcedure: URIRef # A process of care used in either a diagnostic, therapeutic, preventive or palliative capacity that relies on invasive (surgical), non-invasive, or other techniques. + MedicalProcedureType: ( + URIRef # An enumeration that describes different types of medical procedures. + ) + MedicalResearcher: URIRef # Medical researchers. + MedicalRiskCalculator: URIRef # A complex mathematical calculation requiring an online calculator, used to assess prognosis. Note: use the url property of Thing to record any URLs for online calculators. + MedicalRiskEstimator: URIRef # Any rule set or interactive tool for estimating the risk of developing a complication or condition. + MedicalRiskFactor: URIRef # A risk factor is anything that increases a person's likelihood of developing or contracting a disease, medical condition, or complication. + MedicalRiskScore: URIRef # A simple system that adds up the number of risk factors to yield a score that is associated with prognosis, e.g. CHAD score, TIMI risk score. + MedicalScholarlyArticle: URIRef # A scholarly article in the medical domain. + MedicalSign: URIRef # Any physical manifestation of a person's medical condition discoverable by objective diagnostic tests or physical examination. + MedicalSignOrSymptom: URIRef # Any feature associated or not with a medical condition. In medicine a symptom is generally subjective while a sign is objective. + MedicalSpecialty: URIRef # Any specific branch of medical science or practice. Medical specialities include clinical specialties that pertain to particular organ systems and their respective disease states, as well as allied health specialties. Enumerated type. + MedicalStudy: URIRef # A medical study is an umbrella type covering all kinds of research studies relating to human medicine or health, including observational studies and interventional trials and registries, randomized, controlled or not. When the specific type of study is known, use one of the extensions of this type, such as MedicalTrial or MedicalObservationalStudy. Also, note that this type should be used to mark up data that describes the study itself; to tag an article that publishes the results of a study, use MedicalScholarlyArticle. Note: use the code property of MedicalEntity to store study IDs, e.g. clinicaltrials.gov ID. + MedicalStudyStatus: URIRef # The status of a medical study. Enumerated type. + MedicalSymptom: URIRef # Any complaint sensed and expressed by the patient (therefore defined as subjective) like stomachache, lower-back pain, or fatigue. + MedicalTest: ( + URIRef # Any medical test, typically performed for diagnostic purposes. + ) + MedicalTestPanel: URIRef # Any collection of tests commonly ordered together. + MedicalTherapy: URIRef # Any medical intervention designed to prevent, treat, and cure human diseases and medical conditions, including both curative and palliative therapies. Medical therapies are typically processes of care relying upon pharmacotherapy, behavioral therapy, supportive therapy (with fluid or nutrition for example), or detoxification (e.g. hemodialysis) aimed at improving or preventing a health condition. + MedicalTrial: URIRef # A medical trial is a type of medical study that uses scientific process used to compare the safety and efficacy of medical therapies or medical procedures. In general, medical trials are controlled and subjects are allocated at random to the different treatment and/or control groups. + MedicalTrialDesign: URIRef # Design models for medical trials. Enumerated type. + MedicalWebPage: URIRef # A web page that provides medical information. + MedicineSystem: URIRef # Systems of medical practice. + MeetingRoom: URIRef # A meeting room, conference room, or conference hall is a room provided for singular events such as business conferences and meetings (Source: Wikipedia, the free encyclopedia, see http://en.wikipedia.org/wiki/Conference_hall).

See also the dedicated document on the use of schema.org for marking up hotels and other forms of accommodations. + MensClothingStore: URIRef # A men's clothing store. + Menu: URIRef # A structured representation of food or drink items available from a FoodEstablishment. + MenuItem: URIRef # A food or drink item listed in a menu or menu section. + MenuSection: URIRef # A sub-grouping of food or drink items in a menu. E.g. courses (such as 'Dinner', 'Breakfast', etc.), specific type of dishes (such as 'Meat', 'Vegan', 'Drinks', etc.), or some other classification made by the menu provider. + MerchantReturnEnumeration: ( + URIRef # Enumerates several kinds of product return policies. + ) + MerchantReturnFiniteReturnWindow: ( + URIRef # Specifies that there is a finite window for product returns. + ) + MerchantReturnNotPermitted: ( + URIRef # Specifies that product returns are not permitted. + ) + MerchantReturnPolicy: URIRef # A MerchantReturnPolicy provides information about product return policies associated with an [[Organization]], [[Product]], or [[Offer]]. + MerchantReturnPolicySeasonalOverride: ( + URIRef # A seasonal override of a return policy, for example used for holidays. + ) + MerchantReturnUnlimitedWindow: ( + URIRef # Specifies that there is an unlimited window for product returns. + ) + MerchantReturnUnspecified: ( + URIRef # Specifies that a product return policy is not provided. + ) + Message: ( + URIRef # A single message from a sender to one or more organizations or people. + ) + MiddleSchool: URIRef # A middle school (typically for children aged around 11-14, although this varies somewhat). + Midwifery: URIRef # A nurse-like health profession that deals with pregnancy, childbirth, and the postpartum period (including care of the newborn), besides sexual and reproductive health of women throughout their lives. + MinimumAdvertisedPrice: URIRef # Represents the minimum advertised price ("MAP") (as dictated by the manufacturer) of an offered product. + MisconceptionsHealthAspect: URIRef # Content about common misconceptions and myths that are related to a topic. + MixedEventAttendanceMode: URIRef # MixedEventAttendanceMode - an event that is conducted as a combination of both offline and online modes. + MixtapeAlbum: URIRef # MixtapeAlbum. + MobileApplication: URIRef # A software application designed specifically to work well on a mobile device such as a telephone. + MobilePhoneStore: ( + URIRef # A store that sells mobile phones and related accessories. + ) + MolecularEntity: URIRef # Any constitutionally or isotopically distinct atom, molecule, ion, ion pair, radical, radical ion, complex, conformer etc., identifiable as a separately distinguishable entity. + Monday: URIRef # The day of the week between Sunday and Tuesday. + MonetaryAmount: URIRef # A monetary value or range. This type can be used to describe an amount of money such as $50 USD, or a range as in describing a bank account being suitable for a balance between £1,000 and £1,000,000 GBP, or the value of a salary, etc. It is recommended to use [[PriceSpecification]] Types to describe the price of an Offer, Invoice, etc. + MonetaryAmountDistribution: ( + URIRef # A statistical distribution of monetary amounts. + ) + MonetaryGrant: URIRef # A monetary grant. + MoneyTransfer: URIRef # The act of transferring money from one place to another place. This may occur electronically or physically. + MortgageLoan: URIRef # A loan in which property or real estate is used as collateral. (A loan securitized against some real estate). + Mosque: URIRef # A mosque. + Motel: URIRef # A motel.

See also the dedicated document on the use of schema.org for marking up hotels and other forms of accommodations. + Motorcycle: URIRef # A motorcycle or motorbike is a single-track, two-wheeled motor vehicle. + MotorcycleDealer: URIRef # A motorcycle dealer. + MotorcycleRepair: URIRef # A motorcycle repair shop. + MotorizedBicycle: URIRef # A motorized bicycle is a bicycle with an attached motor used to power the vehicle, or to assist with pedaling. + Mountain: URIRef # A mountain, like Mount Whitney or Mount Everest. + MoveAction: URIRef # The act of an agent relocating to a place.\n\nRelated actions:\n\n* [[TransferAction]]: Unlike TransferAction, the subject of the move is a living Person or Organization rather than an inanimate object. + Movie: URIRef # A movie. + MovieClip: URIRef # A short segment/part of a movie. + MovieRentalStore: URIRef # A movie rental store. + MovieSeries: URIRef # A series of movies. Included movies can be indicated with the hasPart property. + MovieTheater: URIRef # A movie theater. + MovingCompany: URIRef # A moving company. + MultiCenterTrial: URIRef # A trial that takes place at multiple centers. + MultiPlayer: URIRef # Play mode: MultiPlayer. Requiring or allowing multiple human players to play simultaneously. + MulticellularParasite: URIRef # Multicellular parasite that causes an infection. + Muscle: URIRef # A muscle is an anatomical structure consisting of a contractile form of tissue that animals use to effect movement. + Musculoskeletal: URIRef # A specific branch of medical science that pertains to diagnosis and treatment of disorders of muscles, ligaments and skeletal system. + MusculoskeletalExam: URIRef # Musculoskeletal system clinical examination. + Museum: URIRef # A museum. + MusicAlbum: URIRef # A collection of music tracks. + MusicAlbumProductionType: URIRef # Classification of the album by it's type of content: soundtrack, live album, studio album, etc. + MusicAlbumReleaseType: ( + URIRef # The kind of release which this album is: single, EP or album. + ) + MusicComposition: URIRef # A musical composition. + MusicEvent: URIRef # Event type: Music event. + MusicGroup: URIRef # A musical group, such as a band, an orchestra, or a choir. Can also be a solo musician. + MusicPlaylist: URIRef # A collection of music tracks in playlist form. + MusicRecording: URIRef # A music recording (track), usually a single song. + MusicRelease: URIRef # A MusicRelease is a specific release of a music album. + MusicReleaseFormatType: URIRef # Format of this release (the type of recording media used, ie. compact disc, digital media, LP, etc.). + MusicStore: URIRef # A music store. + MusicVenue: URIRef # A music venue. + MusicVideoObject: URIRef # A music video file. + NGO: URIRef # Organization: Non-governmental Organization. + NLNonprofitType: URIRef # NLNonprofitType: Non-profit organization type originating from the Netherlands. + NailSalon: URIRef # A nail salon. + Neck: URIRef # Neck assessment with clinical examination. + Nerve: URIRef # A common pathway for the electrochemical nerve impulses that are transmitted along each of the axons. + Neuro: URIRef # Neurological system clinical examination. + Neurologic: URIRef # A specific branch of medical science that studies the nerves and nervous system and its respective disease states. + NewCondition: URIRef # Indicates that the item is new. + NewsArticle: URIRef # A NewsArticle is an article whose content reports news, or provides background context and supporting materials for understanding the news. A more detailed overview of [schema.org News markup](/docs/news.html) is also available. + NewsMediaOrganization: ( + URIRef # A News/Media organization such as a newspaper or TV station. + ) + Newspaper: URIRef # A publication containing information about varied topics that are pertinent to general information, a geographic area, or a specific subject matter (i.e. business, culture, education). Often published daily. + NightClub: URIRef # A nightclub or discotheque. + NoninvasiveProcedure: ( + URIRef # A type of medical procedure that involves noninvasive techniques. + ) + Nonprofit501a: URIRef # Nonprofit501a: Non-profit type referring to Farmers’ Cooperative Associations. + Nonprofit501c1: URIRef # Nonprofit501c1: Non-profit type referring to Corporations Organized Under Act of Congress, including Federal Credit Unions and National Farm Loan Associations. + Nonprofit501c10: URIRef # Nonprofit501c10: Non-profit type referring to Domestic Fraternal Societies and Associations. + Nonprofit501c11: URIRef # Nonprofit501c11: Non-profit type referring to Teachers' Retirement Fund Associations. + Nonprofit501c12: URIRef # Nonprofit501c12: Non-profit type referring to Benevolent Life Insurance Associations, Mutual Ditch or Irrigation Companies, Mutual or Cooperative Telephone Companies. + Nonprofit501c13: ( + URIRef # Nonprofit501c13: Non-profit type referring to Cemetery Companies. + ) + Nonprofit501c14: URIRef # Nonprofit501c14: Non-profit type referring to State-Chartered Credit Unions, Mutual Reserve Funds. + Nonprofit501c15: URIRef # Nonprofit501c15: Non-profit type referring to Mutual Insurance Companies or Associations. + Nonprofit501c16: URIRef # Nonprofit501c16: Non-profit type referring to Cooperative Organizations to Finance Crop Operations. + Nonprofit501c17: URIRef # Nonprofit501c17: Non-profit type referring to Supplemental Unemployment Benefit Trusts. + Nonprofit501c18: URIRef # Nonprofit501c18: Non-profit type referring to Employee Funded Pension Trust (created before 25 June 1959). + Nonprofit501c19: URIRef # Nonprofit501c19: Non-profit type referring to Post or Organization of Past or Present Members of the Armed Forces. + Nonprofit501c2: URIRef # Nonprofit501c2: Non-profit type referring to Title-holding Corporations for Exempt Organizations. + Nonprofit501c20: URIRef # Nonprofit501c20: Non-profit type referring to Group Legal Services Plan Organizations. + Nonprofit501c21: URIRef # Nonprofit501c21: Non-profit type referring to Black Lung Benefit Trusts. + Nonprofit501c22: URIRef # Nonprofit501c22: Non-profit type referring to Withdrawal Liability Payment Funds. + Nonprofit501c23: ( + URIRef # Nonprofit501c23: Non-profit type referring to Veterans Organizations. + ) + Nonprofit501c24: URIRef # Nonprofit501c24: Non-profit type referring to Section 4049 ERISA Trusts. + Nonprofit501c25: URIRef # Nonprofit501c25: Non-profit type referring to Real Property Title-Holding Corporations or Trusts with Multiple Parents. + Nonprofit501c26: URIRef # Nonprofit501c26: Non-profit type referring to State-Sponsored Organizations Providing Health Coverage for High-Risk Individuals. + Nonprofit501c27: URIRef # Nonprofit501c27: Non-profit type referring to State-Sponsored Workers' Compensation Reinsurance Organizations. + Nonprofit501c28: URIRef # Nonprofit501c28: Non-profit type referring to National Railroad Retirement Investment Trusts. + Nonprofit501c3: URIRef # Nonprofit501c3: Non-profit type referring to Religious, Educational, Charitable, Scientific, Literary, Testing for Public Safety, to Foster National or International Amateur Sports Competition, or Prevention of Cruelty to Children or Animals Organizations. + Nonprofit501c4: URIRef # Nonprofit501c4: Non-profit type referring to Civic Leagues, Social Welfare Organizations, and Local Associations of Employees. + Nonprofit501c5: URIRef # Nonprofit501c5: Non-profit type referring to Labor, Agricultural and Horticultural Organizations. + Nonprofit501c6: URIRef # Nonprofit501c6: Non-profit type referring to Business Leagues, Chambers of Commerce, Real Estate Boards. + Nonprofit501c7: URIRef # Nonprofit501c7: Non-profit type referring to Social and Recreational Clubs. + Nonprofit501c8: URIRef # Nonprofit501c8: Non-profit type referring to Fraternal Beneficiary Societies and Associations. + Nonprofit501c9: URIRef # Nonprofit501c9: Non-profit type referring to Voluntary Employee Beneficiary Associations. + Nonprofit501d: URIRef # Nonprofit501d: Non-profit type referring to Religious and Apostolic Associations. + Nonprofit501e: URIRef # Nonprofit501e: Non-profit type referring to Cooperative Hospital Service Organizations. + Nonprofit501f: URIRef # Nonprofit501f: Non-profit type referring to Cooperative Service Organizations. + Nonprofit501k: ( + URIRef # Nonprofit501k: Non-profit type referring to Child Care Organizations. + ) + Nonprofit501n: ( + URIRef # Nonprofit501n: Non-profit type referring to Charitable Risk Pools. + ) + Nonprofit501q: URIRef # Nonprofit501q: Non-profit type referring to Credit Counseling Organizations. + Nonprofit527: ( + URIRef # Nonprofit527: Non-profit type referring to Political organizations. + ) + NonprofitANBI: URIRef # NonprofitANBI: Non-profit type referring to a Public Benefit Organization (NL). + NonprofitSBBI: URIRef # NonprofitSBBI: Non-profit type referring to a Social Interest Promoting Institution (NL). + NonprofitType: URIRef # NonprofitType enumerates several kinds of official non-profit types of which a non-profit organization can be. + Nose: URIRef # Nose function assessment with clinical examination. + NotInForce: URIRef # Indicates that a legislation is currently not in force. + NotYetRecruiting: URIRef # Not yet recruiting. + Notary: URIRef # A notary. + NoteDigitalDocument: URIRef # A file containing a note, primarily for the author. + Number: URIRef # Data type: Number.\n\nUsage guidelines:\n\n* Use values from 0123456789 (Unicode 'DIGIT ZERO' (U+0030) to 'DIGIT NINE' (U+0039)) rather than superficially similiar Unicode symbols.\n* Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to indicate a decimal point. Avoid using these symbols as a readability separator. + Nursing: URIRef # A health profession of a person formally educated and trained in the care of the sick or infirm person. + NutritionInformation: URIRef # Nutritional information about the recipe. + OTC: URIRef # The character of a medical substance, typically a medicine, of being available over the counter or not. + Observation: URIRef # Instances of the class [[Observation]] are used to specify observations about an entity (which may or may not be an instance of a [[StatisticalPopulation]]), at a particular time. The principal properties of an [[Observation]] are [[observedNode]], [[measuredProperty]], [[measuredValue]] (or [[median]], etc.) and [[observationDate]] ([[measuredProperty]] properties can, but need not always, be W3C RDF Data Cube "measure properties", as in the [lifeExpectancy example](https://www.w3.org/TR/vocab-data-cube/#dsd-example)). See also [[StatisticalPopulation]], and the [data and datasets](/docs/data-and-datasets.html) overview for more details. + Observational: URIRef # An observational study design. + Obstetric: URIRef # A specific branch of medical science that specializes in the care of women during the prenatal and postnatal care and with the delivery of the child. + Occupation: URIRef # A profession, may involve prolonged training and/or a formal qualification. + OccupationalActivity: URIRef # Any physical activity engaged in for job-related purposes. Examples may include waiting tables, maid service, carrying a mailbag, picking fruits or vegetables, construction work, etc. + OccupationalExperienceRequirements: URIRef # Indicates employment-related experience requirements, e.g. [[monthsOfExperience]]. + OccupationalTherapy: URIRef # A treatment of people with physical, emotional, or social problems, using purposeful activity to help them overcome or learn to deal with their problems. + OceanBodyOfWater: URIRef # An ocean (for example, the Pacific). + Offer: URIRef # An offer to transfer some rights to an item or to provide a service — for example, an offer to sell tickets to an event, to rent the DVD of a movie, to stream a TV show over the internet, to repair a motorcycle, or to loan a book.\n\nNote: As the [[businessFunction]] property, which identifies the form of offer (e.g. sell, lease, repair, dispose), defaults to http://purl.org/goodrelations/v1#Sell; an Offer without a defined businessFunction value can be assumed to be an offer to sell.\n\nFor [GTIN](http://www.gs1.org/barcodes/technical/idkeys/gtin)-related fields, see [Check Digit calculator](http://www.gs1.org/barcodes/support/check_digit_calculator) and [validation guide](http://www.gs1us.org/resources/standards/gtin-validation-guide) from [GS1](http://www.gs1.org/). + OfferCatalog: URIRef # An OfferCatalog is an ItemList that contains related Offers and/or further OfferCatalogs that are offeredBy the same provider. + OfferForLease: URIRef # An [[OfferForLease]] in Schema.org represents an [[Offer]] to lease out something, i.e. an [[Offer]] whose [[businessFunction]] is [lease out](http://purl.org/goodrelations/v1#LeaseOut.). See [Good Relations](https://en.wikipedia.org/wiki/GoodRelations) for background on the underlying concepts. + OfferForPurchase: URIRef # An [[OfferForPurchase]] in Schema.org represents an [[Offer]] to sell something, i.e. an [[Offer]] whose [[businessFunction]] is [sell](http://purl.org/goodrelations/v1#Sell.). See [Good Relations](https://en.wikipedia.org/wiki/GoodRelations) for background on the underlying concepts. + OfferItemCondition: URIRef # A list of possible conditions for the item. + OfferShippingDetails: URIRef # OfferShippingDetails represents information about shipping destinations. Multiple of these entities can be used to represent different shipping rates for different destinations: One entity for Alaska/Hawaii. A different one for continental US.A different one for all France. Multiple of these entities can be used to represent different shipping costs and delivery times. Two entities that are identical but differ in rate and time: e.g. Cheaper and slower: $5 in 5-7days or Fast and expensive: $15 in 1-2 days. + OfficeEquipmentStore: URIRef # An office equipment store. + OfficialLegalValue: URIRef # All the documents published by an official publisher should have at least the legal value level "OfficialLegalValue". This indicates that the document was published by an organisation with the public task of making it available (e.g. a consolidated version of a EU directive published by the EU Office of Publications). + OfflineEventAttendanceMode: URIRef # OfflineEventAttendanceMode - an event that is primarily conducted offline. + OfflinePermanently: URIRef # Game server status: OfflinePermanently. Server is offline and not available. + OfflineTemporarily: URIRef # Game server status: OfflineTemporarily. Server is offline now but it can be online soon. + OnDemandEvent: URIRef # A publication event e.g. catch-up TV or radio podcast, during which a program is available on-demand. + OnSitePickup: URIRef # A DeliveryMethod in which an item is collected on site, e.g. in a store or at a box office. + Oncologic: URIRef # A specific branch of medical science that deals with benign and malignant tumors, including the study of their development, diagnosis, treatment and prevention. + OneTimePayments: URIRef # OneTimePayments: this is a benefit for one-time payments for individuals. + Online: URIRef # Game server status: Online. Server is available. + OnlineEventAttendanceMode: URIRef # OnlineEventAttendanceMode - an event that is primarily conducted online. + OnlineFull: URIRef # Game server status: OnlineFull. Server is online but unavailable. The maximum number of players has reached. + OnlineOnly: URIRef # Indicates that the item is available only online. + OpenTrial: URIRef # A trial design in which the researcher knows the full details of the treatment, and so does the patient. + OpeningHoursSpecification: URIRef # A structured value providing information about the opening hours of a place or a certain service inside a place.\n\n The place is __open__ if the [[opens]] property is specified, and __closed__ otherwise.\n\nIf the value for the [[closes]] property is less than the value for the [[opens]] property then the hour range is assumed to span over the next day. + OpinionNewsArticle: URIRef # An [[OpinionNewsArticle]] is a [[NewsArticle]] that primarily expresses opinions rather than journalistic reporting of news and events. For example, a [[NewsArticle]] consisting of a column or [[Blog]]/[[BlogPosting]] entry in the Opinions section of a news publication. + Optician: URIRef # A store that sells reading glasses and similar devices for improving vision. + Optometric: URIRef # The science or practice of testing visual acuity and prescribing corrective lenses. + Order: URIRef # An order is a confirmation of a transaction (a receipt), which can contain multiple line items, each represented by an Offer that has been accepted by the customer. + OrderAction: ( + URIRef # An agent orders an object/product/service to be delivered/sent. + ) + OrderCancelled: URIRef # OrderStatus representing cancellation of an order. + OrderDelivered: URIRef # OrderStatus representing successful delivery of an order. + OrderInTransit: URIRef # OrderStatus representing that an order is in transit. + OrderItem: URIRef # An order item is a line of an order. It includes the quantity and shipping details of a bought offer. + OrderPaymentDue: URIRef # OrderStatus representing that payment is due on an order. + OrderPickupAvailable: ( + URIRef # OrderStatus representing availability of an order for pickup. + ) + OrderProblem: ( + URIRef # OrderStatus representing that there is a problem with the order. + ) + OrderProcessing: ( + URIRef # OrderStatus representing that an order is being processed. + ) + OrderReturned: URIRef # OrderStatus representing that an order has been returned. + OrderStatus: URIRef # Enumerated status values for Order. + Organization: ( + URIRef # An organization such as a school, NGO, corporation, club, etc. + ) + OrganizationRole: ( + URIRef # A subclass of Role used to describe roles within organizations. + ) + OrganizeAction: URIRef # The act of manipulating/administering/supervising/controlling one or more objects. + OriginalMediaContent: URIRef # Content coded 'as original media content' in a [[MediaReview]], considered in the context of how it was published or shared. For a [[VideoObject]] to be 'original': No evidence the footage has been misleadingly altered or manipulated, though it may contain false or misleading claims. For an [[ImageObject]] to be 'original': No evidence the image has been misleadingly altered or manipulated, though it may still contain false or misleading claims. For an [[ImageObject]] with embedded text to be 'original': No evidence the image has been misleadingly altered or manipulated, though it may still contain false or misleading claims. For an [[AudioObject]] to be 'original': No evidence the audio has been misleadingly altered or manipulated, though it may contain false or misleading claims. + OriginalShippingFees: URIRef # Specifies that the customer must pay the original shipping costs when returning a product. + Osteopathic: URIRef # A system of medicine focused on promoting the body's innate ability to heal itself. + Otolaryngologic: URIRef # A specific branch of medical science that is concerned with the ear, nose and throat and their respective disease states. + OutOfStock: URIRef # Indicates that the item is out of stock. + OutletStore: URIRef # An outlet store. + OverviewHealthAspect: URIRef # Overview of the content. Contains a summarized view of the topic with the most relevant information for an introduction. + OwnershipInfo: URIRef # A structured value providing information about when a certain organization or person owned a certain product. + PET: URIRef # Positron emission tomography imaging. + PaidLeave: URIRef # PaidLeave: this is a benefit for paid leave. + PaintAction: URIRef # The act of producing a painting, typically with paint and canvas as instruments. + Painting: URIRef # A painting. + PalliativeProcedure: URIRef # A medical procedure intended primarily for palliative purposes, aimed at relieving the symptoms of an underlying health condition. + Paperback: URIRef # Book format: Paperback. + ParcelDelivery: URIRef # The delivery of a parcel either via the postal service or a commercial service. + ParcelService: URIRef # A private parcel service as the delivery mode available for a certain offer.\n\nCommonly used values:\n\n* http://purl.org/goodrelations/v1#DHL\n* http://purl.org/goodrelations/v1#FederalExpress\n* http://purl.org/goodrelations/v1#UPS + ParentAudience: URIRef # A set of characteristics describing parents, who can be interested in viewing some content. + ParentalSupport: URIRef # ParentalSupport: this is a benefit for parental support. + Park: URIRef # A park. + ParkingFacility: URIRef # A parking lot or other parking facility. + ParkingMap: URIRef # A parking map. + PartiallyInForce: URIRef # Indicates that parts of the legislation are in force, and parts are not. + Pathology: URIRef # A specific branch of medical science that is concerned with the study of the cause, origin and nature of a disease state, including its consequences as a result of manifestation of the disease. In clinical care, the term is used to designate a branch of medicine using laboratory tests to diagnose and determine the prognostic significance of illness. + PathologyTest: URIRef # A medical test performed by a laboratory that typically involves examination of a tissue sample by a pathologist. + Patient: URIRef # A patient is any person recipient of health care services. + PatientExperienceHealthAspect: URIRef # Content about the real life experience of patients or people that have lived a similar experience about the topic. May be forums, topics, Q-and-A and related material. + PawnShop: URIRef # A shop that will buy, or lend money against the security of, personal possessions. + PayAction: URIRef # An agent pays a price to a participant. + PaymentAutomaticallyApplied: ( + URIRef # An automatic payment system is in place and will be used. + ) + PaymentCard: URIRef # A payment method using a credit, debit, store or other card to associate the payment with an account. + PaymentChargeSpecification: ( + URIRef # The costs of settling the payment using a particular payment method. + ) + PaymentComplete: URIRef # The payment has been received and processed. + PaymentDeclined: ( + URIRef # The payee received the payment, but it was declined for some reason. + ) + PaymentDue: URIRef # The payment is due, but still within an acceptable time to be received. + PaymentMethod: URIRef # A payment method is a standardized procedure for transferring the monetary amount for a purchase. Payment methods are characterized by the legal and technical structures used, and by the organization or group carrying out the transaction.\n\nCommonly used values:\n\n* http://purl.org/goodrelations/v1#ByBankTransferInAdvance\n* http://purl.org/goodrelations/v1#ByInvoice\n* http://purl.org/goodrelations/v1#Cash\n* http://purl.org/goodrelations/v1#CheckInAdvance\n* http://purl.org/goodrelations/v1#COD\n* http://purl.org/goodrelations/v1#DirectDebit\n* http://purl.org/goodrelations/v1#GoogleCheckout\n* http://purl.org/goodrelations/v1#PayPal\n* http://purl.org/goodrelations/v1#PaySwarm + PaymentPastDue: URIRef # The payment is due and considered late. + PaymentService: URIRef # A Service to transfer funds from a person or organization to a beneficiary person or organization. + PaymentStatusType: URIRef # A specific payment status. For example, PaymentDue, PaymentComplete, etc. + Pediatric: URIRef # A specific branch of medical science that specializes in the care of infants, children and adolescents. + PeopleAudience: URIRef # A set of characteristics belonging to people, e.g. who compose an item's target audience. + PercutaneousProcedure: URIRef # A type of medical procedure that involves percutaneous techniques, where access to organs or tissue is achieved via needle-puncture of the skin. For example, catheter-based procedures like stent delivery. + PerformAction: URIRef # The act of participating in performance arts. + PerformanceRole: URIRef # A PerformanceRole is a Role that some entity places with regard to a theatrical performance, e.g. in a Movie, TVSeries etc. + PerformingArtsTheater: URIRef # A theater or other performing art center. + PerformingGroup: ( + URIRef # A performance group, such as a band, an orchestra, or a circus. + ) + Periodical: URIRef # A publication in any medium issued in successive parts bearing numerical or chronological designations and intended, such as a magazine, scholarly journal, or newspaper to continue indefinitely.\n\nSee also [blog post](http://blog.schema.org/2014/09/schemaorg-support-for-bibliographic_2.html). + Permit: URIRef # A permit issued by an organization, e.g. a parking pass. + Person: URIRef # A person (alive, dead, undead, or fictional). + PetStore: URIRef # A pet store. + Pharmacy: URIRef # A pharmacy or drugstore. + PharmacySpecialty: URIRef # The practice or art and science of preparing and dispensing drugs and medicines. + Photograph: URIRef # A photograph. + PhotographAction: ( + URIRef # The act of capturing still images of objects using a camera. + ) + PhysicalActivity: URIRef # Any bodily activity that enhances or maintains physical fitness and overall health and wellness. Includes activity that is part of daily living and routine, structured exercise, and exercise prescribed as part of a medical treatment or recovery plan. + PhysicalActivityCategory: URIRef # Categories of physical activity, organized by physiologic classification. + PhysicalExam: ( + URIRef # A type of physical examination of a patient performed by a physician. + ) + PhysicalTherapy: URIRef # A process of progressive physical care and rehabilitation aimed at improving a health condition. + Physician: URIRef # A doctor's office. + Physiotherapy: URIRef # The practice of treatment of disease, injury, or deformity by physical methods such as massage, heat treatment, and exercise rather than by drugs or surgery.. + Place: URIRef # Entities that have a somewhat fixed, physical extension. + PlaceOfWorship: URIRef # Place of worship, such as a church, synagogue, or mosque. + PlaceboControlledTrial: URIRef # A placebo-controlled trial design. + PlanAction: URIRef # The act of planning the execution of an event/task/action/reservation/plan to a future date. + PlasticSurgery: URIRef # A specific branch of medical science that pertains to therapeutic or cosmetic repair or re-formation of missing, injured or malformed tissues or body parts by manual and instrumental means. + Play: URIRef # A play is a form of literature, usually consisting of dialogue between characters, intended for theatrical performance rather than just reading. Note: A performance of a Play would be a [[TheaterEvent]] or [[BroadcastEvent]] - the *Play* being the [[workPerformed]]. + PlayAction: URIRef # The act of playing/exercising/training/performing for enjoyment, leisure, recreation, Competition or exercise.\n\nRelated actions:\n\n* [[ListenAction]]: Unlike ListenAction (which is under ConsumeAction), PlayAction refers to performing for an audience or at an event, rather than consuming music.\n* [[WatchAction]]: Unlike WatchAction (which is under ConsumeAction), PlayAction refers to showing/displaying for an audience or at an event, rather than consuming visual content. + Playground: URIRef # A playground. + Plumber: URIRef # A plumbing service. + PodcastEpisode: URIRef # A single episode of a podcast series. + PodcastSeason: URIRef # A single season of a podcast. Many podcasts do not break down into separate seasons. In that case, PodcastSeries should be used. + PodcastSeries: URIRef # A podcast is an episodic series of digital audio or video files which a user can download and listen to. + Podiatric: URIRef # Podiatry is the care of the human foot, especially the diagnosis and treatment of foot disorders. + PoliceStation: URIRef # A police station. + Pond: URIRef # A pond. + PostOffice: URIRef # A post office. + PostalAddress: URIRef # The mailing address. + PostalCodeRangeSpecification: URIRef # Indicates a range of postalcodes, usually defined as the set of valid codes between [[postalCodeBegin]] and [[postalCodeEnd]], inclusively. + Poster: URIRef # A large, usually printed placard, bill, or announcement, often illustrated, that is posted to advertise or publicize something. + PotentialActionStatus: URIRef # A description of an action that is supported. + PreOrder: URIRef # Indicates that the item is available for pre-order. + PreOrderAction: URIRef # An agent orders a (not yet released) object/product/service to be delivered/sent. + PreSale: URIRef # Indicates that the item is available for ordering and delivery before general availability. + PregnancyHealthAspect: ( + URIRef # Content discussing pregnancy-related aspects of a health topic. + ) + PrependAction: ( + URIRef # The act of inserting at the beginning if an ordered collection. + ) + Preschool: URIRef # A preschool. + PrescriptionOnly: URIRef # Available by prescription only. + PresentationDigitalDocument: ( + URIRef # A file containing slides or used for a presentation. + ) + PreventionHealthAspect: URIRef # Information about actions or measures that can be taken to avoid getting the topic or reaching a critical situation related to the topic. + PreventionIndication: ( + URIRef # An indication for preventing an underlying condition, symptom, etc. + ) + PriceComponentTypeEnumeration: URIRef # Enumerates different price components that together make up the total price for an offered product. + PriceSpecification: URIRef # A structured value representing a price or price range. Typically, only the subclasses of this type are used for markup. It is recommended to use [[MonetaryAmount]] to describe independent amounts of money such as a salary, credit card limits, etc. + PriceTypeEnumeration: URIRef # Enumerates different price types, for example list price, invoice price, and sale price. + PrimaryCare: URIRef # The medical care by a physician, or other health-care professional, who is the patient's first contact with the health-care system and who may recommend a specialist if necessary. + Prion: URIRef # A prion is an infectious agent composed of protein in a misfolded form. + Product: URIRef # Any offered product or service. For example: a pair of shoes; a concert ticket; the rental of a car; a haircut; or an episode of a TV show streamed online. + ProductCollection: URIRef # A set of products (either [[ProductGroup]]s or specific variants) that are listed together e.g. in an [[Offer]]. + ProductGroup: URIRef # A ProductGroup represents a group of [[Product]]s that vary only in certain well-described ways, such as by [[size]], [[color]], [[material]] etc. While a ProductGroup itself is not directly offered for sale, the various varying products that it represents can be. The ProductGroup serves as a prototype or template, standing in for all of the products who have an [[isVariantOf]] relationship to it. As such, properties (including additional types) can be applied to the ProductGroup to represent characteristics shared by each of the (possibly very many) variants. Properties that reference a ProductGroup are not included in this mechanism; neither are the following specific properties [[variesBy]], [[hasVariant]], [[url]]. + ProductModel: URIRef # A datasheet or vendor specification of a product (in the sense of a prototypical description). + ProfessionalService: URIRef # Original definition: "provider of professional services."\n\nThe general [[ProfessionalService]] type for local businesses was deprecated due to confusion with [[Service]]. For reference, the types that it included were: [[Dentist]], [[AccountingService]], [[Attorney]], [[Notary]], as well as types for several kinds of [[HomeAndConstructionBusiness]]: [[Electrician]], [[GeneralContractor]], [[HousePainter]], [[Locksmith]], [[Plumber]], [[RoofingContractor]]. [[LegalService]] was introduced as a more inclusive supertype of [[Attorney]]. + ProfilePage: URIRef # Web page type: Profile page. + PrognosisHealthAspect: ( + URIRef # Typical progression and happenings of life course of the topic. + ) + ProgramMembership: URIRef # Used to describe membership in a loyalty programs (e.g. "StarAliance"), traveler clubs (e.g. "AAA"), purchase clubs ("Safeway Club"), etc. + Project: URIRef # An enterprise (potentially individual but typically collaborative), planned to achieve a particular aim. Use properties from [[Organization]], [[subOrganization]]/[[parentOrganization]] to indicate project sub-structures. + PronounceableText: URIRef # Data type: PronounceableText. + Property: URIRef # A property, used to indicate attributes and relationships of some Thing; equivalent to rdf:Property. + PropertyValue: URIRef # A property-value pair, e.g. representing a feature of a product or place. Use the 'name' property for the name of the property. If there is an additional human-readable version of the value, put that into the 'description' property.\n\n Always use specific schema.org properties when a) they exist and b) you can populate them. Using PropertyValue as a substitute will typically not trigger the same effect as using the original, specific property. + PropertyValueSpecification: URIRef # A Property value specification. + Protein: URIRef # Protein is here used in its widest possible definition, as classes of amino acid based molecules. Amyloid-beta Protein in human (UniProt P05067), eukaryota (e.g. an OrthoDB group) or even a single molecule that one can point to are all of type schema:Protein. A protein can thus be a subclass of another protein, e.g. schema:Protein as a UniProt record can have multiple isoforms inside it which would also be schema:Protein. They can be imagined, synthetic, hypothetical or naturally occurring. + Protozoa: URIRef # Single-celled organism that causes an infection. + Psychiatric: URIRef # A specific branch of medical science that is concerned with the study, treatment, and prevention of mental illness, using both medical and psychological therapies. + PsychologicalTreatment: URIRef # A process of care relying upon counseling, dialogue and communication aimed at improving a mental health condition without use of drugs. + PublicHealth: URIRef # Branch of medicine that pertains to the health services to improve and protect community health, especially epidemiology, sanitation, immunization, and preventive medicine. + PublicHolidays: URIRef # This stands for any day that is a public holiday; it is a placeholder for all official public holidays in some particular location. While not technically a "day of the week", it can be used with [[OpeningHoursSpecification]]. In the context of an opening hours specification it can be used to indicate opening hours on public holidays, overriding general opening hours for the day of the week on which a public holiday occurs. + PublicSwimmingPool: URIRef # A public swimming pool. + PublicToilet: URIRef # A public toilet is a room or small building containing one or more toilets (and possibly also urinals) which is available for use by the general public, or by customers or employees of certain businesses. + PublicationEvent: URIRef # A PublicationEvent corresponds indifferently to the event of publication for a CreativeWork of any type e.g. a broadcast event, an on-demand event, a book/journal publication via a variety of delivery media. + PublicationIssue: URIRef # A part of a successively published publication such as a periodical or publication volume, often numbered, usually containing a grouping of works such as articles.\n\nSee also [blog post](http://blog.schema.org/2014/09/schemaorg-support-for-bibliographic_2.html). + PublicationVolume: URIRef # A part of a successively published publication such as a periodical or multi-volume work, often numbered. It may represent a time span, such as a year.\n\nSee also [blog post](http://blog.schema.org/2014/09/schemaorg-support-for-bibliographic_2.html). + Pulmonary: URIRef # A specific branch of medical science that pertains to the study of the respiratory system and its respective disease states. + QAPage: URIRef # A QAPage is a WebPage focussed on a specific Question and its Answer(s), e.g. in a question answering site or documenting Frequently Asked Questions (FAQs). + QualitativeValue: URIRef # A predefined value for a product characteristic, e.g. the power cord plug type 'US' or the garment sizes 'S', 'M', 'L', and 'XL'. + QuantitativeValue: URIRef # A point value or interval for product characteristics and other purposes. + QuantitativeValueDistribution: URIRef # A statistical distribution of values. + Quantity: URIRef # Quantities such as distance, time, mass, weight, etc. Particular instances of say Mass are entities like '3 Kg' or '4 milligrams'. + Question: URIRef # A specific question - e.g. from a user seeking answers online, or collected in a Frequently Asked Questions (FAQ) document. + Quiz: URIRef # Quiz: A test of knowledge, skills and abilities. + Quotation: URIRef # A quotation. Often but not necessarily from some written work, attributable to a real world author and - if associated with a fictional character - to any fictional Person. Use [[isBasedOn]] to link to source/origin. The [[recordedIn]] property can be used to reference a Quotation from an [[Event]]. + QuoteAction: URIRef # An agent quotes/estimates/appraises an object/product/service with a price at a location/store. + RVPark: URIRef # A place offering space for "Recreational Vehicles", Caravans, mobile homes and the like. + RadiationTherapy: URIRef # A process of care using radiation aimed at improving a health condition. + RadioBroadcastService: URIRef # A delivery service through which radio content is provided via broadcast over the air or online. + RadioChannel: URIRef # A unique instance of a radio BroadcastService on a CableOrSatelliteService lineup. + RadioClip: URIRef # A short radio program or a segment/part of a radio program. + RadioEpisode: URIRef # A radio episode which can be part of a series or season. + RadioSeason: ( + URIRef # Season dedicated to radio broadcast and associated online delivery. + ) + RadioSeries: URIRef # CreativeWorkSeries dedicated to radio broadcast and associated online delivery. + RadioStation: URIRef # A radio station. + Radiography: URIRef # Radiography is an imaging technique that uses electromagnetic radiation other than visible light, especially X-rays, to view the internal structure of a non-uniformly composed and opaque object such as the human body. + RandomizedTrial: URIRef # A randomized trial design. + Rating: ( + URIRef # A rating is an evaluation on a numeric scale, such as 1 to 5 stars. + ) + ReactAction: URIRef # The act of responding instinctively and emotionally to an object, expressing a sentiment. + ReadAction: URIRef # The act of consuming written content. + ReadPermission: URIRef # Permission to read or view the document. + RealEstateAgent: URIRef # A real-estate agent. + RealEstateListing: URIRef # A [[RealEstateListing]] is a listing that describes one or more real-estate [[Offer]]s (whose [[businessFunction]] is typically to lease out, or to sell). The [[RealEstateListing]] type itself represents the overall listing, as manifested in some [[WebPage]]. + RearWheelDriveConfiguration: URIRef # Real-wheel drive is a transmission layout where the engine drives the rear wheels. + ReceiveAction: URIRef # The act of physically/electronically taking delivery of an object that has been transferred from an origin to a destination. Reciprocal of SendAction.\n\nRelated actions:\n\n* [[SendAction]]: The reciprocal of ReceiveAction.\n* [[TakeAction]]: Unlike TakeAction, ReceiveAction does not imply that the ownership has been transfered (e.g. I can receive a package, but it does not mean the package is now mine). + Recipe: URIRef # A recipe. For dietary restrictions covered by the recipe, a few common restrictions are enumerated via [[suitableForDiet]]. The [[keywords]] property can also be used to add more detail. + Recommendation: URIRef # [[Recommendation]] is a type of [[Review]] that suggests or proposes something as the best option or best course of action. Recommendations may be for products or services, or other concrete things, as in the case of a ranked list or product guide. A [[Guide]] may list multiple recommendations for different categories. For example, in a [[Guide]] about which TVs to buy, the author may have several [[Recommendation]]s. + RecommendedDoseSchedule: URIRef # A recommended dosing schedule for a drug or supplement as prescribed or recommended by an authority or by the drug/supplement's manufacturer. Capture the recommending authority in the recognizingAuthority property of MedicalEntity. + Recruiting: URIRef # Recruiting participants. + RecyclingCenter: URIRef # A recycling center. + RefundTypeEnumeration: ( + URIRef # Enumerates several kinds of product return refund types. + ) + RefurbishedCondition: URIRef # Indicates that the item is refurbished. + RegisterAction: URIRef # The act of registering to be a user of a service, product or web page.\n\nRelated actions:\n\n* [[JoinAction]]: Unlike JoinAction, RegisterAction implies you are registering to be a user of a service, *not* a group/team of people.\n* [FollowAction]]: Unlike FollowAction, RegisterAction doesn't imply that the agent is expecting to poll for updates from the object.\n* [[SubscribeAction]]: Unlike SubscribeAction, RegisterAction doesn't imply that the agent is expecting updates from the object. + Registry: URIRef # A registry-based study design. + ReimbursementCap: URIRef # The drug's cost represents the maximum reimbursement paid by an insurer for the drug. + RejectAction: URIRef # The act of rejecting to/adopting an object.\n\nRelated actions:\n\n* [[AcceptAction]]: The antonym of RejectAction. + RelatedTopicsHealthAspect: ( + URIRef # Other prominent or relevant topics tied to the main topic. + ) + RemixAlbum: URIRef # RemixAlbum. + Renal: URIRef # A specific branch of medical science that pertains to the study of the kidneys and its respective disease states. + RentAction: URIRef # The act of giving money in return for temporary use, but not ownership, of an object such as a vehicle or property. For example, an agent rents a property from a landlord in exchange for a periodic payment. + RentalCarReservation: URIRef # A reservation for a rental car.\n\nNote: This type is for information about actual reservations, e.g. in confirmation emails or HTML pages with individual confirmations of reservations. + RentalVehicleUsage: URIRef # Indicates the usage of the vehicle as a rental car. + RepaymentSpecification: URIRef # A structured value representing repayment. + ReplaceAction: URIRef # The act of editing a recipient by replacing an old object with a new object. + ReplyAction: URIRef # The act of responding to a question/message asked/sent by the object. Related to [[AskAction]]\n\nRelated actions:\n\n* [[AskAction]]: Appears generally as an origin of a ReplyAction. + Report: ( + URIRef # A Report generated by governmental or non-governmental organization. + ) + ReportageNewsArticle: URIRef # The [[ReportageNewsArticle]] type is a subtype of [[NewsArticle]] representing news articles which are the result of journalistic news reporting conventions. In practice many news publishers produce a wide variety of article types, many of which might be considered a [[NewsArticle]] but not a [[ReportageNewsArticle]]. For example, opinion pieces, reviews, analysis, sponsored or satirical articles, or articles that combine several of these elements. The [[ReportageNewsArticle]] type is based on a stricter ideal for "news" as a work of journalism, with articles based on factual information either observed or verified by the author, or reported and verified from knowledgeable sources. This often includes perspectives from multiple viewpoints on a particular issue (distinguishing news reports from public relations or propaganda). News reports in the [[ReportageNewsArticle]] sense de-emphasize the opinion of the author, with commentary and value judgements typically expressed elsewhere. A [[ReportageNewsArticle]] which goes deeper into analysis can also be marked with an additional type of [[AnalysisNewsArticle]]. + ReportedDoseSchedule: URIRef # A patient-reported or observed dosing schedule for a drug or supplement. + ResearchOrganization: ( + URIRef # A Research Organization (e.g. scientific institute, research company). + ) + ResearchProject: URIRef # A Research project. + Researcher: URIRef # Researchers. + Reservation: URIRef # Describes a reservation for travel, dining or an event. Some reservations require tickets. \n\nNote: This type is for information about actual reservations, e.g. in confirmation emails or HTML pages with individual confirmations of reservations. For offers of tickets, restaurant reservations, flights, or rental cars, use [[Offer]]. + ReservationCancelled: URIRef # The status for a previously confirmed reservation that is now cancelled. + ReservationConfirmed: URIRef # The status of a confirmed reservation. + ReservationHold: URIRef # The status of a reservation on hold pending an update like credit card number or flight changes. + ReservationPackage: URIRef # A group of multiple reservations with common values for all sub-reservations. + ReservationPending: URIRef # The status of a reservation when a request has been sent, but not confirmed. + ReservationStatusType: URIRef # Enumerated status values for Reservation. + ReserveAction: URIRef # Reserving a concrete object.\n\nRelated actions:\n\n* [[ScheduleAction]]: Unlike ScheduleAction, ReserveAction reserves concrete objects (e.g. a table, a hotel) towards a time slot / spatial allocation. + Reservoir: URIRef # A reservoir of water, typically an artificially created lake, like the Lake Kariba reservoir. + Residence: URIRef # The place where a person lives. + Resort: URIRef # A resort is a place used for relaxation or recreation, attracting visitors for holidays or vacations. Resorts are places, towns or sometimes commercial establishment operated by a single company (Source: Wikipedia, the free encyclopedia, see http://en.wikipedia.org/wiki/Resort).

See also the dedicated document on the use of schema.org for marking up hotels and other forms of accommodations. + RespiratoryTherapy: URIRef # The therapy that is concerned with the maintenance or improvement of respiratory function (as in patients with pulmonary disease). + Restaurant: URIRef # A restaurant. + RestockingFees: URIRef # Specifies that the customer must pay a restocking fee when returning a product + RestrictedDiet: URIRef # A diet restricted to certain foods or preparations for cultural, religious, health or lifestyle reasons. + ResultsAvailable: URIRef # Results are available. + ResultsNotAvailable: URIRef # Results are not available. + ResumeAction: URIRef # The act of resuming a device or application which was formerly paused (e.g. resume music playback or resume a timer). + Retail: URIRef # The drug's cost represents the retail cost of the drug. + ReturnAction: URIRef # The act of returning to the origin that which was previously received (concrete objects) or taken (ownership). + ReturnAtKiosk: URIRef # Specifies that product returns must be made at a kiosk. + ReturnByMail: URIRef # Specifies that product returns must to be done by mail. + ReturnFeesCustomerResponsibility: URIRef # Specifies that product returns must be paid for, and are the responsibility of, the customer. + ReturnFeesEnumeration: ( + URIRef # Enumerates several kinds of policies for product return fees. + ) + ReturnInStore: URIRef # Specifies that product returns must be made in a store. + ReturnLabelCustomerResponsibility: URIRef # Indicated that creating a return label is the responsibility of the customer. + ReturnLabelDownloadAndPrint: URIRef # Indicated that a return label must be downloaded and printed by the customer. + ReturnLabelInBox: URIRef # Specifies that a return label will be provided by the seller in the shipping box. + ReturnLabelSourceEnumeration: ( + URIRef # Enumerates several types of return labels for product returns. + ) + ReturnMethodEnumeration: ( + URIRef # Enumerates several types of product return methods. + ) + ReturnShippingFees: URIRef # Specifies that the customer must pay the return shipping costs when returning a product + Review: ( + URIRef # A review of an item - for example, of a restaurant, movie, or store. + ) + ReviewAction: URIRef # The act of producing a balanced opinion about the object for an audience. An agent reviews an object with participants resulting in a review. + ReviewNewsArticle: URIRef # A [[NewsArticle]] and [[CriticReview]] providing a professional critic's assessment of a service, product, performance, or artistic or literary work. + Rheumatologic: URIRef # A specific branch of medical science that deals with the study and treatment of rheumatic, autoimmune or joint diseases. + RightHandDriving: URIRef # The steering position is on the right side of the vehicle (viewed from the main direction of driving). + RisksOrComplicationsHealthAspect: URIRef # Information about the risk factors and possible complications that may follow a topic. + RiverBodyOfWater: URIRef # A river (for example, the broad majestic Shannon). + Role: URIRef # Represents additional information about a relationship or property. For example a Role can be used to say that a 'member' role linking some SportsTeam to a player occurred during a particular time period. Or that a Person's 'actor' role in a Movie was for some particular characterName. Such properties can be attached to a Role entity, which is then associated with the main entities using ordinary properties like 'member' or 'actor'.\n\nSee also [blog post](http://blog.schema.org/2014/06/introducing-role.html). + RoofingContractor: URIRef # A roofing contractor. + Room: URIRef # A room is a distinguishable space within a structure, usually separated from other spaces by interior walls. (Source: Wikipedia, the free encyclopedia, see http://en.wikipedia.org/wiki/Room).

See also the dedicated document on the use of schema.org for marking up hotels and other forms of accommodations. + RsvpAction: URIRef # The act of notifying an event organizer as to whether you expect to attend the event. + RsvpResponseMaybe: URIRef # The invitee may or may not attend. + RsvpResponseNo: URIRef # The invitee will not attend. + RsvpResponseType: URIRef # RsvpResponseType is an enumeration type whose instances represent responding to an RSVP request. + RsvpResponseYes: URIRef # The invitee will attend. + SRP: URIRef # Represents the suggested retail price ("SRP") of an offered product. + SafetyHealthAspect: ( + URIRef # Content about the safety-related aspects of a health topic. + ) + SaleEvent: URIRef # Event type: Sales event. + SalePrice: URIRef # Represents a sale price (usually active for a limited period) of an offered product. + SatireOrParodyContent: URIRef # Content coded 'satire or parody content' in a [[MediaReview]], considered in the context of how it was published or shared. For a [[VideoObject]] to be 'satire or parody content': A video that was created as political or humorous commentary and is presented in that context. (Reshares of satire/parody content that do not include relevant context are more likely to fall under the “missing context” rating.) For an [[ImageObject]] to be 'satire or parody content': An image that was created as political or humorous commentary and is presented in that context. (Reshares of satire/parody content that do not include relevant context are more likely to fall under the “missing context” rating.) For an [[ImageObject]] with embedded text to be 'satire or parody content': An image that was created as political or humorous commentary and is presented in that context. (Reshares of satire/parody content that do not include relevant context are more likely to fall under the “missing context” rating.) For an [[AudioObject]] to be 'satire or parody content': Audio that was created as political or humorous commentary and is presented in that context. (Reshares of satire/parody content that do not include relevant context are more likely to fall under the “missing context” rating.) + SatiricalArticle: URIRef # An [[Article]] whose content is primarily [[satirical]](https://en.wikipedia.org/wiki/Satire) in nature, i.e. unlikely to be literally true. A satirical article is sometimes but not necessarily also a [[NewsArticle]]. [[ScholarlyArticle]]s are also sometimes satirized. + Saturday: URIRef # The day of the week between Friday and Sunday. + Schedule: URIRef # A schedule defines a repeating time period used to describe a regularly occurring [[Event]]. At a minimum a schedule will specify [[repeatFrequency]] which describes the interval between occurences of the event. Additional information can be provided to specify the schedule more precisely. This includes identifying the day(s) of the week or month when the recurring event will take place, in addition to its start and end time. Schedules may also have start and end dates to indicate when they are active, e.g. to define a limited calendar of events. + ScheduleAction: URIRef # Scheduling future actions, events, or tasks.\n\nRelated actions:\n\n* [[ReserveAction]]: Unlike ReserveAction, ScheduleAction allocates future actions (e.g. an event, a task, etc) towards a time slot / spatial allocation. + ScholarlyArticle: URIRef # A scholarly article. + School: URIRef # A school. + SchoolDistrict: URIRef # A School District is an administrative area for the administration of schools. + ScreeningEvent: URIRef # A screening of a movie or other video. + ScreeningHealthAspect: ( + URIRef # Content about how to screen or further filter a topic. + ) + Sculpture: URIRef # A piece of sculpture. + SeaBodyOfWater: URIRef # A sea (for example, the Caspian sea). + SearchAction: URIRef # The act of searching for an object.\n\nRelated actions:\n\n* [[FindAction]]: SearchAction generally leads to a FindAction, but not necessarily. + SearchResultsPage: URIRef # Web page type: Search results page. + Season: URIRef # A media season e.g. tv, radio, video game etc. + Seat: URIRef # Used to describe a seat, such as a reserved seat in an event reservation. + SeatingMap: URIRef # A seating map. + SeeDoctorHealthAspect: URIRef # Information about questions that may be asked, when to see a professional, measures before seeing a doctor or content about the first consultation. + SeekToAction: URIRef # This is the [[Action]] of navigating to a specific [[startOffset]] timestamp within a [[VideoObject]], typically represented with a URL template structure. + SelfCareHealthAspect: URIRef # Self care actions or measures that can be taken to sooth, health or avoid a topic. This may be carried at home and can be carried/managed by the person itself. + SelfStorage: URIRef # A self-storage facility. + SellAction: URIRef # The act of taking money from a buyer in exchange for goods or services rendered. An agent sells an object, product, or service to a buyer for a price. Reciprocal of BuyAction. + SendAction: URIRef # The act of physically/electronically dispatching an object for transfer from an origin to a destination.Related actions:\n\n* [[ReceiveAction]]: The reciprocal of SendAction.\n* [[GiveAction]]: Unlike GiveAction, SendAction does not imply the transfer of ownership (e.g. I can send you my laptop, but I'm not necessarily giving it to you). + Series: URIRef # A Series in schema.org is a group of related items, typically but not necessarily of the same kind. See also [[CreativeWorkSeries]], [[EventSeries]]. + Service: URIRef # A service provided by an organization, e.g. delivery service, print services, etc. + ServiceChannel: URIRef # A means for accessing a service, e.g. a government office location, web site, or phone number. + ShareAction: URIRef # The act of distributing content to people for their amusement or edification. + SheetMusic: URIRef # Printed music, as opposed to performed or recorded music. + ShippingDeliveryTime: URIRef # ShippingDeliveryTime provides various pieces of information about delivery times for shipping. + ShippingRateSettings: URIRef # A ShippingRateSettings represents re-usable pieces of shipping information. It is designed for publication on an URL that may be referenced via the [[shippingSettingsLink]] property of an [[OfferShippingDetails]]. Several occurrences can be published, distinguished and matched (i.e. identified/referenced) by their different values for [[shippingLabel]]. + ShoeStore: URIRef # A shoe store. + ShoppingCenter: URIRef # A shopping center or mall. + ShortStory: URIRef # Short story or tale. A brief work of literature, usually written in narrative prose. + SideEffectsHealthAspect: ( + URIRef # Side effects that can be observed from the usage of the topic. + ) + SingleBlindedTrial: URIRef # A trial design in which the researcher knows which treatment the patient was randomly assigned to but the patient does not. + SingleCenterTrial: URIRef # A trial that takes place at a single center. + SingleFamilyResidence: URIRef # Residence type: Single-family home. + SinglePlayer: URIRef # Play mode: SinglePlayer. Which is played by a lone player. + SingleRelease: URIRef # SingleRelease. + SiteNavigationElement: URIRef # A navigation element of the page. + SizeGroupEnumeration: ( + URIRef # Enumerates common size groups for various product categories. + ) + SizeSpecification: URIRef # Size related properties of a product, typically a size code ([[name]]) and optionally a [[sizeSystem]], [[sizeGroup]], and product measurements ([[hasMeasurement]]). In addition, the intended audience can be defined through [[suggestedAge]], [[suggestedGender]], and suggested body measurements ([[suggestedMeasurement]]). + SizeSystemEnumeration: URIRef # Enumerates common size systems for different categories of products, for example "EN-13402" or "UK" for wearables or "Imperial" for screws. + SizeSystemImperial: URIRef # Imperial size system. + SizeSystemMetric: URIRef # Metric size system. + SkiResort: URIRef # A ski resort. + Skin: URIRef # Skin assessment with clinical examination. + SocialEvent: URIRef # Event type: Social event. + SocialMediaPosting: URIRef # A post to a social media platform, including blog posts, tweets, Facebook posts, etc. + SoftwareApplication: URIRef # A software application. + SoftwareSourceCode: URIRef # Computer programming source code. Example: Full (compile ready) solutions, code snippet samples, scripts, templates. + SoldOut: URIRef # Indicates that the item has sold out. + SolveMathAction: URIRef # The action that takes in a math expression and directs users to a page potentially capable of solving/simplifying that expression. + SomeProducts: ( + URIRef # A placeholder for multiple similar products of the same kind. + ) + SoundtrackAlbum: URIRef # SoundtrackAlbum. + SpeakableSpecification: URIRef # A SpeakableSpecification indicates (typically via [[xpath]] or [[cssSelector]]) sections of a document that are highlighted as particularly [[speakable]]. Instances of this type are expected to be used primarily as values of the [[speakable]] property. + SpecialAnnouncement: URIRef # A SpecialAnnouncement combines a simple date-stamped textual information update with contextualized Web links and other structured data. It represents an information update made by a locally-oriented organization, for example schools, pharmacies, healthcare providers, community groups, police, local government. For work in progress guidelines on Coronavirus-related markup see [this doc](https://docs.google.com/document/d/14ikaGCKxo50rRM7nvKSlbUpjyIk2WMQd3IkB1lItlrM/edit#). The motivating scenario for SpecialAnnouncement is the [Coronavirus pandemic](https://en.wikipedia.org/wiki/2019%E2%80%9320_coronavirus_pandemic), and the initial vocabulary is oriented to this urgent situation. Schema.org expect to improve the markup iteratively as it is deployed and as feedback emerges from use. In addition to our usual [Github entry](https://github.com/schemaorg/schemaorg/issues/2490), feedback comments can also be provided in [this document](https://docs.google.com/document/d/1fpdFFxk8s87CWwACs53SGkYv3aafSxz_DTtOQxMrBJQ/edit#). While this schema is designed to communicate urgent crisis-related information, it is not the same as an emergency warning technology like [CAP](https://en.wikipedia.org/wiki/Common_Alerting_Protocol), although there may be overlaps. The intent is to cover the kinds of everyday practical information being posted to existing websites during an emergency situation. Several kinds of information can be provided: We encourage the provision of "name", "text", "datePosted", "expires" (if appropriate), "category" and "url" as a simple baseline. It is important to provide a value for "category" where possible, most ideally as a well known URL from Wikipedia or Wikidata. In the case of the 2019-2020 Coronavirus pandemic, this should be "https://en.wikipedia.org/w/index.php?title=2019-20\_coronavirus\_pandemic" or "https://www.wikidata.org/wiki/Q81068910". For many of the possible properties, values can either be simple links or an inline description, depending on whether a summary is available. For a link, provide just the URL of the appropriate page as the property's value. For an inline description, use a [[WebContent]] type, and provide the url as a property of that, alongside at least a simple "[[text]]" summary of the page. It is unlikely that a single SpecialAnnouncement will need all of the possible properties simultaneously. We expect that in many cases the page referenced might contain more specialized structured data, e.g. contact info, [[openingHours]], [[Event]], [[FAQPage]] etc. By linking to those pages from a [[SpecialAnnouncement]] you can help make it clearer that the events are related to the situation (e.g. Coronavirus) indicated by the [[category]] property of the [[SpecialAnnouncement]]. Many [[SpecialAnnouncement]]s will relate to particular regions and to identifiable local organizations. Use [[spatialCoverage]] for the region, and [[announcementLocation]] to indicate specific [[LocalBusiness]]es and [[CivicStructure]]s. If the announcement affects both a particular region and a specific location (for example, a library closure that serves an entire region), use both [[spatialCoverage]] and [[announcementLocation]]. The [[about]] property can be used to indicate entities that are the focus of the announcement. We now recommend using [[about]] only for representing non-location entities (e.g. a [[Course]] or a [[RadioStation]]). For places, use [[announcementLocation]] and [[spatialCoverage]]. Consumers of this markup should be aware that the initial design encouraged the use of /about for locations too. The basic content of [[SpecialAnnouncement]] is similar to that of an [RSS](https://en.wikipedia.org/wiki/RSS) or [Atom](https://en.wikipedia.org/wiki/Atom_(Web_standard)) feed. For publishers without such feeds, basic feed-like information can be shared by posting [[SpecialAnnouncement]] updates in a page, e.g. using JSON-LD. For sites with Atom/RSS functionality, you can point to a feed with the [[webFeed]] property. This can be a simple URL, or an inline [[DataFeed]] object, with [[encodingFormat]] providing media type information e.g. "application/rss+xml" or "application/atom+xml". + Specialty: URIRef # Any branch of a field in which people typically develop specific expertise, usually after significant study, time, and effort. + SpeechPathology: URIRef # The scientific study and treatment of defects, disorders, and malfunctions of speech and voice, as stuttering, lisping, or lalling, and of language disturbances, as aphasia or delayed language acquisition. + SpokenWordAlbum: URIRef # SpokenWordAlbum. + SportingGoodsStore: URIRef # A sporting goods store. + SportsActivityLocation: URIRef # A sports location, such as a playing field. + SportsClub: URIRef # A sports club. + SportsEvent: URIRef # Event type: Sports event. + SportsOrganization: URIRef # Represents the collection of all sports organizations, including sports teams, governing bodies, and sports associations. + SportsTeam: URIRef # Organization: Sports team. + SpreadsheetDigitalDocument: URIRef # A spreadsheet file. + StadiumOrArena: URIRef # A stadium. + StagedContent: URIRef # Content coded 'staged content' in a [[MediaReview]], considered in the context of how it was published or shared. For a [[VideoObject]] to be 'staged content': A video that has been created using actors or similarly contrived. For an [[ImageObject]] to be 'staged content': An image that was created using actors or similarly contrived, such as a screenshot of a fake tweet. For an [[ImageObject]] with embedded text to be 'staged content': An image that was created using actors or similarly contrived, such as a screenshot of a fake tweet. For an [[AudioObject]] to be 'staged content': Audio that has been created using actors or similarly contrived. + StagesHealthAspect: URIRef # Stages that can be observed from a topic. + State: URIRef # A state or province of a country. + Statement: URIRef # A statement about something, for example a fun or interesting fact. If known, the main entity this statement is about, can be indicated using mainEntity. For more formal claims (e.g. in Fact Checking), consider using [[Claim]] instead. Use the [[text]] property to capture the text of the statement. + StatisticalPopulation: URIRef # A StatisticalPopulation is a set of instances of a certain given type that satisfy some set of constraints. The property [[populationType]] is used to specify the type. Any property that can be used on instances of that type can appear on the statistical population. For example, a [[StatisticalPopulation]] representing all [[Person]]s with a [[homeLocation]] of East Podunk California, would be described by applying the appropriate [[homeLocation]] and [[populationType]] properties to a [[StatisticalPopulation]] item that stands for that set of people. The properties [[numConstraints]] and [[constrainingProperty]] are used to specify which of the populations properties are used to specify the population. Note that the sense of "population" used here is the general sense of a statistical population, and does not imply that the population consists of people. For example, a [[populationType]] of [[Event]] or [[NewsArticle]] could be used. See also [[Observation]], and the [data and datasets](/docs/data-and-datasets.html) overview for more details. + StatusEnumeration: URIRef # Lists or enumerations dealing with status types. + SteeringPositionValue: URIRef # A value indicating a steering position. + Store: URIRef # A retail good store. + StoreCreditRefund: URIRef # Specifies that the customer receives a store credit as refund when returning a product + StrengthTraining: URIRef # Physical activity that is engaged in to improve muscle and bone strength. Also referred to as resistance training. + StructuredValue: URIRef # Structured values are used when the value of a property has a more complex structure than simply being a textual value or a reference to another thing. + StudioAlbum: URIRef # StudioAlbum. + SubscribeAction: URIRef # The act of forming a personal connection with someone/something (object) unidirectionally/asymmetrically to get updates pushed to.\n\nRelated actions:\n\n* [[FollowAction]]: Unlike FollowAction, SubscribeAction implies that the subscriber acts as a passive agent being constantly/actively pushed for updates.\n* [[RegisterAction]]: Unlike RegisterAction, SubscribeAction implies that the agent is interested in continuing receiving updates from the object.\n* [[JoinAction]]: Unlike JoinAction, SubscribeAction implies that the agent is interested in continuing receiving updates from the object. + Subscription: URIRef # Represents the subscription pricing component of the total price for an offered product. + Substance: URIRef # Any matter of defined composition that has discrete existence, whose origin may be biological, mineral or chemical. + SubwayStation: URIRef # A subway station. + Suite: URIRef # A suite in a hotel or other public accommodation, denotes a class of luxury accommodations, the key feature of which is multiple rooms (Source: Wikipedia, the free encyclopedia, see http://en.wikipedia.org/wiki/Suite_(hotel)).

See also the dedicated document on the use of schema.org for marking up hotels and other forms of accommodations. + Sunday: URIRef # The day of the week between Saturday and Monday. + SuperficialAnatomy: URIRef # Anatomical features that can be observed by sight (without dissection), including the form and proportions of the human body as well as surface landmarks that correspond to deeper subcutaneous structures. Superficial anatomy plays an important role in sports medicine, phlebotomy, and other medical specialties as underlying anatomical structures can be identified through surface palpation. For example, during back surgery, superficial anatomy can be used to palpate and count vertebrae to find the site of incision. Or in phlebotomy, superficial anatomy can be used to locate an underlying vein; for example, the median cubital vein can be located by palpating the borders of the cubital fossa (such as the epicondyles of the humerus) and then looking for the superficial signs of the vein, such as size, prominence, ability to refill after depression, and feel of surrounding tissue support. As another example, in a subluxation (dislocation) of the glenohumeral joint, the bony structure becomes pronounced with the deltoid muscle failing to cover the glenohumeral joint allowing the edges of the scapula to be superficially visible. Here, the superficial anatomy is the visible edges of the scapula, implying the underlying dislocation of the joint (the related anatomical structure). + Surgical: URIRef # A specific branch of medical science that pertains to treating diseases, injuries and deformities by manual and instrumental means. + SurgicalProcedure: URIRef # A medical procedure involving an incision with instruments; performed for diagnose, or therapeutic purposes. + SuspendAction: URIRef # The act of momentarily pausing a device or application (e.g. pause music playback or pause a timer). + Suspended: URIRef # Suspended. + SymptomsHealthAspect: URIRef # Symptoms or related symptoms of a Topic. + Synagogue: URIRef # A synagogue. + TVClip: URIRef # A short TV program or a segment/part of a TV program. + TVEpisode: URIRef # A TV episode which can be part of a series or season. + TVSeason: URIRef # Season dedicated to TV broadcast and associated online delivery. + TVSeries: URIRef # CreativeWorkSeries dedicated to TV broadcast and associated online delivery. + Table: URIRef # A table on a Web page. + TakeAction: URIRef # The act of gaining ownership of an object from an origin. Reciprocal of GiveAction.\n\nRelated actions:\n\n* [[GiveAction]]: The reciprocal of TakeAction.\n* [[ReceiveAction]]: Unlike ReceiveAction, TakeAction implies that ownership has been transfered. + TattooParlor: URIRef # A tattoo parlor. + Taxi: URIRef # A taxi. + TaxiReservation: URIRef # A reservation for a taxi.\n\nNote: This type is for information about actual reservations, e.g. in confirmation emails or HTML pages with individual confirmations of reservations. For offers of tickets, use [[Offer]]. + TaxiService: URIRef # A service for a vehicle for hire with a driver for local travel. Fares are usually calculated based on distance traveled. + TaxiStand: URIRef # A taxi stand. + TaxiVehicleUsage: URIRef # Indicates the usage of the car as a taxi. + Taxon: URIRef # A set of organisms asserted to represent a natural cohesive biological unit. + TechArticle: URIRef # A technical article - Example: How-to (task) topics, step-by-step, procedural troubleshooting, specifications, etc. + TelevisionChannel: URIRef # A unique instance of a television BroadcastService on a CableOrSatelliteService lineup. + TelevisionStation: URIRef # A television station. + TennisComplex: URIRef # A tennis complex. + Terminated: URIRef # Terminated. + Text: URIRef # Data type: Text. + TextDigitalDocument: URIRef # A file composed primarily of text. + TheaterEvent: URIRef # Event type: Theater performance. + TheaterGroup: URIRef # A theater group or company, for example, the Royal Shakespeare Company or Druid Theatre. + Therapeutic: URIRef # A medical device used for therapeutic purposes. + TherapeuticProcedure: URIRef # A medical procedure intended primarily for therapeutic purposes, aimed at improving a health condition. + Thesis: URIRef # A thesis or dissertation document submitted in support of candidature for an academic degree or professional qualification. + Thing: URIRef # The most generic type of item. + Throat: URIRef # Throat assessment with clinical examination. + Thursday: URIRef # The day of the week between Wednesday and Friday. + Ticket: URIRef # Used to describe a ticket to an event, a flight, a bus ride, etc. + TieAction: URIRef # The act of reaching a draw in a competitive activity. + Time: URIRef # A point in time recurring on multiple days in the form hh:mm:ss[Z|(+|-)hh:mm] (see [XML schema for details](http://www.w3.org/TR/xmlschema-2/#time)). + TipAction: URIRef # The act of giving money voluntarily to a beneficiary in recognition of services rendered. + TireShop: URIRef # A tire shop. + TollFree: URIRef # The associated telephone number is toll free. + TouristAttraction: URIRef # A tourist attraction. In principle any Thing can be a [[TouristAttraction]], from a [[Mountain]] and [[LandmarksOrHistoricalBuildings]] to a [[LocalBusiness]]. This Type can be used on its own to describe a general [[TouristAttraction]], or be used as an [[additionalType]] to add tourist attraction properties to any other type. (See examples below) + TouristDestination: URIRef # A tourist destination. In principle any [[Place]] can be a [[TouristDestination]] from a [[City]], Region or [[Country]] to an [[AmusementPark]] or [[Hotel]]. This Type can be used on its own to describe a general [[TouristDestination]], or be used as an [[additionalType]] to add tourist relevant properties to any other [[Place]]. A [[TouristDestination]] is defined as a [[Place]] that contains, or is colocated with, one or more [[TouristAttraction]]s, often linked by a similar theme or interest to a particular [[touristType]]. The [UNWTO](http://www2.unwto.org/) defines Destination (main destination of a tourism trip) as the place visited that is central to the decision to take the trip. (See examples below). + TouristInformationCenter: URIRef # A tourist information center. + TouristTrip: URIRef # A tourist trip. A created itinerary of visits to one or more places of interest ([[TouristAttraction]]/[[TouristDestination]]) often linked by a similar theme, geographic area, or interest to a particular [[touristType]]. The [UNWTO](http://www2.unwto.org/) defines tourism trip as the Trip taken by visitors. (See examples below). + Toxicologic: URIRef # A specific branch of medical science that is concerned with poisons, their nature, effects and detection and involved in the treatment of poisoning. + ToyStore: URIRef # A toy store. + TrackAction: URIRef # An agent tracks an object for updates.\n\nRelated actions:\n\n* [[FollowAction]]: Unlike FollowAction, TrackAction refers to the interest on the location of innanimates objects.\n* [[SubscribeAction]]: Unlike SubscribeAction, TrackAction refers to the interest on the location of innanimate objects. + TradeAction: URIRef # The act of participating in an exchange of goods and services for monetary compensation. An agent trades an object, product or service with a participant in exchange for a one time or periodic payment. + TraditionalChinese: URIRef # A system of medicine based on common theoretical concepts that originated in China and evolved over thousands of years, that uses herbs, acupuncture, exercise, massage, dietary therapy, and other methods to treat a wide range of conditions. + TrainReservation: URIRef # A reservation for train travel.\n\nNote: This type is for information about actual reservations, e.g. in confirmation emails or HTML pages with individual confirmations of reservations. For offers of tickets, use [[Offer]]. + TrainStation: URIRef # A train station. + TrainTrip: URIRef # A trip on a commercial train line. + TransferAction: URIRef # The act of transferring/moving (abstract or concrete) animate or inanimate objects from one place to another. + TransformedContent: URIRef # Content coded 'transformed content' in a [[MediaReview]], considered in the context of how it was published or shared. For a [[VideoObject]] to be 'transformed content': or all of the video has been manipulated to transform the footage itself. This category includes using tools like the Adobe Suite to change the speed of the video, add or remove visual elements or dub audio. Deepfakes are also a subset of transformation. For an [[ImageObject]] to be transformed content': Adding or deleting visual elements to give the image a different meaning with the intention to mislead. For an [[ImageObject]] with embedded text to be 'transformed content': Adding or deleting visual elements to give the image a different meaning with the intention to mislead. For an [[AudioObject]] to be 'transformed content': Part or all of the audio has been manipulated to alter the words or sounds, or the audio has been synthetically generated, such as to create a sound-alike voice. + TransitMap: URIRef # A transit map. + TravelAction: URIRef # The act of traveling from an fromLocation to a destination by a specified mode of transport, optionally with participants. + TravelAgency: URIRef # A travel agency. + TreatmentIndication: ( + URIRef # An indication for treating an underlying condition, symptom, etc. + ) + TreatmentsHealthAspect: URIRef # Treatments or related therapies for a Topic. + Trip: URIRef # A trip or journey. An itinerary of visits to one or more places. + TripleBlindedTrial: URIRef # A trial design in which neither the researcher, the person administering the therapy nor the patient knows the details of the treatment the patient was randomly assigned to. + # True: URIRef # The boolean value true. + Tuesday: URIRef # The day of the week between Monday and Wednesday. + TypeAndQuantityNode: URIRef # A structured value indicating the quantity, unit of measurement, and business function of goods included in a bundle offer. + TypesHealthAspect: URIRef # Categorization and other types related to a topic. + UKNonprofitType: URIRef # UKNonprofitType: Non-profit organization type originating from the United Kingdom. + UKTrust: URIRef # UKTrust: Non-profit type referring to a UK trust. + URL: URIRef # Data type: URL. + USNonprofitType: URIRef # USNonprofitType: Non-profit organization type originating from the United States. + Ultrasound: URIRef # Ultrasound imaging. + UnRegisterAction: URIRef # The act of un-registering from a service.\n\nRelated actions:\n\n* [[RegisterAction]]: antonym of UnRegisterAction.\n* [[LeaveAction]]: Unlike LeaveAction, UnRegisterAction implies that you are unregistering from a service you werer previously registered, rather than leaving a team/group of people. + UnemploymentSupport: ( + URIRef # UnemploymentSupport: this is a benefit for unemployment support. + ) + UnincorporatedAssociationCharity: URIRef # UnincorporatedAssociationCharity: Non-profit type referring to a charitable company that is not incorporated (UK). + UnitPriceSpecification: URIRef # The price asked for a given offer by the respective organization or person. + UnofficialLegalValue: URIRef # Indicates that a document has no particular or special standing (e.g. a republication of a law by a private publisher). + UpdateAction: ( + URIRef # The act of managing by changing/editing the state of the object. + ) + Urologic: URIRef # A specific branch of medical science that is concerned with the diagnosis and treatment of diseases pertaining to the urinary tract and the urogenital system. + UsageOrScheduleHealthAspect: ( + URIRef # Content about how, when, frequency and dosage of a topic. + ) + UseAction: URIRef # The act of applying an object to its intended purpose. + UsedCondition: URIRef # Indicates that the item is used. + UserBlocks: URIRef # UserInteraction and its subtypes is an old way of talking about users interacting with pages. It is generally better to use [[Action]]-based vocabulary, alongside types such as [[Comment]]. + UserCheckins: URIRef # UserInteraction and its subtypes is an old way of talking about users interacting with pages. It is generally better to use [[Action]]-based vocabulary, alongside types such as [[Comment]]. + UserComments: URIRef # UserInteraction and its subtypes is an old way of talking about users interacting with pages. It is generally better to use [[Action]]-based vocabulary, alongside types such as [[Comment]]. + UserDownloads: URIRef # UserInteraction and its subtypes is an old way of talking about users interacting with pages. It is generally better to use [[Action]]-based vocabulary, alongside types such as [[Comment]]. + UserInteraction: URIRef # UserInteraction and its subtypes is an old way of talking about users interacting with pages. It is generally better to use [[Action]]-based vocabulary, alongside types such as [[Comment]]. + UserLikes: URIRef # UserInteraction and its subtypes is an old way of talking about users interacting with pages. It is generally better to use [[Action]]-based vocabulary, alongside types such as [[Comment]]. + UserPageVisits: URIRef # UserInteraction and its subtypes is an old way of talking about users interacting with pages. It is generally better to use [[Action]]-based vocabulary, alongside types such as [[Comment]]. + UserPlays: URIRef # UserInteraction and its subtypes is an old way of talking about users interacting with pages. It is generally better to use [[Action]]-based vocabulary, alongside types such as [[Comment]]. + UserPlusOnes: URIRef # UserInteraction and its subtypes is an old way of talking about users interacting with pages. It is generally better to use [[Action]]-based vocabulary, alongside types such as [[Comment]]. + UserReview: URIRef # A review created by an end-user (e.g. consumer, purchaser, attendee etc.), in contrast with [[CriticReview]]. + UserTweets: URIRef # UserInteraction and its subtypes is an old way of talking about users interacting with pages. It is generally better to use [[Action]]-based vocabulary, alongside types such as [[Comment]]. + VeganDiet: URIRef # A diet exclusive of all animal products. + VegetarianDiet: URIRef # A diet exclusive of animal meat. + Vehicle: URIRef # A vehicle is a device that is designed or used to transport people or cargo over land, water, air, or through space. + Vein: URIRef # A type of blood vessel that specifically carries blood to the heart. + VenueMap: URIRef # A venue map (e.g. for malls, auditoriums, museums, etc.). + Vessel: URIRef # A component of the human body circulatory system comprised of an intricate network of hollow tubes that transport blood throughout the entire body. + VeterinaryCare: URIRef # A vet's office. + VideoGallery: URIRef # Web page type: Video gallery page. + VideoGame: URIRef # A video game is an electronic game that involves human interaction with a user interface to generate visual feedback on a video device. + VideoGameClip: URIRef # A short segment/part of a video game. + VideoGameSeries: URIRef # A video game series. + VideoObject: URIRef # A video file. + VideoObjectSnapshot: URIRef # A specific and exact (byte-for-byte) version of a [[VideoObject]]. Two byte-for-byte identical files, for the purposes of this type, considered identical. If they have different embedded metadata the files will differ. Different external facts about the files, e.g. creator or dateCreated that aren't represented in their actual content, do not affect this notion of identity. + ViewAction: URIRef # The act of consuming static visual content. + VinylFormat: URIRef # VinylFormat. + VirtualLocation: URIRef # An online or virtual location for attending events. For example, one may attend an online seminar or educational event. While a virtual location may be used as the location of an event, virtual locations should not be confused with physical locations in the real world. + Virus: URIRef # Pathogenic virus that causes viral infection. + VisualArtsEvent: URIRef # Event type: Visual arts event. + VisualArtwork: URIRef # A work of art that is primarily visual in character. + VitalSign: URIRef # Vital signs are measures of various physiological functions in order to assess the most basic body functions. + Volcano: URIRef # A volcano, like Fuji san. + VoteAction: URIRef # The act of expressing a preference from a fixed/finite/structured set of choices/options. + WPAdBlock: URIRef # An advertising section of the page. + WPFooter: URIRef # The footer section of the page. + WPHeader: URIRef # The header section of the page. + WPSideBar: URIRef # A sidebar section of the page. + WantAction: URIRef # The act of expressing a desire about the object. An agent wants an object. + WarrantyPromise: URIRef # A structured value representing the duration and scope of services that will be provided to a customer free of charge in case of a defect or malfunction of a product. + WarrantyScope: URIRef # A range of of services that will be provided to a customer free of charge in case of a defect or malfunction of a product.\n\nCommonly used values:\n\n* http://purl.org/goodrelations/v1#Labor-BringIn\n* http://purl.org/goodrelations/v1#PartsAndLabor-BringIn\n* http://purl.org/goodrelations/v1#PartsAndLabor-PickUp + WatchAction: URIRef # The act of consuming dynamic/moving visual content. + Waterfall: URIRef # A waterfall, like Niagara. + WearAction: URIRef # The act of dressing oneself in clothing. + WearableMeasurementBack: ( + URIRef # Measurement of the back section, for example of a jacket + ) + WearableMeasurementChestOrBust: ( + URIRef # Measurement of the chest/bust section, for example of a suit + ) + WearableMeasurementCollar: ( + URIRef # Measurement of the collar, for example of a shirt + ) + WearableMeasurementCup: URIRef # Measurement of the cup, for example of a bra + WearableMeasurementHeight: ( + URIRef # Measurement of the height, for example the heel height of a shoe + ) + WearableMeasurementHips: ( + URIRef # Measurement of the hip section, for example of a skirt + ) + WearableMeasurementInseam: URIRef # Measurement of the inseam, for example of pants + WearableMeasurementLength: URIRef # Represents the length, for example of a dress + WearableMeasurementOutsideLeg: ( + URIRef # Measurement of the outside leg, for example of pants + ) + WearableMeasurementSleeve: ( + URIRef # Measurement of the sleeve length, for example of a shirt + ) + WearableMeasurementTypeEnumeration: ( + URIRef # Enumerates common types of measurement for wearables products. + ) + WearableMeasurementWaist: ( + URIRef # Measurement of the waist section, for example of pants + ) + WearableMeasurementWidth: URIRef # Measurement of the width, for example of shoes + WearableSizeGroupBig: URIRef # Size group "Big" for wearables. + WearableSizeGroupBoys: URIRef # Size group "Boys" for wearables. + WearableSizeGroupEnumeration: URIRef # Enumerates common size groups (also known as "size types") for wearable products. + WearableSizeGroupExtraShort: URIRef # Size group "Extra Short" for wearables. + WearableSizeGroupExtraTall: URIRef # Size group "Extra Tall" for wearables. + WearableSizeGroupGirls: URIRef # Size group "Girls" for wearables. + WearableSizeGroupHusky: URIRef # Size group "Husky" (or "Stocky") for wearables. + WearableSizeGroupInfants: URIRef # Size group "Infants" for wearables. + WearableSizeGroupJuniors: URIRef # Size group "Juniors" for wearables. + WearableSizeGroupMaternity: URIRef # Size group "Maternity" for wearables. + WearableSizeGroupMens: URIRef # Size group "Mens" for wearables. + WearableSizeGroupMisses: ( + URIRef # Size group "Misses" (also known as "Missy") for wearables. + ) + WearableSizeGroupPetite: URIRef # Size group "Petite" for wearables. + WearableSizeGroupPlus: URIRef # Size group "Plus" for wearables. + WearableSizeGroupRegular: URIRef # Size group "Regular" for wearables. + WearableSizeGroupShort: URIRef # Size group "Short" for wearables. + WearableSizeGroupTall: URIRef # Size group "Tall" for wearables. + WearableSizeGroupWomens: URIRef # Size group "Womens" for wearables. + WearableSizeSystemAU: URIRef # Australian size system for wearables. + WearableSizeSystemBR: URIRef # Brazilian size system for wearables. + WearableSizeSystemCN: URIRef # Chinese size system for wearables. + WearableSizeSystemContinental: URIRef # Continental size system for wearables. + WearableSizeSystemDE: URIRef # German size system for wearables. + WearableSizeSystemEN13402: ( + URIRef # EN 13402 (joint European standard for size labelling of clothes). + ) + WearableSizeSystemEnumeration: ( + URIRef # Enumerates common size systems specific for wearable products + ) + WearableSizeSystemEurope: URIRef # European size system for wearables. + WearableSizeSystemFR: URIRef # French size system for wearables. + WearableSizeSystemGS1: URIRef # GS1 (formerly NRF) size system for wearables. + WearableSizeSystemIT: URIRef # Italian size system for wearables. + WearableSizeSystemJP: URIRef # Japanese size system for wearables. + WearableSizeSystemMX: URIRef # Mexican size system for wearables. + WearableSizeSystemUK: URIRef # United Kingdom size system for wearables. + WearableSizeSystemUS: URIRef # United States size system for wearables. + WebAPI: URIRef # An application programming interface accessible over Web/Internet technologies. + WebApplication: URIRef # Web applications. + WebContent: URIRef # WebContent is a type representing all [[WebPage]], [[WebSite]] and [[WebPageElement]] content. It is sometimes the case that detailed distinctions between Web pages, sites and their parts is not always important or obvious. The [[WebContent]] type makes it easier to describe Web-addressable content without requiring such distinctions to always be stated. (The intent is that the existing types [[WebPage]], [[WebSite]] and [[WebPageElement]] will eventually be declared as subtypes of [[WebContent]]). + WebPage: URIRef # A web page. Every web page is implicitly assumed to be declared to be of type WebPage, so the various properties about that webpage, such as breadcrumb may be used. We recommend explicit declaration if these properties are specified, but if they are found outside of an itemscope, they will be assumed to be about the page. + WebPageElement: URIRef # A web page element, like a table or an image. + WebSite: URIRef # A WebSite is a set of related web pages and other items typically served from a single web domain and accessible via URLs. + Wednesday: URIRef # The day of the week between Tuesday and Thursday. + WesternConventional: URIRef # The conventional Western system of medicine, that aims to apply the best available evidence gained from the scientific method to clinical decision making. Also known as conventional or Western medicine. + Wholesale: ( + URIRef # The drug's cost represents the wholesale acquisition cost of the drug. + ) + WholesaleStore: URIRef # A wholesale store. + WinAction: URIRef # The act of achieving victory in a competitive activity. + Winery: URIRef # A winery. + Withdrawn: URIRef # Withdrawn. + WorkBasedProgram: URIRef # A program with both an educational and employment component. Typically based at a workplace and structured around work-based learning, with the aim of instilling competencies related to an occupation. WorkBasedProgram is used to distinguish programs such as apprenticeships from school, college or other classroom based educational programs. + WorkersUnion: URIRef # A Workers Union (also known as a Labor Union, Labour Union, or Trade Union) is an organization that promotes the interests of its worker members by collectively bargaining with management, organizing, and political lobbying. + WriteAction: URIRef # The act of authoring written creative content. + WritePermission: URIRef # Permission to write or edit the document. + XPathType: URIRef # Text representing an XPath (typically but not necessarily version 1.0). + XRay: URIRef # X-ray imaging. + ZoneBoardingPolicy: URIRef # The airline boards by zones of the plane. + Zoo: URIRef # A zoo. + about: URIRef # The subject matter of the content. + abridged: URIRef # Indicates whether the book is an abridged edition. + abstract: ( + URIRef # An abstract is a short description that summarizes a [[CreativeWork]]. + ) + accelerationTime: URIRef # The time needed to accelerate the vehicle from a given start velocity to a given target velocity.\n\nTypical unit code(s): SEC for seconds\n\n* Note: There are unfortunately no standard unit codes for seconds/0..100 km/h or seconds/0..60 mph. Simply use "SEC" for seconds and indicate the velocities in the [[name]] of the [[QuantitativeValue]], or use [[valueReference]] with a [[QuantitativeValue]] of 0..60 mph or 0..100 km/h to specify the reference speeds. + acceptedAnswer: URIRef # The answer(s) that has been accepted as best, typically on a Question/Answer site. Sites vary in their selection mechanisms, e.g. drawing on community opinion and/or the view of the Question author. + acceptedOffer: URIRef # The offer(s) -- e.g., product, quantity and price combinations -- included in the order. + acceptedPaymentMethod: ( + URIRef # The payment method(s) accepted by seller for this offer. + ) + acceptsReservations: URIRef # Indicates whether a FoodEstablishment accepts reservations. Values can be Boolean, an URL at which reservations can be made or (for backwards compatibility) the strings ```Yes``` or ```No```. + accessCode: URIRef # Password, PIN, or access code needed for delivery (e.g. from a locker). + accessMode: URIRef # The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Expected values include: auditory, tactile, textual, visual, colorDependent, chartOnVisual, chemOnVisual, diagramOnVisual, mathOnVisual, musicOnVisual, textOnVisual. + accessModeSufficient: URIRef # A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Expected values include: auditory, tactile, textual, visual. + accessibilityAPI: URIRef # Indicates that the resource is compatible with the referenced accessibility API ([WebSchemas wiki lists possible values](http://www.w3.org/wiki/WebSchemas/Accessibility)). + accessibilityControl: URIRef # Identifies input methods that are sufficient to fully control the described resource ([WebSchemas wiki lists possible values](http://www.w3.org/wiki/WebSchemas/Accessibility)). + accessibilityFeature: URIRef # Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility ([WebSchemas wiki lists possible values](http://www.w3.org/wiki/WebSchemas/Accessibility)). + accessibilityHazard: URIRef # A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3 ([WebSchemas wiki lists possible values](http://www.w3.org/wiki/WebSchemas/Accessibility)). + accessibilitySummary: URIRef # A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed." + accommodationCategory: URIRef # Category of an [[Accommodation]], following real estate conventions e.g. RESO (see [PropertySubType](https://ddwiki.reso.org/display/DDW17/PropertySubType+Field), and [PropertyType](https://ddwiki.reso.org/display/DDW17/PropertyType+Field) fields for suggested values). + accommodationFloorPlan: URIRef # A floorplan of some [[Accommodation]]. + accountId: URIRef # The identifier for the account the payment will be applied to. + accountMinimumInflow: URIRef # A minimum amount that has to be paid in every month. + accountOverdraftLimit: URIRef # An overdraft is an extension of credit from a lending institution when an account reaches zero. An overdraft allows the individual to continue withdrawing money even if the account has no funds in it. Basically the bank allows people to borrow a set amount of money. + accountablePerson: ( + URIRef # Specifies the Person that is legally accountable for the CreativeWork. + ) + acquireLicensePage: URIRef # Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item. + acquiredFrom: ( + URIRef # The organization or person from which the product was acquired. + ) + acrissCode: URIRef # The ACRISS Car Classification Code is a code used by many car rental companies, for classifying vehicles. ACRISS stands for Association of Car Rental Industry Systems and Standards. + actionAccessibilityRequirement: URIRef # A set of requirements that a must be fulfilled in order to perform an Action. If more than one value is specied, fulfilling one set of requirements will allow the Action to be performed. + actionApplication: URIRef # An application that can complete the request. + actionOption: ( + URIRef # A sub property of object. The options subject to this action. + ) + actionPlatform: URIRef # The high level platform(s) where the Action can be performed for the given URL. To specify a specific application or operating system instance, use actionApplication. + actionStatus: URIRef # Indicates the current disposition of the Action. + actionableFeedbackPolicy: URIRef # For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication. + activeIngredient: URIRef # An active ingredient, typically chemical compounds and/or biologic substances. + activityDuration: URIRef # Length of time to engage in the activity. + activityFrequency: URIRef # How often one should engage in the activity. + actor: URIRef # An actor, e.g. in tv, radio, movie, video games etc., or in an event. Actors can be associated with individual items or with a series, episode, clip. + actors: URIRef # An actor, e.g. in tv, radio, movie, video games etc. Actors can be associated with individual items or with a series, episode, clip. + addOn: URIRef # An additional offer that can only be obtained in combination with the first base offer (e.g. supplements and extensions that are available for a surcharge). + additionalName: ( + URIRef # An additional name for a Person, can be used for a middle name. + ) + additionalNumberOfGuests: URIRef # If responding yes, the number of guests who will attend in addition to the invitee. + additionalProperty: URIRef # A property-value pair representing an additional characteristics of the entitity, e.g. a product feature or another characteristic for which there is no matching property in schema.org.\n\nNote: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism. + additionalType: URIRef # An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally. + additionalVariable: URIRef # Any additional component of the exercise prescription that may need to be articulated to the patient. This may include the order of exercises, the number of repetitions of movement, quantitative distance, progressions over time, etc. + address: URIRef # Physical address of the item. + addressCountry: URIRef # The country. For example, USA. You can also provide the two-letter [ISO 3166-1 alpha-2 country code](http://en.wikipedia.org/wiki/ISO_3166-1). + addressLocality: URIRef # The locality in which the street address is, and which is in the region. For example, Mountain View. + addressRegion: URIRef # The region in which the locality is, and which is in the country. For example, California or another appropriate first-level [Administrative division](https://en.wikipedia.org/wiki/List_of_administrative_divisions_by_country) + administrationRoute: ( + URIRef # A route by which this drug may be administered, e.g. 'oral'. + ) + advanceBookingRequirement: URIRef # The amount of time that is required between accepting the offer and the actual usage of the resource or service. + adverseOutcome: URIRef # A possible complication and/or side effect of this therapy. If it is known that an adverse outcome is serious (resulting in death, disability, or permanent damage; requiring hospitalization; or is otherwise life-threatening or requires immediate medical attention), tag it as a seriouseAdverseOutcome instead. + affectedBy: URIRef # Drugs that affect the test's results. + affiliation: URIRef # An organization that this person is affiliated with. For example, a school/university, a club, or a team. + afterMedia: URIRef # A media object representing the circumstances after performing this direction. + agent: URIRef # The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote a book. + aggregateRating: URIRef # The overall rating, based on a collection of reviews or ratings, of the item. + aircraft: URIRef # The kind of aircraft (e.g., "Boeing 747"). + album: URIRef # A music album. + albumProductionType: URIRef # Classification of the album by it's type of content: soundtrack, live album, studio album, etc. + albumRelease: URIRef # A release of this album. + albumReleaseType: ( + URIRef # The kind of release which this album is: single, EP or album. + ) + albums: URIRef # A collection of music albums. + alcoholWarning: URIRef # Any precaution, guidance, contraindication, etc. related to consumption of alcohol while taking this drug. + algorithm: URIRef # The algorithm or rules to follow to compute the score. + alignmentType: URIRef # A category of alignment between the learning resource and the framework node. Recommended values include: 'requires', 'textComplexity', 'readingLevel', and 'educationalSubject'. + alternateName: URIRef # An alias for the item. + alternativeHeadline: URIRef # A secondary title of the CreativeWork. + alternativeOf: URIRef # Another gene which is a variation of this one. + alumni: URIRef # Alumni of an organization. + alumniOf: URIRef # An organization that the person is an alumni of. + amenityFeature: URIRef # An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs. + amount: URIRef # The amount of money. + amountOfThisGood: URIRef # The quantity of the goods included in the offer. + announcementLocation: URIRef # Indicates a specific [[CivicStructure]] or [[LocalBusiness]] associated with the SpecialAnnouncement. For example, a specific testing facility or business with special opening hours. For a larger geographic region like a quarantine of an entire region, use [[spatialCoverage]]. + annualPercentageRate: URIRef # The annual rate that is charged for borrowing (or made by investing), expressed as a single percentage number that represents the actual yearly cost of funds over the term of a loan. This includes any fees or additional costs associated with the transaction. + answerCount: URIRef # The number of answers this question has received. + answerExplanation: URIRef # A step-by-step or full explanation about Answer. Can outline how this Answer was achieved or contain more broad clarification or statement about it. + antagonist: URIRef # The muscle whose action counteracts the specified muscle. + appearance: ( + URIRef # Indicates an occurence of a [[Claim]] in some [[CreativeWork]]. + ) + applicableLocation: URIRef # The location in which the status applies. + applicantLocationRequirements: URIRef # The location(s) applicants can apply from. This is usually used for telecommuting jobs where the applicant does not need to be in a physical office. Note: This should not be used for citizenship or work visa requirements. + application: URIRef # An application that can complete the request. + applicationCategory: ( + URIRef # Type of software application, e.g. 'Game, Multimedia'. + ) + applicationContact: ( + URIRef # Contact details for further information relevant to this job posting. + ) + applicationDeadline: URIRef # The date at which the program stops collecting applications for the next enrollment cycle. + applicationStartDate: URIRef # The date at which the program begins collecting applications for the next enrollment cycle. + applicationSubCategory: ( + URIRef # Subcategory of the application, e.g. 'Arcade Game'. + ) + applicationSuite: URIRef # The name of the application suite to which the application belongs (e.g. Excel belongs to Office). + appliesToDeliveryMethod: URIRef # The delivery method(s) to which the delivery charge or payment charge specification applies. + appliesToPaymentMethod: URIRef # The payment method(s) to which the payment charge specification applies. + archiveHeld: URIRef # Collection, [fonds](https://en.wikipedia.org/wiki/Fonds), or item held, kept or maintained by an [[ArchiveOrganization]]. + archivedAt: URIRef # Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content. + area: ( + URIRef # The area within which users can expect to reach the broadcast service. + ) + areaServed: ( + URIRef # The geographic area where a service or offered item is provided. + ) + arrivalAirport: URIRef # The airport where the flight terminates. + arrivalBoatTerminal: URIRef # The terminal or port from which the boat arrives. + arrivalBusStop: URIRef # The stop or station from which the bus arrives. + arrivalGate: URIRef # Identifier of the flight's arrival gate. + arrivalPlatform: URIRef # The platform where the train arrives. + arrivalStation: URIRef # The station where the train trip ends. + arrivalTerminal: URIRef # Identifier of the flight's arrival terminal. + arrivalTime: URIRef # The expected arrival time. + artEdition: URIRef # The number of copies when multiple copies of a piece of artwork are produced - e.g. for a limited edition of 20 prints, 'artEdition' refers to the total number of copies (in this example "20"). + artMedium: URIRef # The material used. (e.g. Oil, Watercolour, Acrylic, Linoprint, Marble, Cyanotype, Digital, Lithograph, DryPoint, Intaglio, Pastel, Woodcut, Pencil, Mixed Media, etc.) + arterialBranch: URIRef # The branches that comprise the arterial structure. + artform: URIRef # e.g. Painting, Drawing, Sculpture, Print, Photograph, Assemblage, Collage, etc. + articleBody: URIRef # The actual body of the article. + articleSection: URIRef # Articles may belong to one or more 'sections' in a magazine or newspaper, such as Sports, Lifestyle, etc. + artist: URIRef # The primary artist for a work in a medium other than pencils or digital line art--for example, if the primary artwork is done in watercolors or digital paints. + artworkSurface: URIRef # The supporting materials for the artwork, e.g. Canvas, Paper, Wood, Board, etc. + aspect: URIRef # An aspect of medical practice that is considered on the page, such as 'diagnosis', 'treatment', 'causes', 'prognosis', 'etiology', 'epidemiology', etc. + assembly: URIRef # Library file name e.g., mscorlib.dll, system.web.dll. + assemblyVersion: ( + URIRef # Associated product/technology version. e.g., .NET Framework 4.5. + ) + assesses: URIRef # The item being described is intended to assess the competency or learning outcome defined by the referenced term. + associatedAnatomy: URIRef # The anatomy of the underlying organ system or structures associated with this entity. + associatedArticle: URIRef # A NewsArticle associated with the Media Object. + associatedClaimReview: URIRef # An associated [[ClaimReview]], related by specific common content, topic or claim. The expectation is that this property would be most typically used in cases where a single activity is conducting both claim reviews and media reviews, in which case [[relatedMediaReview]] would commonly be used on a [[ClaimReview]], while [[relatedClaimReview]] would be used on [[MediaReview]]. + associatedDisease: URIRef # Disease associated to this BioChemEntity. Such disease can be a MedicalCondition or a URL. If you want to add an evidence supporting the association, please use PropertyValue. + associatedMedia: URIRef # A media object that encodes this CreativeWork. This property is a synonym for encoding. + associatedMediaReview: URIRef # An associated [[MediaReview]], related by specific common content, topic or claim. The expectation is that this property would be most typically used in cases where a single activity is conducting both claim reviews and media reviews, in which case [[relatedMediaReview]] would commonly be used on a [[ClaimReview]], while [[relatedClaimReview]] would be used on [[MediaReview]]. + associatedPathophysiology: URIRef # If applicable, a description of the pathophysiology associated with the anatomical system, including potential abnormal changes in the mechanical, physical, and biochemical functions of the system. + associatedReview: URIRef # An associated [[Review]]. + athlete: URIRef # A person that acts as performing member of a sports team; a player as opposed to a coach. + attendee: URIRef # A person or organization attending the event. + attendees: URIRef # A person attending the event. + audience: ( + URIRef # An intended audience, i.e. a group for whom something was created. + ) + audienceType: URIRef # The target group associated with a given audience (e.g. veterans, car owners, musicians, etc.). + audio: URIRef # An embedded audio object. + authenticator: URIRef # The Organization responsible for authenticating the user's subscription. For example, many media apps require a cable/satellite provider to authenticate your subscription before playing media. + author: URIRef # The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably. + availability: URIRef # The availability of this item—for example In stock, Out of stock, Pre-order, etc. + availabilityEnds: URIRef # The end of the availability of the product or service included in the offer. + availabilityStarts: URIRef # The beginning of the availability of the product or service included in the offer. + availableAtOrFrom: URIRef # The place(s) from which the offer can be obtained (e.g. store locations). + availableChannel: URIRef # A means of accessing the service (e.g. a phone bank, a web site, a location, etc.). + availableDeliveryMethod: URIRef # The delivery method(s) available for this offer. + availableFrom: ( + URIRef # When the item is available for pickup from the store, locker, etc. + ) + availableIn: URIRef # The location in which the strength is available. + availableLanguage: URIRef # A language someone may use with or at the item, service or place. Please use one of the language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also [[inLanguage]] + availableOnDevice: URIRef # Device required to run the application. Used in cases where a specific make/model is required to run the application. + availableService: URIRef # A medical service available from this provider. + availableStrength: URIRef # An available dosage strength for the drug. + availableTest: URIRef # A diagnostic test or procedure offered by this lab. + availableThrough: ( + URIRef # After this date, the item will no longer be available for pickup. + ) + award: URIRef # An award won by or for this item. + awards: URIRef # Awards won by or for this item. + awayTeam: URIRef # The away team in a sports event. + backstory: URIRef # For an [[Article]], typically a [[NewsArticle]], the backstory property provides a textual summary giving a brief explanation of why and how an article was created. In a journalistic setting this could include information about reporting process, methods, interviews, data sources, etc. + bankAccountType: URIRef # The type of a bank account. + baseSalary: ( + URIRef # The base salary of the job or of an employee in an EmployeeRole. + ) + bccRecipient: ( + URIRef # A sub property of recipient. The recipient blind copied on a message. + ) + bed: URIRef # The type of bed or beds included in the accommodation. For the single case of just one bed of a certain type, you use bed directly with a text. If you want to indicate the quantity of a certain kind of bed, use an instance of BedDetails. For more detailed information, use the amenityFeature property. + beforeMedia: URIRef # A media object representing the circumstances before performing this direction. + beneficiaryBank: URIRef # A bank or bank’s branch, financial institution or international financial institution operating the beneficiary’s bank account or releasing funds for the beneficiary. + benefits: URIRef # Description of benefits associated with the job. + benefitsSummaryUrl: URIRef # The URL that goes directly to the summary of benefits and coverage for the specific standard plan or plan variation. + bestRating: URIRef # The highest value allowed in this rating system. If bestRating is omitted, 5 is assumed. + billingAddress: URIRef # The billing address for the order. + billingDuration: URIRef # Specifies for how long this price (or price component) will be billed. Can be used, for example, to model the contractual duration of a subscription or payment plan. Type can be either a Duration or a Number (in which case the unit of measurement, for example month, is specified by the unitCode property). + billingIncrement: URIRef # This property specifies the minimal quantity and rounding increment that will be the basis for the billing. The unit of measurement is specified by the unitCode property. + billingPeriod: URIRef # The time interval used to compute the invoice. + billingStart: URIRef # Specifies after how much time this price (or price component) becomes valid and billing starts. Can be used, for example, to model a price increase after the first year of a subscription. The unit of measurement is specified by the unitCode property. + bioChemInteraction: ( + URIRef # A BioChemEntity that is known to interact with this item. + ) + bioChemSimilarity: URIRef # A similar BioChemEntity, e.g., obtained by fingerprint similarity algorithms. + biologicalRole: ( + URIRef # A role played by the BioChemEntity within a biological context. + ) + biomechnicalClass: URIRef # The biomechanical properties of the bone. + birthDate: URIRef # Date of birth. + birthPlace: URIRef # The place where the person was born. + bitrate: URIRef # The bitrate of the media object. + blogPost: URIRef # A posting that is part of this blog. + blogPosts: URIRef # Indicates a post that is part of a [[Blog]]. Note that historically, what we term a "Blog" was once known as a "weblog", and that what we term a "BlogPosting" is now often colloquially referred to as a "blog". + bloodSupply: ( + URIRef # The blood vessel that carries blood from the heart to the muscle. + ) + boardingGroup: ( + URIRef # The airline-specific indicator of boarding order / preference. + ) + boardingPolicy: URIRef # The type of boarding policy used by the airline (e.g. zone-based or group-based). + bodyLocation: URIRef # Location in the body of the anatomical structure. + bodyType: URIRef # Indicates the design and body style of the vehicle (e.g. station wagon, hatchback, etc.). + bookEdition: URIRef # The edition of the book. + bookFormat: URIRef # The format of the book. + bookingAgent: URIRef # 'bookingAgent' is an out-dated term indicating a 'broker' that serves as a booking agent. + bookingTime: URIRef # The date and time the reservation was booked. + borrower: URIRef # A sub property of participant. The person that borrows the object being lent. + box: URIRef # A box is the area enclosed by the rectangle formed by two points. The first point is the lower corner, the second point is the upper corner. A box is expressed as two points separated by a space character. + branch: URIRef # The branches that delineate from the nerve bundle. Not to be confused with [[branchOf]]. + branchCode: URIRef # A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs.\n\nFor example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch. + branchOf: URIRef # The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical)[[branch]]. + brand: URIRef # The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person. + breadcrumb: URIRef # A set of links that can help a user understand and navigate a website hierarchy. + breastfeedingWarning: URIRef # Any precaution, guidance, contraindication, etc. related to this drug's use by breastfeeding mothers. + broadcastAffiliateOf: ( + URIRef # The media network(s) whose content is broadcast on this station. + ) + broadcastChannelId: URIRef # The unique address by which the BroadcastService can be identified in a provider lineup. In US, this is typically a number. + broadcastDisplayName: URIRef # The name displayed in the channel guide. For many US affiliates, it is the network name. + broadcastFrequency: URIRef # The frequency used for over-the-air broadcasts. Numeric values or simple ranges e.g. 87-99. In addition a shortcut idiom is supported for frequences of AM and FM radio channels, e.g. "87 FM". + broadcastFrequencyValue: URIRef # The frequency in MHz for a particular broadcast. + broadcastOfEvent: ( + URIRef # The event being broadcast such as a sporting event or awards ceremony. + ) + broadcastServiceTier: URIRef # The type of service required to have access to the channel (e.g. Standard or Premium). + broadcastSignalModulation: URIRef # The modulation (e.g. FM, AM, etc) used by a particular broadcast service. + broadcastSubChannel: URIRef # The subchannel used for the broadcast. + broadcastTimezone: URIRef # The timezone in [ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601) for which the service bases its broadcasts + broadcaster: URIRef # The organization owning or operating the broadcast service. + broker: URIRef # An entity that arranges for an exchange between a buyer and a seller. In most cases a broker never acquires or releases ownership of a product or service involved in an exchange. If it is not clear whether an entity is a broker, seller, or buyer, the latter two terms are preferred. + browserRequirements: URIRef # Specifies browser requirements in human-readable text. For example, 'requires HTML5 support'. + busName: URIRef # The name of the bus (e.g. Bolt Express). + busNumber: URIRef # The unique identifier for the bus. + businessDays: URIRef # Days of the week when the merchant typically operates, indicated via opening hours markup. + businessFunction: URIRef # The business function (e.g. sell, lease, repair, dispose) of the offer or component of a bundle (TypeAndQuantityNode). The default is http://purl.org/goodrelations/v1#Sell. + buyer: URIRef # A sub property of participant. The participant/person/organization that bought the object. + byArtist: URIRef # The artist that performed this album or recording. + byDay: URIRef # Defines the day(s) of the week on which a recurring [[Event]] takes place. May be specified using either [[DayOfWeek]], or alternatively [[Text]] conforming to iCal's syntax for byDay recurrence rules. + byMonth: URIRef # Defines the month(s) of the year on which a recurring [[Event]] takes place. Specified as an [[Integer]] between 1-12. January is 1. + byMonthDay: URIRef # Defines the day(s) of the month on which a recurring [[Event]] takes place. Specified as an [[Integer]] between 1-31. + byMonthWeek: URIRef # Defines the week(s) of the month on which a recurring Event takes place. Specified as an Integer between 1-5. For clarity, byMonthWeek is best used in conjunction with byDay to indicate concepts like the first and third Mondays of a month. + callSign: URIRef # A [callsign](https://en.wikipedia.org/wiki/Call_sign), as used in broadcasting and radio communications to identify people, radio and TV stations, or vehicles. + calories: URIRef # The number of calories. + candidate: URIRef # A sub property of object. The candidate subject of this action. + caption: URIRef # The caption for this object. For downloadable machine formats (closed caption, subtitles etc.) use MediaObject and indicate the [[encodingFormat]]. + carbohydrateContent: URIRef # The number of grams of carbohydrates. + cargoVolume: URIRef # The available volume for cargo or luggage. For automobiles, this is usually the trunk volume.\n\nTypical unit code(s): LTR for liters, FTQ for cubic foot/feet\n\nNote: You can use [[minValue]] and [[maxValue]] to indicate ranges. + carrier: URIRef # 'carrier' is an out-dated term indicating the 'provider' for parcel delivery and flights. + carrierRequirements: URIRef # Specifies specific carrier(s) requirements for the application (e.g. an application may only work on a specific carrier network). + cashBack: URIRef # A cardholder benefit that pays the cardholder a small percentage of their net expenditures. + catalog: URIRef # A data catalog which contains this dataset. + catalogNumber: URIRef # The catalog number for the release. + category: URIRef # A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy. + causeOf: URIRef # The condition, complication, symptom, sign, etc. caused. + ccRecipient: ( + URIRef # A sub property of recipient. The recipient copied on a message. + ) + character: URIRef # Fictional person connected with a creative work. + characterAttribute: URIRef # A piece of data that represents a particular aspect of a fictional character (skill, power, character points, advantage, disadvantage). + characterName: URIRef # The name of a character played in some acting or performing role, i.e. in a PerformanceRole. + cheatCode: URIRef # Cheat codes to the game. + checkinTime: URIRef # The earliest someone may check into a lodging establishment. + checkoutTime: URIRef # The latest someone may check out of a lodging establishment. + chemicalComposition: URIRef # The chemical composition describes the identity and relative ratio of the chemical elements that make up the substance. + chemicalRole: ( + URIRef # A role played by the BioChemEntity within a chemical context. + ) + childMaxAge: URIRef # Maximal age of the child. + childMinAge: URIRef # Minimal age of the child. + childTaxon: URIRef # Closest child taxa of the taxon in question. + children: URIRef # A child of the person. + cholesterolContent: URIRef # The number of milligrams of cholesterol. + circle: URIRef # A circle is the circular region of a specified radius centered at a specified latitude and longitude. A circle is expressed as a pair followed by a radius in meters. + citation: URIRef # A citation or reference to another creative work, such as another publication, web page, scholarly article, etc. + claimInterpreter: URIRef # For a [[Claim]] interpreted from [[MediaObject]] content sed to indicate a claim contained, implied or refined from the content of a [[MediaObject]]. + claimReviewed: ( + URIRef # A short summary of the specific claims reviewed in a ClaimReview. + ) + clincalPharmacology: URIRef # Description of the absorption and elimination of drugs, including their concentration (pharmacokinetics, pK) and biological effects (pharmacodynamics, pD). + clinicalPharmacology: URIRef # Description of the absorption and elimination of drugs, including their concentration (pharmacokinetics, pK) and biological effects (pharmacodynamics, pD). + clipNumber: URIRef # Position of the clip within an ordered group of clips. + closes: URIRef # The closing hour of the place or service on the given day(s) of the week. + coach: URIRef # A person that acts in a coaching role for a sports team. + code: URIRef # A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc. + codeRepository: URIRef # Link to the repository where the un-compiled, human readable code and related code is located (SVN, github, CodePlex). + codeSampleType: URIRef # What type of code sample: full (compile ready) solution, code snippet, inline code, scripts, template. + codeValue: URIRef # A short textual code that uniquely identifies the value. + codingSystem: URIRef # The coding system, e.g. 'ICD-10'. + colleague: URIRef # A colleague of the person. + colleagues: URIRef # A colleague of the person. + collection: URIRef # A sub property of object. The collection target of the action. + collectionSize: URIRef # The number of items in the [[Collection]]. + color: URIRef # The color of the product. + colorist: URIRef # The individual who adds color to inked drawings. + comment: URIRef # Comments, typically from users. + commentCount: URIRef # The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere. + commentText: URIRef # The text of the UserComment. + commentTime: URIRef # The time at which the UserComment was made. + competencyRequired: URIRef # Knowledge, skill, ability or personal attribute that must be demonstrated by a person or other entity in order to do something such as earn an Educational Occupational Credential or understand a LearningResource. + competitor: URIRef # A competitor in a sports event. + composer: URIRef # The person or organization who wrote a composition, or who is the composer of a work performed at some event. + comprisedOf: URIRef # Specifying something physically contained by something else. Typically used here for the underlying anatomical structures, such as organs, that comprise the anatomical system. + conditionsOfAccess: URIRef # Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language.\n\nFor example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ". + confirmationNumber: ( + URIRef # A number that confirms the given order or payment has been received. + ) + connectedTo: ( + URIRef # Other anatomical structures to which this structure is connected. + ) + constrainingProperty: URIRef # Indicates a property used as a constraint to define a [[StatisticalPopulation]] with respect to the set of entities corresponding to an indicated type (via [[populationType]]). + contactOption: URIRef # An option available on this contact point (e.g. a toll-free number or support for hearing-impaired callers). + contactPoint: URIRef # A contact point for a person or organization. + contactPoints: URIRef # A contact point for a person or organization. + contactType: URIRef # A person or organization can have different contact points, for different purposes. For example, a sales contact point, a PR contact point and so on. This property is used to specify the kind of contact point. + contactlessPayment: URIRef # A secure method for consumers to purchase products or services via debit, credit or smartcards by using RFID or NFC technology. + containedIn: URIRef # The basic containment relation between a place and one that contains it. + containedInPlace: URIRef # The basic containment relation between a place and one that contains it. + containsPlace: URIRef # The basic containment relation between a place and another that it contains. + containsSeason: URIRef # A season that is part of the media series. + contentLocation: URIRef # The location depicted or described in the content. For example, the location in a photograph or painting. + contentRating: ( + URIRef # Official rating of a piece of content—for example,'MPAA PG-13'. + ) + contentReferenceTime: URIRef # The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event. + contentSize: URIRef # File size in (mega/kilo) bytes. + contentType: URIRef # The supported content type(s) for an EntryPoint response. + contentUrl: URIRef # Actual bytes of the media object, for example the image file or video file. + contraindication: URIRef # A contraindication for this therapy. + contributor: URIRef # A secondary contributor to the CreativeWork or Event. + cookTime: URIRef # The time it takes to actually cook the dish, in [ISO 8601 duration format](http://en.wikipedia.org/wiki/ISO_8601). + cookingMethod: URIRef # The method of cooking, such as Frying, Steaming, ... + copyrightHolder: ( + URIRef # The party holding the legal copyright to the CreativeWork. + ) + copyrightNotice: URIRef # Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work. + copyrightYear: URIRef # The year during which the claimed copyright for the CreativeWork was first asserted. + correction: URIRef # Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document. + correctionsPolicy: URIRef # For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors. + costCategory: URIRef # The category of cost, such as wholesale, retail, reimbursement cap, etc. + costCurrency: URIRef # The currency (in 3-letter of the drug cost. See: http://en.wikipedia.org/wiki/ISO_4217. + costOrigin: URIRef # Additional details to capture the origin of the cost data. For example, 'Medicare Part B'. + costPerUnit: URIRef # The cost per unit of the drug. + countriesNotSupported: URIRef # Countries for which the application is not supported. You can also provide the two-letter ISO 3166-1 alpha-2 country code. + countriesSupported: URIRef # Countries for which the application is supported. You can also provide the two-letter ISO 3166-1 alpha-2 country code. + countryOfAssembly: URIRef # The place where the product was assembled. + countryOfLastProcessing: URIRef # The place where the item (typically [[Product]]) was last processed and tested before importation. + countryOfOrigin: URIRef # The country of origin of something, including products as well as creative works such as movie and TV content. In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable. In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here. + course: ( + URIRef # A sub property of location. The course where this action was taken. + ) + courseCode: URIRef # The identifier for the [[Course]] used by the course [[provider]] (e.g. CS101 or 6.001). + courseMode: URIRef # The medium or means of delivery of the course instance or the mode of study, either as a text label (e.g. "online", "onsite" or "blended"; "synchronous" or "asynchronous"; "full-time" or "part-time") or as a URL reference to a term from a controlled vocabulary (e.g. https://ceds.ed.gov/element/001311#Asynchronous ). + coursePrerequisites: URIRef # Requirements for taking the Course. May be completion of another [[Course]] or a textual description like "permission of instructor". Requirements may be a pre-requisite competency, referenced using [[AlignmentObject]]. + courseWorkload: URIRef # The amount of work expected of students taking the course, often provided as a figure per week or per month, and may be broken down by type. For example, "2 hours of lectures, 1 hour of lab work and 3 hours of independent study per week". + coverageEndTime: URIRef # The time when the live blog will stop covering the Event. Note that coverage may continue after the Event concludes. + coverageStartTime: URIRef # The time when the live blog will begin covering the Event. Note that coverage may begin before the Event's start time. The LiveBlogPosting may also be created before coverage begins. + creativeWorkStatus: URIRef # The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle. + creator: URIRef # The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork. + credentialCategory: URIRef # The category or type of credential being described, for example "degree”, “certificate”, “badge”, or more specific term. + creditText: URIRef # Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work. + creditedTo: URIRef # The group the release is credited to if different than the byArtist. For example, Red and Blue is credited to "Stefani Germanotta Band", but by Lady Gaga. + cssSelector: URIRef # A CSS selector, e.g. of a [[SpeakableSpecification]] or [[WebPageElement]]. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element". + currenciesAccepted: URIRef # The currency accepted.\n\nUse standard formats: [ISO 4217 currency format](http://en.wikipedia.org/wiki/ISO_4217) e.g. "USD"; [Ticker symbol](https://en.wikipedia.org/wiki/List_of_cryptocurrencies) for cryptocurrencies e.g. "BTC"; well known names for [Local Exchange Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR". + currency: URIRef # The currency in which the monetary amount is expressed.\n\nUse standard formats: [ISO 4217 currency format](http://en.wikipedia.org/wiki/ISO_4217) e.g. "USD"; [Ticker symbol](https://en.wikipedia.org/wiki/List_of_cryptocurrencies) for cryptocurrencies e.g. "BTC"; well known names for [Local Exchange Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR". + currentExchangeRate: URIRef # The current price of a currency. + customer: URIRef # Party placing the order or paying the invoice. + customerRemorseReturnFees: URIRef # The type of return fees if the product is returned due to customer remorse. + customerRemorseReturnLabelSource: URIRef # The method (from an enumeration) by which the customer obtains a return shipping label for a product returned due to customer remorse. + customerRemorseReturnShippingFeesAmount: URIRef # The amount of shipping costs if a product is returned due to customer remorse. Applicable when property [[customerRemorseReturnFees]] equals [[ReturnShippingFees]]. + cutoffTime: URIRef # Order cutoff time allows merchants to describe the time after which they will no longer process orders received on that day. For orders processed after cutoff time, one day gets added to the delivery time estimate. This property is expected to be most typically used via the [[ShippingRateSettings]] publication pattern. The time is indicated using the ISO-8601 Time format, e.g. "23:30:00-05:00" would represent 6:30 pm Eastern Standard Time (EST) which is 5 hours behind Coordinated Universal Time (UTC). + cvdCollectionDate: ( + URIRef # collectiondate - Date for which patient counts are reported. + ) + cvdFacilityCounty: URIRef # Name of the County of the NHSN facility that this data record applies to. Use [[cvdFacilityId]] to identify the facility. To provide other details, [[healthcareReportingData]] can be used on a [[Hospital]] entry. + cvdFacilityId: URIRef # Identifier of the NHSN facility that this data record applies to. Use [[cvdFacilityCounty]] to indicate the county. To provide other details, [[healthcareReportingData]] can be used on a [[Hospital]] entry. + cvdNumBeds: URIRef # numbeds - HOSPITAL INPATIENT BEDS: Inpatient beds, including all staffed, licensed, and overflow (surge) beds used for inpatients. + cvdNumBedsOcc: URIRef # numbedsocc - HOSPITAL INPATIENT BED OCCUPANCY: Total number of staffed inpatient beds that are occupied. + cvdNumC19Died: URIRef # numc19died - DEATHS: Patients with suspected or confirmed COVID-19 who died in the hospital, ED, or any overflow location. + cvdNumC19HOPats: URIRef # numc19hopats - HOSPITAL ONSET: Patients hospitalized in an NHSN inpatient care location with onset of suspected or confirmed COVID-19 14 or more days after hospitalization. + cvdNumC19HospPats: URIRef # numc19hosppats - HOSPITALIZED: Patients currently hospitalized in an inpatient care location who have suspected or confirmed COVID-19. + cvdNumC19MechVentPats: URIRef # numc19mechventpats - HOSPITALIZED and VENTILATED: Patients hospitalized in an NHSN inpatient care location who have suspected or confirmed COVID-19 and are on a mechanical ventilator. + cvdNumC19OFMechVentPats: URIRef # numc19ofmechventpats - ED/OVERFLOW and VENTILATED: Patients with suspected or confirmed COVID-19 who are in the ED or any overflow location awaiting an inpatient bed and on a mechanical ventilator. + cvdNumC19OverflowPats: URIRef # numc19overflowpats - ED/OVERFLOW: Patients with suspected or confirmed COVID-19 who are in the ED or any overflow location awaiting an inpatient bed. + cvdNumICUBeds: URIRef # numicubeds - ICU BEDS: Total number of staffed inpatient intensive care unit (ICU) beds. + cvdNumICUBedsOcc: URIRef # numicubedsocc - ICU BED OCCUPANCY: Total number of staffed inpatient ICU beds that are occupied. + cvdNumTotBeds: URIRef # numtotbeds - ALL HOSPITAL BEDS: Total number of all Inpatient and outpatient beds, including all staffed,ICU, licensed, and overflow (surge) beds used for inpatients or outpatients. + cvdNumVent: URIRef # numvent - MECHANICAL VENTILATORS: Total number of ventilators available. + cvdNumVentUse: URIRef # numventuse - MECHANICAL VENTILATORS IN USE: Total number of ventilators in use. + dataFeedElement: ( + URIRef # An item within in a data feed. Data feeds may have many elements. + ) + dataset: URIRef # A dataset contained in this catalog. + datasetTimeInterval: URIRef # The range of temporal applicability of a dataset, e.g. for a 2011 census dataset, the year 2011 (in ISO 8601 time interval format). + dateCreated: URIRef # The date on which the CreativeWork was created or the item was added to a DataFeed. + dateDeleted: URIRef # The datetime the item was removed from the DataFeed. + dateIssued: URIRef # The date the ticket was issued. + dateModified: URIRef # The date on which the CreativeWork was most recently modified or when the item's entry was modified within a DataFeed. + datePosted: URIRef # Publication date of an online listing. + datePublished: URIRef # Date of first broadcast/publication. + dateRead: URIRef # The date/time at which the message has been read by the recipient if a single recipient exists. + dateReceived: ( + URIRef # The date/time the message was received if a single recipient exists. + ) + dateSent: URIRef # The date/time at which the message was sent. + dateVehicleFirstRegistered: URIRef # The date of the first registration of the vehicle with the respective public authorities. + dateline: URIRef # A [dateline](https://en.wikipedia.org/wiki/Dateline) is a brief piece of text included in news articles that describes where and when the story was written or filed though the date is often omitted. Sometimes only a placename is provided. Structured representations of dateline-related information can also be expressed more explicitly using [[locationCreated]] (which represents where a work was created e.g. where a news report was written). For location depicted or described in the content, use [[contentLocation]]. Dateline summaries are oriented more towards human readers than towards automated processing, and can vary substantially. Some examples: "BEIRUT, Lebanon, June 2.", "Paris, France", "December 19, 2017 11:43AM Reporting from Washington", "Beijing/Moscow", "QUEZON CITY, Philippines". + dayOfWeek: URIRef # The day of the week for which these opening hours are valid. + deathDate: URIRef # Date of death. + deathPlace: URIRef # The place where the person died. + defaultValue: URIRef # The default value of the input. For properties that expect a literal, the default is a literal value, for properties that expect an object, it's an ID reference to one of the current values. + deliveryAddress: URIRef # Destination address. + deliveryLeadTime: URIRef # The typical delay between the receipt of the order and the goods either leaving the warehouse or being prepared for pickup, in case the delivery method is on site pickup. + deliveryMethod: URIRef # A sub property of instrument. The method of delivery. + deliveryStatus: URIRef # New entry added as the package passes through each leg of its journey (from shipment to final delivery). + deliveryTime: URIRef # The total delay between the receipt of the order and the goods reaching the final customer. + department: URIRef # A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe. + departureAirport: URIRef # The airport where the flight originates. + departureBoatTerminal: URIRef # The terminal or port from which the boat departs. + departureBusStop: URIRef # The stop or station from which the bus departs. + departureGate: URIRef # Identifier of the flight's departure gate. + departurePlatform: URIRef # The platform from which the train departs. + departureStation: URIRef # The station from which the train departs. + departureTerminal: URIRef # Identifier of the flight's departure terminal. + departureTime: URIRef # The expected departure time. + dependencies: URIRef # Prerequisites needed to fulfill steps in article. + depth: URIRef # The depth of the item. + description: URIRef # A description of the item. + device: URIRef # Device required to run the application. Used in cases where a specific make/model is required to run the application. + diagnosis: URIRef # One or more alternative conditions considered in the differential diagnosis process as output of a diagnosis process. + diagram: URIRef # An image containing a diagram that illustrates the structure and/or its component substructures and/or connections with other structures. + diet: URIRef # A sub property of instrument. The diet used in this action. + dietFeatures: URIRef # Nutritional information specific to the dietary plan. May include dietary recommendations on what foods to avoid, what foods to consume, and specific alterations/deviations from the USDA or other regulatory body's approved dietary guidelines. + differentialDiagnosis: URIRef # One of a set of differential diagnoses for the condition. Specifically, a closely-related or competing diagnosis typically considered later in the cognitive process whereby this medical condition is distinguished from others most likely responsible for a similar collection of signs and symptoms to reach the most parsimonious diagnosis or diagnoses in a patient. + directApply: URIRef # Indicates whether an [[url]] that is associated with a [[JobPosting]] enables direct application for the job, via the posting website. A job posting is considered to have directApply of [[True]] if an application process for the specified job can be directly initiated via the url(s) given (noting that e.g. multiple internet domains might nevertheless be involved at an implementation level). A value of [[False]] is appropriate if there is no clear path to applying directly online for the specified job, navigating directly from the JobPosting url(s) supplied. + director: URIRef # A director of e.g. tv, radio, movie, video gaming etc. content, or of an event. Directors can be associated with individual items or with a series, episode, clip. + directors: URIRef # A director of e.g. tv, radio, movie, video games etc. content. Directors can be associated with individual items or with a series, episode, clip. + disambiguatingDescription: URIRef # A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation. + discount: URIRef # Any discount applied (to an Order). + discountCode: URIRef # Code used to redeem a discount. + discountCurrency: URIRef # The currency of the discount.\n\nUse standard formats: [ISO 4217 currency format](http://en.wikipedia.org/wiki/ISO_4217) e.g. "USD"; [Ticker symbol](https://en.wikipedia.org/wiki/List_of_cryptocurrencies) for cryptocurrencies e.g. "BTC"; well known names for [Local Exchange Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR". + discusses: URIRef # Specifies the CreativeWork associated with the UserComment. + discussionUrl: ( + URIRef # A link to the page containing the comments of the CreativeWork. + ) + diseasePreventionInfo: URIRef # Information about disease prevention. + diseaseSpreadStatistics: URIRef # Statistical information about the spread of a disease, either as [[WebContent]], or described directly as a [[Dataset]], or the specific [[Observation]]s in the dataset. When a [[WebContent]] URL is provided, the page indicated might also contain more such markup. + dissolutionDate: URIRef # The date that this organization was dissolved. + distance: URIRef # The distance travelled, e.g. exercising or travelling. + distinguishingSign: URIRef # One of a set of signs and symptoms that can be used to distinguish this diagnosis from others in the differential diagnosis. + distribution: URIRef # A downloadable form of this dataset, at a specific location, in a specific format. + diversityPolicy: URIRef # Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data. + diversityStaffingReport: URIRef # For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported. + documentation: ( + URIRef # Further documentation describing the Web API in more detail. + ) + doesNotShip: URIRef # Indicates when shipping to a particular [[shippingDestination]] is not available. + domainIncludes: URIRef # Relates a property to a class that is (one of) the type(s) the property is expected to be used on. + domiciledMortgage: URIRef # Whether borrower is a resident of the jurisdiction where the property is located. + doorTime: URIRef # The time admission will commence. + dosageForm: URIRef # A dosage form in which this drug/supplement is available, e.g. 'tablet', 'suspension', 'injection'. + doseSchedule: URIRef # A dosing schedule for the drug for a given population, either observed, recommended, or maximum dose based on the type used. + doseUnit: URIRef # The unit of the dose, e.g. 'mg'. + doseValue: URIRef # The value of the dose, e.g. 500. + downPayment: URIRef # a type of payment made in cash during the onset of the purchase of an expensive good/service. The payment typically represents only a percentage of the full purchase price. + downloadUrl: URIRef # If the file can be downloaded, URL to download the binary. + downvoteCount: URIRef # The number of downvotes this question, answer or comment has received from the community. + drainsTo: URIRef # The vasculature that the vein drains into. + driveWheelConfiguration: URIRef # The drive wheel configuration, i.e. which roadwheels will receive torque from the vehicle's engine via the drivetrain. + dropoffLocation: URIRef # Where a rental car can be dropped off. + dropoffTime: URIRef # When a rental car can be dropped off. + drug: URIRef # Specifying a drug or medicine used in a medication procedure. + drugClass: URIRef # The class of drug this belongs to (e.g., statins). + drugUnit: URIRef # The unit in which the drug is measured, e.g. '5 mg tablet'. + duns: URIRef # The Dun & Bradstreet DUNS number for identifying an organization or business person. + duplicateTherapy: URIRef # A therapy that duplicates or overlaps this one. + duration: URIRef # The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601). + durationOfWarranty: URIRef # The duration of the warranty promise. Common unitCode values are ANN for year, MON for months, or DAY for days. + duringMedia: URIRef # A media object representing the circumstances while performing this direction. + earlyPrepaymentPenalty: URIRef # The amount to be paid as a penalty in the event of early payment of the loan. + editEIDR: URIRef # An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television. For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J", has several edits e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3". Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. + editor: URIRef # Specifies the Person who edited the CreativeWork. + eduQuestionType: URIRef # For questions that are part of learning resources (e.g. Quiz), eduQuestionType indicates the format of question being given. Example: "Multiple choice", "Open ended", "Flashcard". + educationRequirements: ( + URIRef # Educational background needed for the position or Occupation. + ) + educationalAlignment: URIRef # An alignment to an established educational framework. This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency. + educationalCredentialAwarded: URIRef # A description of the qualification, award, certificate, diploma or other educational credential awarded as a consequence of successful completion of this course or program. + educationalFramework: ( + URIRef # The framework to which the resource being described is aligned. + ) + educationalLevel: URIRef # The level in terms of progression through an educational or training context. Examples of educational levels include 'beginner', 'intermediate' or 'advanced', and formal sets of level indicators. + educationalProgramMode: URIRef # Similar to courseMode, The medium or means of delivery of the program as a whole. The value may either be a text label (e.g. "online", "onsite" or "blended"; "synchronous" or "asynchronous"; "full-time" or "part-time") or a URL reference to a term from a controlled vocabulary (e.g. https://ceds.ed.gov/element/001311#Asynchronous ). + educationalRole: URIRef # An educationalRole of an EducationalAudience. + educationalUse: URIRef # The purpose of a work in the context of education; for example, 'assignment', 'group work'. + elevation: URIRef # The elevation of a location ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)). Values may be of the form 'NUMBER UNIT_OF_MEASUREMENT' (e.g., '1,000 m', '3,200 ft') while numbers alone should be assumed to be a value in meters. + eligibilityToWorkRequirement: URIRef # The legal requirements such as citizenship, visa and other documentation required for an applicant to this job. + eligibleCustomerType: ( + URIRef # The type(s) of customers for which the given offer is valid. + ) + eligibleDuration: URIRef # The duration for which the given offer is valid. + eligibleQuantity: URIRef # The interval and unit of measurement of ordering quantities for which the offer or price specification is valid. This allows e.g. specifying that a certain freight charge is valid only for a certain quantity. + eligibleRegion: URIRef # The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is valid.\n\nSee also [[ineligibleRegion]]. + eligibleTransactionVolume: URIRef # The transaction volume, in a monetary unit, for which the offer or price specification is valid, e.g. for indicating a minimal purchasing volume, to express free shipping above a certain order volume, or to limit the acceptance of credit cards to purchases to a certain minimal amount. + email: URIRef # Email address. + embedUrl: URIRef # A URL pointing to a player for a specific video. In general, this is the information in the ```src``` element of an ```embed``` tag and should not be the same as the content of the ```loc``` tag. + embeddedTextCaption: URIRef # Represents textual captioning from a [[MediaObject]], e.g. text of a 'meme'. + emissionsCO2: URIRef # The CO2 emissions in g/km. When used in combination with a QuantitativeValue, put "g/km" into the unitText property of that value, since there is no UN/CEFACT Common Code for "g/km". + employee: URIRef # Someone working for this organization. + employees: URIRef # People working for this organization. + employerOverview: URIRef # A description of the employer, career opportunities and work environment for this position. + employmentType: URIRef # Type of employment (e.g. full-time, part-time, contract, temporary, seasonal, internship). + employmentUnit: URIRef # Indicates the department, unit and/or facility where the employee reports and/or in which the job is to be performed. + encodesBioChemEntity: URIRef # Another BioChemEntity encoded by this one. + encodesCreativeWork: URIRef # The CreativeWork encoded by this media object. + encoding: URIRef # A media object that encodes this CreativeWork. This property is a synonym for associatedMedia. + encodingFormat: URIRef # Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.). In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information. Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry. + encodingType: URIRef # The supported encoding type(s) for an EntryPoint request. + encodings: URIRef # A media object that encodes this CreativeWork. + endDate: URIRef # The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)). + endOffset: URIRef # The end time of the clip expressed as the number of seconds from the beginning of the work. + endTime: URIRef # The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to *December*. For media, including audio and video, it's the time offset of the end of a clip within a larger file.\n\nNote that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions. + endorsee: URIRef # A sub property of participant. The person/organization being supported. + endorsers: URIRef # People or organizations that endorse the plan. + energyEfficiencyScaleMax: URIRef # Specifies the most energy efficient class on the regulated EU energy consumption scale for the product category a product belongs to. For example, energy consumption for televisions placed on the market after January 1, 2020 is scaled from D to A+++. + energyEfficiencyScaleMin: URIRef # Specifies the least energy efficient class on the regulated EU energy consumption scale for the product category a product belongs to. For example, energy consumption for televisions placed on the market after January 1, 2020 is scaled from D to A+++. + engineDisplacement: URIRef # The volume swept by all of the pistons inside the cylinders of an internal combustion engine in a single movement. \n\nTypical unit code(s): CMQ for cubic centimeter, LTR for liters, INQ for cubic inches\n* Note 1: You can link to information about how the given value has been determined using the [[valueReference]] property.\n* Note 2: You can use [[minValue]] and [[maxValue]] to indicate ranges. + enginePower: URIRef # The power of the vehicle's engine. Typical unit code(s): KWT for kilowatt, BHP for brake horsepower, N12 for metric horsepower (PS, with 1 PS = 735,49875 W)\n\n* Note 1: There are many different ways of measuring an engine's power. For an overview, see [http://en.wikipedia.org/wiki/Horsepower#Engine_power_test_codes](http://en.wikipedia.org/wiki/Horsepower#Engine_power_test_codes).\n* Note 2: You can link to information about how the given value has been determined using the [[valueReference]] property.\n* Note 3: You can use [[minValue]] and [[maxValue]] to indicate ranges. + engineType: URIRef # The type of engine or engines powering the vehicle. + entertainmentBusiness: URIRef # A sub property of location. The entertainment business where the action occurred. + epidemiology: URIRef # The characteristics of associated patients, such as age, gender, race etc. + episode: ( + URIRef # An episode of a tv, radio or game media within a series or season. + ) + episodeNumber: ( + URIRef # Position of the episode within an ordered group of episodes. + ) + episodes: URIRef # An episode of a TV/radio series or season. + equal: URIRef # This ordering relation for qualitative values indicates that the subject is equal to the object. + error: URIRef # For failed actions, more information on the cause of the failure. + estimatedCost: URIRef # The estimated cost of the supply or supplies consumed when performing instructions. + estimatedFlightDuration: URIRef # The estimated time the flight will take. + estimatedSalary: URIRef # An estimated salary for a job posting or occupation, based on a variety of variables including, but not limited to industry, job title, and location. Estimated salaries are often computed by outside organizations rather than the hiring organization, who may not have committed to the estimated value. + estimatesRiskOf: ( + URIRef # The condition, complication, or symptom whose risk is being estimated. + ) + ethicsPolicy: URIRef # Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization. + event: URIRef # Upcoming or past event associated with this place, organization, or action. + eventAttendanceMode: URIRef # The eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix. + eventSchedule: URIRef # Associates an [[Event]] with a [[Schedule]]. There are circumstances where it is preferable to share a schedule for a series of repeating events rather than data on the individual events themselves. For example, a website or application might prefer to publish a schedule for a weekly gym class rather than provide data on every event. A schedule could be processed by applications to add forthcoming events to a calendar. An [[Event]] that is associated with a [[Schedule]] using this property should not have [[startDate]] or [[endDate]] properties. These are instead defined within the associated [[Schedule]], this avoids any ambiguity for clients using the data. The property might have repeated values to specify different schedules, e.g. for different months or seasons. + eventStatus: URIRef # An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled. + events: ( + URIRef # Upcoming or past events associated with this place or organization. + ) + evidenceLevel: URIRef # Strength of evidence of the data used to formulate the guideline (enumerated). + evidenceOrigin: URIRef # Source of the data used to formulate the guidance, e.g. RCT, consensus opinion, etc. + exampleOfWork: URIRef # A creative work that this work is an example/instance/realization/derivation of. + exceptDate: URIRef # Defines a [[Date]] or [[DateTime]] during which a scheduled [[Event]] will not take place. The property allows exceptions to a [[Schedule]] to be specified. If an exception is specified as a [[DateTime]] then only the event that would have started at that specific date and time should be excluded from the schedule. If an exception is specified as a [[Date]] then any event that is scheduled for that 24 hour period should be excluded from the schedule. This allows a whole day to be excluded from the schedule without having to itemise every scheduled event. + exchangeRateSpread: URIRef # The difference between the price at which a broker or other intermediary buys and sells foreign currency. + executableLibraryName: ( + URIRef # Library file name e.g., mscorlib.dll, system.web.dll. + ) + exerciseCourse: ( + URIRef # A sub property of location. The course where this action was taken. + ) + exercisePlan: ( + URIRef # A sub property of instrument. The exercise plan used on this action. + ) + exerciseRelatedDiet: ( + URIRef # A sub property of instrument. The diet used in this action. + ) + exerciseType: URIRef # Type(s) of exercise or activity, such as strength training, flexibility training, aerobics, cardiac rehabilitation, etc. + exifData: URIRef # exif data for this object. + expectedArrivalFrom: URIRef # The earliest date the package may arrive. + expectedArrivalUntil: URIRef # The latest date the package may arrive. + expectedPrognosis: URIRef # The likely outcome in either the short term or long term of the medical condition. + expectsAcceptanceOf: URIRef # An Offer which must be accepted before the user can perform the Action. For example, the user may need to buy a movie before being able to watch it. + experienceInPlaceOfEducation: URIRef # Indicates whether a [[JobPosting]] will accept experience (as indicated by [[OccupationalExperienceRequirements]]) in place of its formal educational qualifications (as indicated by [[educationRequirements]]). If true, indicates that satisfying one of these requirements is sufficient. + experienceRequirements: URIRef # Description of skills and experience needed for the position or Occupation. + expertConsiderations: URIRef # Medical expert advice related to the plan. + expires: URIRef # Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date. + expressedIn: URIRef # Tissue, organ, biological sample, etc in which activity of this gene has been observed experimentally. For example brain, digestive system. + familyName: URIRef # Family name. In the U.S., the last name of a Person. + fatContent: URIRef # The number of grams of fat. + faxNumber: URIRef # The fax number. + featureList: URIRef # Features or modules provided by this application (and possibly required by other applications). + feesAndCommissionsSpecification: URIRef # Description of fees, commissions, and other terms applied either to a class of financial product, or by a financial service organization. + fiberContent: URIRef # The number of grams of fiber. + fileFormat: URIRef # Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, 'encoding' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry. + fileSize: URIRef # Size of the application / package (e.g. 18MB). In the absence of a unit (MB, KB etc.), KB will be assumed. + financialAidEligible: URIRef # A financial aid type or program which students may use to pay for tuition or fees associated with the program. + firstAppearance: URIRef # Indicates the first known occurence of a [[Claim]] in some [[CreativeWork]]. + firstPerformance: URIRef # The date and place the work was first performed. + flightDistance: URIRef # The distance of the flight. + flightNumber: URIRef # The unique identifier for a flight including the airline IATA code. For example, if describing United flight 110, where the IATA code for United is 'UA', the flightNumber is 'UA110'. + floorLevel: URIRef # The floor level for an [[Accommodation]] in a multi-storey building. Since counting systems [vary internationally](https://en.wikipedia.org/wiki/Storey#Consecutive_number_floor_designations), the local system should be used where possible. + floorLimit: URIRef # A floor limit is the amount of money above which credit card transactions must be authorized. + floorSize: URIRef # The size of the accommodation, e.g. in square meter or squarefoot. Typical unit code(s): MTK for square meter, FTK for square foot, or YDK for square yard + followee: ( + URIRef # A sub property of object. The person or organization being followed. + ) + follows: URIRef # The most generic uni-directional social relation. + followup: ( + URIRef # Typical or recommended followup care after the procedure is performed. + ) + foodEstablishment: URIRef # A sub property of location. The specific food establishment where the action occurred. + foodEvent: URIRef # A sub property of location. The specific food event where the action occurred. + foodWarning: URIRef # Any precaution, guidance, contraindication, etc. related to consumption of specific foods while taking this drug. + founder: URIRef # A person who founded this organization. + founders: URIRef # A person who founded this organization. + foundingDate: URIRef # The date that this organization was founded. + foundingLocation: URIRef # The place where the Organization was founded. + free: URIRef # A flag to signal that the item, event, or place is accessible for free. + freeShippingThreshold: URIRef # A monetary value above which (or equal to) the shipping rate becomes free. Intended to be used via an [[OfferShippingDetails]] with [[shippingSettingsLink]] matching this [[ShippingRateSettings]]. + frequency: URIRef # How often the dose is taken, e.g. 'daily'. + fromLocation: URIRef # A sub property of location. The original location of the object or the agent before the action. + fuelCapacity: URIRef # The capacity of the fuel tank or in the case of electric cars, the battery. If there are multiple components for storage, this should indicate the total of all storage of the same type.\n\nTypical unit code(s): LTR for liters, GLL of US gallons, GLI for UK / imperial gallons, AMH for ampere-hours (for electrical vehicles). + fuelConsumption: URIRef # The amount of fuel consumed for traveling a particular distance or temporal duration with the given vehicle (e.g. liters per 100 km).\n\n* Note 1: There are unfortunately no standard unit codes for liters per 100 km. Use [[unitText]] to indicate the unit of measurement, e.g. L/100 km.\n* Note 2: There are two ways of indicating the fuel consumption, [[fuelConsumption]] (e.g. 8 liters per 100 km) and [[fuelEfficiency]] (e.g. 30 miles per gallon). They are reciprocal.\n* Note 3: Often, the absolute value is useful only when related to driving speed ("at 80 km/h") or usage pattern ("city traffic"). You can use [[valueReference]] to link the value for the fuel consumption to another value. + fuelEfficiency: URIRef # The distance traveled per unit of fuel used; most commonly miles per gallon (mpg) or kilometers per liter (km/L).\n\n* Note 1: There are unfortunately no standard unit codes for miles per gallon or kilometers per liter. Use [[unitText]] to indicate the unit of measurement, e.g. mpg or km/L.\n* Note 2: There are two ways of indicating the fuel consumption, [[fuelConsumption]] (e.g. 8 liters per 100 km) and [[fuelEfficiency]] (e.g. 30 miles per gallon). They are reciprocal.\n* Note 3: Often, the absolute value is useful only when related to driving speed ("at 80 km/h") or usage pattern ("city traffic"). You can use [[valueReference]] to link the value for the fuel economy to another value. + fuelType: URIRef # The type of fuel suitable for the engine or engines of the vehicle. If the vehicle has only one engine, this property can be attached directly to the vehicle. + functionalClass: URIRef # The degree of mobility the joint allows. + fundedItem: URIRef # Indicates an item funded or sponsored through a [[Grant]]. + funder: URIRef # A person or organization that supports (sponsors) something through some kind of financial contribution. + game: URIRef # Video game which is played on this server. + gameItem: URIRef # An item is an object within the game world that can be collected by a player or, occasionally, a non-player character. + gameLocation: URIRef # Real or fictional location of the game (or part of game). + gamePlatform: URIRef # The electronic systems used to play video games. + gameServer: URIRef # The server on which it is possible to play the game. + gameTip: URIRef # Links to tips, tactics, etc. + gender: URIRef # Gender of something, typically a [[Person]], but possibly also fictional characters, animals, etc. While https://schema.org/Male and https://schema.org/Female may be used, text strings are also acceptable for people who do not identify as a binary gender. The [[gender]] property can also be used in an extended sense to cover e.g. the gender of sports teams. As with the gender of individuals, we do not try to enumerate all possibilities. A mixed-gender [[SportsTeam]] can be indicated with a text value of "Mixed". + genre: URIRef # Genre of the creative work, broadcast channel or group. + geo: URIRef # The geo coordinates of the place. + geoContains: URIRef # Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). + geoCoveredBy: URIRef # Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). + geoCovers: URIRef # Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). + geoCrosses: URIRef # Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). + geoDisjoint: URIRef # Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: they have no point in common. They form a set of disconnected geometries." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM)) + geoEquals: URIRef # Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship) + geoIntersects: URIRef # Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). + geoMidpoint: URIRef # Indicates the GeoCoordinates at the centre of a GeoShape e.g. GeoCircle. + geoOverlaps: URIRef # Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). + geoRadius: URIRef # Indicates the approximate radius of a GeoCircle (metres unless indicated otherwise via Distance notation). + geoTouches: URIRef # Represents spatial relations in which two geometries (or the places they represent) touch: they have at least one boundary point in common, but no interior points." (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) ) + geoWithin: URIRef # Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). + geographicArea: URIRef # The geographic area associated with the audience. + gettingTestedInfo: URIRef # Information about getting tested (for a [[MedicalCondition]]), e.g. in the context of a pandemic. + givenName: URIRef # Given name. In the U.S., the first name of a Person. + globalLocationNumber: URIRef # The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations. + governmentBenefitsInfo: URIRef # governmentBenefitsInfo provides information about government benefits associated with a SpecialAnnouncement. + gracePeriod: URIRef # The period of time after any due date that the borrower has to fulfil its obligations before a default (failure to pay) is deemed to have occurred. + grantee: URIRef # The person, organization, contact point, or audience that has been granted this permission. + greater: URIRef # This ordering relation for qualitative values indicates that the subject is greater than the object. + greaterOrEqual: URIRef # This ordering relation for qualitative values indicates that the subject is greater than or equal to the object. + gtin: URIRef # A Global Trade Item Number ([GTIN](https://www.gs1.org/standards/id-keys/gtin)). GTINs identify trade items, including products and services, using numeric identification codes. The [[gtin]] property generalizes the earlier [[gtin8]], [[gtin12]], [[gtin13]], and [[gtin14]] properties. The GS1 [digital link specifications](https://www.gs1.org/standards/Digital-Link/) express GTINs as URLs. A correct [[gtin]] value should be a valid GTIN, which means that it should be an all-numeric string of either 8, 12, 13 or 14 digits, or a "GS1 Digital Link" URL based on such a string. The numeric component should also have a [valid GS1 check digit](https://www.gs1.org/services/check-digit-calculator) and meet the other rules for valid GTINs. See also [GS1's GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) and [Wikipedia](https://en.wikipedia.org/wiki/Global_Trade_Item_Number) for more details. Left-padding of the gtin values is not required or encouraged. + gtin12: URIRef # The GTIN-12 code of the product, or the product to which the offer refers. The GTIN-12 is the 12-digit GS1 Identification Key composed of a U.P.C. Company Prefix, Item Reference, and Check Digit used to identify trade items. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details. + gtin13: URIRef # The GTIN-13 code of the product, or the product to which the offer refers. This is equivalent to 13-digit ISBN codes and EAN UCC-13. Former 12-digit UPC codes can be converted into a GTIN-13 code by simply adding a preceding zero. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details. + gtin14: URIRef # The GTIN-14 code of the product, or the product to which the offer refers. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details. + gtin8: URIRef # The GTIN-8 code of the product, or the product to which the offer refers. This code is also known as EAN/UCC-8 or 8-digit EAN. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details. + guideline: URIRef # A medical guideline related to this entity. + guidelineDate: URIRef # Date on which this guideline's recommendation was made. + guidelineSubject: URIRef # The medical conditions, treatments, etc. that are the subject of the guideline. + handlingTime: URIRef # The typical delay between the receipt of the order and the goods either leaving the warehouse or being prepared for pickup, in case the delivery method is on site pickup. Typical properties: minValue, maxValue, unitCode (d for DAY). This is by common convention assumed to mean business days (if a unitCode is used, coded as "d"), i.e. only counting days when the business normally operates. + hasBioChemEntityPart: URIRef # Indicates a BioChemEntity that (in some sense) has this BioChemEntity as a part. + hasBioPolymerSequence: URIRef # A symbolic representation of a BioChemEnity. For example, a nucleotide sequence of a Gene or an amino acid sequence of a Protein. + hasBroadcastChannel: URIRef # A broadcast channel of a broadcast service. + hasCategoryCode: URIRef # A Category code contained in this code set. + hasCourse: URIRef # A course or class that is one of the learning opportunities that constitute an educational / occupational program. No information is implied about whether the course is mandatory or optional; no guarantee is implied about whether the course will be available to everyone on the program. + hasCourseInstance: URIRef # An offering of the course at a specific time and place or through specific media or mode of study or to a specific section of students. + hasCredential: URIRef # A credential awarded to the Person or Organization. + hasDefinedTerm: URIRef # A Defined Term contained in this term set. + hasDeliveryMethod: URIRef # Method used for delivery or shipping. + hasDigitalDocumentPermission: URIRef # A permission related to the access to this document (e.g. permission to read or write an electronic document). For a public document, specify a grantee with an Audience with audienceType equal to "public". + hasDriveThroughService: URIRef # Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users. + hasEnergyConsumptionDetails: URIRef # Defines the energy efficiency Category (also known as "class" or "rating") for a product according to an international energy efficiency standard. + hasEnergyEfficiencyCategory: URIRef # Defines the energy efficiency Category (which could be either a rating out of range of values or a yes/no certification) for a product according to an international energy efficiency standard. + hasHealthAspect: URIRef # Indicates the aspect or aspects specifically addressed in some [[HealthTopicContent]]. For example, that the content is an overview, or that it talks about treatment, self-care, treatments or their side-effects. + hasMap: URIRef # A URL to a map of the place. + hasMeasurement: URIRef # A product measurement, for example the inseam of pants, the wheel size of a bicycle, or the gauge of a screw. Usually an exact measurement, but can also be a range of measurements for adjustable products, for example belts and ski bindings. + hasMenu: URIRef # Either the actual menu as a structured representation, as text, or a URL of the menu. + hasMenuItem: URIRef # A food or drink item contained in a menu or menu section. + hasMenuSection: URIRef # A subgrouping of the menu (by dishes, course, serving time period, etc.). + hasMerchantReturnPolicy: ( + URIRef # Specifies a MerchantReturnPolicy that may be applicable. + ) + hasMolecularFunction: URIRef # Molecular function performed by this BioChemEntity; please use PropertyValue if you want to include any evidence. + hasOccupation: URIRef # The Person's occupation. For past professions, use Role for expressing dates. + hasOfferCatalog: URIRef # Indicates an OfferCatalog listing for this Organization, Person, or Service. + hasPOS: URIRef # Points-of-Sales operated by the organization or person. + hasPart: URIRef # Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense). + hasRepresentation: URIRef # A common representation such as a protein sequence or chemical structure for this entity. For images use schema.org/image. + hasVariant: URIRef # Indicates a [[Product]] that is a member of this [[ProductGroup]] (or [[ProductModel]]). + headline: URIRef # Headline of the article. + healthCondition: URIRef # Specifying the health condition(s) of a patient, medical study, or other target audience. + healthPlanCoinsuranceOption: URIRef # Whether the coinsurance applies before or after deductible, etc. TODO: Is this a closed set? + healthPlanCoinsuranceRate: URIRef # Whether The rate of coinsurance expressed as a number between 0.0 and 1.0. + healthPlanCopay: URIRef # Whether The copay amount. + healthPlanCopayOption: URIRef # Whether the copay is before or after deductible, etc. TODO: Is this a closed set? + healthPlanCostSharing: URIRef # Whether The costs to the patient for services under this network or formulary. + healthPlanDrugOption: URIRef # TODO. + healthPlanDrugTier: ( + URIRef # The tier(s) of drugs offered by this formulary or insurance plan. + ) + healthPlanId: URIRef # The 14-character, HIOS-generated Plan ID number. (Plan IDs must be unique, even across different markets.) + healthPlanMarketingUrl: URIRef # The URL that goes directly to the plan brochure for the specific standard plan or plan variation. + healthPlanNetworkId: URIRef # Name or unique ID of network. (Networks are often reused across different insurance plans). + healthPlanNetworkTier: URIRef # The tier(s) for this network. + healthPlanPharmacyCategory: ( + URIRef # The category or type of pharmacy associated with this cost sharing. + ) + healthcareReportingData: URIRef # Indicates data describing a hospital, e.g. a CDC [[CDCPMDRecord]] or as some kind of [[Dataset]]. + height: URIRef # The height of the item. + highPrice: URIRef # The highest price of all offers available.\n\nUsage guidelines:\n\n* Use values from 0123456789 (Unicode 'DIGIT ZERO' (U+0030) to 'DIGIT NINE' (U+0039)) rather than superficially similiar Unicode symbols.\n* Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to indicate a decimal point. Avoid using these symbols as a readability separator. + hiringOrganization: URIRef # Organization offering the job position. + holdingArchive: URIRef # [[ArchiveOrganization]] that holds, keeps or maintains the [[ArchiveComponent]]. + homeLocation: URIRef # A contact location for a person's residence. + homeTeam: URIRef # The home team in a sports event. + honorificPrefix: ( + URIRef # An honorific prefix preceding a Person's name such as Dr/Mrs/Mr. + ) + honorificSuffix: ( + URIRef # An honorific suffix following a Person's name such as M.D. /PhD/MSCSW. + ) + hospitalAffiliation: ( + URIRef # A hospital with which the physician or office is affiliated. + ) + hostingOrganization: URIRef # The organization (airline, travelers' club, etc.) the membership is made with. + hoursAvailable: ( + URIRef # The hours during which this service or contact is available. + ) + howPerformed: URIRef # How the procedure is performed. + httpMethod: URIRef # An HTTP method that specifies the appropriate HTTP method for a request to an HTTP EntryPoint. Values are capitalized strings as used in HTTP. + iataCode: URIRef # IATA identifier for an airline or airport. + icaoCode: URIRef # ICAO identifier for an airport. + identifier: URIRef # The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details. + identifyingExam: URIRef # A physical examination that can identify this sign. + identifyingTest: URIRef # A diagnostic test that can identify this sign. + illustrator: URIRef # The illustrator of the book. + image: URIRef # An image of the item. This can be a [[URL]] or a fully described [[ImageObject]]. + imagingTechnique: URIRef # Imaging technique used. + inAlbum: URIRef # The album to which this recording belongs. + inBroadcastLineup: URIRef # The CableOrSatelliteService offering the channel. + inChI: URIRef # Non-proprietary identifier for molecular entity that can be used in printed and electronic data sources thus enabling easier linking of diverse data compilations. + inChIKey: URIRef # InChIKey is a hashed version of the full InChI (using the SHA-256 algorithm). + inCodeSet: URIRef # A [[CategoryCodeSet]] that contains this category code. + inDefinedTermSet: URIRef # A [[DefinedTermSet]] that contains this term. + inLanguage: URIRef # The language of the content or performance or used in an action. Please use one of the language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also [[availableLanguage]]. + inPlaylist: URIRef # The playlist to which this recording belongs. + inProductGroupWithID: URIRef # Indicates the [[productGroupID]] for a [[ProductGroup]] that this product [[isVariantOf]]. + inStoreReturnsOffered: URIRef # Are in-store returns offered? (for more advanced return methods use the [[returnMethod]] property) + inSupportOf: ( + URIRef # Qualification, candidature, degree, application that Thesis supports. + ) + incentiveCompensation: ( + URIRef # Description of bonus and commission compensation aspects of the job. + ) + incentives: ( + URIRef # Description of bonus and commission compensation aspects of the job. + ) + includedComposition: URIRef # Smaller compositions included in this work (e.g. a movement in a symphony). + includedDataCatalog: URIRef # A data catalog which contains this dataset (this property was previously 'catalog', preferred name is now 'includedInDataCatalog'). + includedInDataCatalog: URIRef # A data catalog which contains this dataset. + includedInHealthInsurancePlan: URIRef # The insurance plans that cover this drug. + includedRiskFactor: URIRef # A modifiable or non-modifiable risk factor included in the calculation, e.g. age, coexisting condition. + includesAttraction: URIRef # Attraction located at destination. + includesHealthPlanFormulary: URIRef # Formularies covered by this plan. + includesHealthPlanNetwork: URIRef # Networks covered by this plan. + includesObject: URIRef # This links to a node or nodes indicating the exact quantity of the products included in an [[Offer]] or [[ProductCollection]]. + increasesRiskOf: ( + URIRef # The condition, complication, etc. influenced by this factor. + ) + industry: URIRef # The industry associated with the job position. + ineligibleRegion: URIRef # The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is not valid, e.g. a region where the transaction is not allowed.\n\nSee also [[eligibleRegion]]. + infectiousAgent: ( + URIRef # The actual infectious agent, such as a specific bacterium. + ) + infectiousAgentClass: URIRef # The class of infectious agent (bacteria, prion, etc.) that causes the disease. + ingredients: ( + URIRef # A single ingredient used in the recipe, e.g. sugar, flour or garlic. + ) + inker: URIRef # The individual who traces over the pencil drawings in ink after pencils are complete. + insertion: URIRef # The place of attachment of a muscle, or what the muscle moves. + installUrl: URIRef # URL at which the app may be installed, if different from the URL of the item. + instructor: URIRef # A person assigned to instruct or provide instructional assistance for the [[CourseInstance]]. + instrument: URIRef # The object that helped the agent perform the action. e.g. John wrote a book with *a pen*. + intensity: URIRef # Quantitative measure gauging the degree of force involved in the exercise, for example, heartbeats per minute. May include the velocity of the movement. + interactingDrug: URIRef # Another drug that is known to interact with this drug in a way that impacts the effect of this drug or causes a risk to the patient. Note: disease interactions are typically captured as contraindications. + interactionCount: URIRef # This property is deprecated, alongside the UserInteraction types on which it depended. + interactionService: ( + URIRef # The WebSite or SoftwareApplication where the interactions took place. + ) + interactionStatistic: URIRef # The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used. + interactionType: URIRef # The Action representing the type of interaction. For up votes, +1s, etc. use [[LikeAction]]. For down votes use [[DislikeAction]]. Otherwise, use the most specific Action. + interactivityType: URIRef # The predominant mode of learning supported by the learning resource. Acceptable values are 'active', 'expositive', or 'mixed'. + interestRate: URIRef # The interest rate, charged or paid, applicable to the financial product. Note: This is different from the calculated annualPercentageRate. + interpretedAsClaim: URIRef # Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]]. + inventoryLevel: ( + URIRef # The current approximate inventory level for the item or items. + ) + inverseOf: URIRef # Relates a property to a property that is its inverse. Inverse properties relate the same pairs of items to each other, but in reversed direction. For example, the 'alumni' and 'alumniOf' properties are inverseOf each other. Some properties don't have explicit inverses; in these situations RDFa and JSON-LD syntax for reverse properties can be used. + isAcceptingNewPatients: URIRef # Whether the provider is accepting new patients. + isAccessibleForFree: URIRef # A flag to signal that the item, event, or place is accessible for free. + isAccessoryOrSparePartFor: URIRef # A pointer to another product (or multiple products) for which this product is an accessory or spare part. + isAvailableGenerically: ( + URIRef # True if the drug is available in a generic form (regardless of name). + ) + isBasedOn: URIRef # A resource from which this work is derived or from which it is a modification or adaption. + isBasedOnUrl: URIRef # A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html. + isConsumableFor: URIRef # A pointer to another product (or multiple products) for which this product is a consumable. + isEncodedByBioChemEntity: URIRef # Another BioChemEntity encoding by this one. + isFamilyFriendly: URIRef # Indicates whether this content is family friendly. + isGift: URIRef # Was the offer accepted as a gift for someone other than the buyer. + isInvolvedInBiologicalProcess: URIRef # Biological process this BioChemEntity is involved in; please use PropertyValue if you want to include any evidence. + isLiveBroadcast: URIRef # True if the broadcast is of a live event. + isLocatedInSubcellularLocation: URIRef # Subcellular location where this BioChemEntity is located; please use PropertyValue if you want to include any evidence. + isPartOf: URIRef # Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of. + isPartOfBioChemEntity: URIRef # Indicates a BioChemEntity that is (in some sense) a part of this BioChemEntity. + isPlanForApartment: ( + URIRef # Indicates some accommodation that this floor plan describes. + ) + isProprietary: URIRef # True if this item's name is a proprietary/brand name (vs. generic name). + isRelatedTo: ( + URIRef # A pointer to another, somehow related product (or multiple products). + ) + isResizable: URIRef # Whether the 3DModel allows resizing. For example, room layout applications often do not allow 3DModel elements to be resized to reflect reality. + isSimilarTo: URIRef # A pointer to another, functionally similar product (or multiple products). + isUnlabelledFallback: URIRef # This can be marked 'true' to indicate that some published [[DeliveryTimeSettings]] or [[ShippingRateSettings]] are intended to apply to all [[OfferShippingDetails]] published by the same merchant, when referenced by a [[shippingSettingsLink]] in those settings. It is not meaningful to use a 'true' value for this property alongside a transitTimeLabel (for [[DeliveryTimeSettings]]) or shippingLabel (for [[ShippingRateSettings]]), since this property is for use with unlabelled settings. + isVariantOf: URIRef # Indicates the kind of product that this is a variant of. In the case of [[ProductModel]], this is a pointer (from a ProductModel) to a base product from which this product is a variant. It is safe to infer that the variant inherits all product features from the base model, unless defined locally. This is not transitive. In the case of a [[ProductGroup]], the group description also serves as a template, representing a set of Products that vary on explicitly defined, specific dimensions only (so it defines both a set of variants, as well as which values distinguish amongst those variants). When used with [[ProductGroup]], this property can apply to any [[Product]] included in the group. + isbn: URIRef # The ISBN of the book. + isicV4: URIRef # The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place. + isrcCode: URIRef # The International Standard Recording Code for the recording. + issn: URIRef # The International Standard Serial Number (ISSN) that identifies this serial publication. You can repeat this property to identify different formats of, or the linking ISSN (ISSN-L) for, this serial publication. + issueNumber: ( + URIRef # Identifies the issue of publication; for example, "iii" or "2". + ) + issuedBy: URIRef # The organization issuing the ticket or permit. + issuedThrough: URIRef # The service through with the permit was granted. + iswcCode: ( + URIRef # The International Standard Musical Work Code for the composition. + ) + item: URIRef # An entity represented by an entry in a list or data feed (e.g. an 'artist' in a list of 'artists')’. + itemCondition: URIRef # A predefined value from OfferItemCondition specifying the condition of the product or service, or the products or services included in the offer. Also used for product return policies to specify the condition of products accepted for returns. + itemDefectReturnFees: ( + URIRef # The type of return fees for returns of defect products. + ) + itemDefectReturnLabelSource: URIRef # The method (from an enumeration) by which the customer obtains a return shipping label for a defect product. + itemDefectReturnShippingFeesAmount: URIRef # Amount of shipping costs for defect product returns. Applicable when property [[itemDefectReturnFees]] equals [[ReturnShippingFees]]. + itemListElement: URIRef # For itemListElement values, you can use simple strings (e.g. "Peter", "Paul", "Mary"), existing entities, or use ListItem.\n\nText values are best if the elements in the list are plain strings. Existing entities are best for a simple, unordered list of existing things in your data. ListItem is used with ordered lists when you want to provide additional context about the element in that list or when the same item might be in different places in different lists.\n\nNote: The order of elements in your mark-up is not sufficient for indicating the order or elements. Use ListItem with a 'position' property in such cases. + itemListOrder: URIRef # Type of ordering (e.g. Ascending, Descending, Unordered). + itemLocation: URIRef # Current location of the item. + itemOffered: URIRef # An item being offered (or demanded). The transactional nature of the offer or demand is documented using [[businessFunction]], e.g. sell, lease etc. While several common expected types are listed explicitly in this definition, others can be used. Using a second type, such as Product or a subtype of Product, can clarify the nature of the offer. + itemReviewed: URIRef # The item that is being reviewed/rated. + itemShipped: URIRef # Item(s) being shipped. + itinerary: URIRef # Destination(s) ( [[Place]] ) that make up a trip. For a trip where destination order is important use [[ItemList]] to specify that order (see examples). + iupacName: URIRef # Systematic method of naming chemical compounds as recommended by the International Union of Pure and Applied Chemistry (IUPAC). + jobBenefits: URIRef # Description of benefits associated with the job. + jobImmediateStart: URIRef # An indicator as to whether a position is available for an immediate start. + jobLocation: URIRef # A (typically single) geographic location associated with the job position. + jobLocationType: URIRef # A description of the job location (e.g TELECOMMUTE for telecommute jobs). + jobStartDate: URIRef # The date on which a successful applicant for this job would be expected to start work. Choose a specific date in the future or use the jobImmediateStart property to indicate the position is to be filled as soon as possible. + jobTitle: URIRef # The job title of the person (for example, Financial Manager). + jurisdiction: URIRef # Indicates a legal jurisdiction, e.g. of some legislation, or where some government service is based. + keywords: URIRef # Keywords or tags used to describe this content. Multiple entries in a keywords list are typically delimited by commas. + knownVehicleDamages: ( + URIRef # A textual description of known damages, both repaired and unrepaired. + ) + knows: URIRef # The most generic bi-directional social/work relation. + knowsAbout: URIRef # Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions. + knowsLanguage: URIRef # Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). + labelDetails: URIRef # Link to the drug's label details. + landlord: ( + URIRef # A sub property of participant. The owner of the real estate property. + ) + language: URIRef # A sub property of instrument. The language used on this action. + lastReviewed: URIRef # Date on which the content on this web page was last reviewed for accuracy and/or completeness. + latitude: URIRef # The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)). + layoutImage: URIRef # A schematic image showing the floorplan layout. + learningResourceType: URIRef # The predominant type or kind characterizing the learning resource. For example, 'presentation', 'handout'. + leaseLength: URIRef # Length of the lease for some [[Accommodation]], either particular to some [[Offer]] or in some cases intrinsic to the property. + legalName: URIRef # The official name of the organization, e.g. the registered company name. + legalStatus: URIRef # The drug or supplement's legal status, including any controlled substance schedules that apply. + legislationApplies: URIRef # Indicates that this legislation (or part of a legislation) somehow transfers another legislation in a different legislative context. This is an informative link, and it has no legal value. For legally-binding links of transposition, use the legislationTransposes property. For example an informative consolidated law of a European Union's member state "applies" the consolidated version of the European Directive implemented in it. + legislationChanges: URIRef # Another legislation that this legislation changes. This encompasses the notions of amendment, replacement, correction, repeal, or other types of change. This may be a direct change (textual or non-textual amendment) or a consequential or indirect change. The property is to be used to express the existence of a change relationship between two acts rather than the existence of a consolidated version of the text that shows the result of the change. For consolidation relationships, use the legislationConsolidates property. + legislationConsolidates: URIRef # Indicates another legislation taken into account in this consolidated legislation (which is usually the product of an editorial process that revises the legislation). This property should be used multiple times to refer to both the original version or the previous consolidated version, and to the legislations making the change. + legislationDate: URIRef # The date of adoption or signature of the legislation. This is the date at which the text is officially aknowledged to be a legislation, even though it might not even be published or in force. + legislationDateVersion: URIRef # The point-in-time at which the provided description of the legislation is valid (e.g. : when looking at the law on the 2016-04-07 (= dateVersion), I get the consolidation of 2015-04-12 of the "National Insurance Contributions Act 2015") + legislationIdentifier: URIRef # An identifier for the legislation. This can be either a string-based identifier, like the CELEX at EU level or the NOR in France, or a web-based, URL/URI identifier, like an ELI (European Legislation Identifier) or an URN-Lex. + legislationJurisdiction: ( + URIRef # The jurisdiction from which the legislation originates. + ) + legislationLegalForce: URIRef # Whether the legislation is currently in force, not in force, or partially in force. + legislationLegalValue: URIRef # The legal value of this legislation file. The same legislation can be written in multiple files with different legal values. Typically a digitally signed PDF have a "stronger" legal value than the HTML file of the same act. + legislationPassedBy: URIRef # The person or organization that originally passed or made the law : typically parliament (for primary legislation) or government (for secondary legislation). This indicates the "legal author" of the law, as opposed to its physical author. + legislationResponsible: URIRef # An individual or organization that has some kind of responsibility for the legislation. Typically the ministry who is/was in charge of elaborating the legislation, or the adressee for potential questions about the legislation once it is published. + legislationTransposes: URIRef # Indicates that this legislation (or part of legislation) fulfills the objectives set by another legislation, by passing appropriate implementation measures. Typically, some legislations of European Union's member states or regions transpose European Directives. This indicates a legally binding link between the 2 legislations. + legislationType: URIRef # The type of the legislation. Examples of values are "law", "act", "directive", "decree", "regulation", "statutory instrument", "loi organique", "règlement grand-ducal", etc., depending on the country. + leiCode: URIRef # An organization identifier that uniquely identifies a legal entity as defined in ISO 17442. + lender: URIRef # A sub property of participant. The person that lends the object being borrowed. + lesser: URIRef # This ordering relation for qualitative values indicates that the subject is lesser than the object. + lesserOrEqual: URIRef # This ordering relation for qualitative values indicates that the subject is lesser than or equal to the object. + letterer: URIRef # The individual who adds lettering, including speech balloons and sound effects, to artwork. + license: URIRef # A license document that applies to this content, typically indicated by URL. + line: URIRef # A line is a point-to-point path consisting of two or more points. A line is expressed as a series of two or more point objects separated by space. + linkRelationship: URIRef # Indicates the relationship type of a Web link. + liveBlogUpdate: URIRef # An update to the LiveBlog. + loanMortgageMandateAmount: URIRef # Amount of mortgage mandate that can be converted into a proper mortgage at a later stage. + loanPaymentAmount: URIRef # The amount of money to pay in a single payment. + loanPaymentFrequency: URIRef # Frequency of payments due, i.e. number of months between payments. This is defined as a frequency, i.e. the reciprocal of a period of time. + loanRepaymentForm: URIRef # A form of paying back money previously borrowed from a lender. Repayment usually takes the form of periodic payments that normally include part principal plus interest in each payment. + loanTerm: URIRef # The duration of the loan or credit agreement. + loanType: URIRef # The type of a loan or credit. + location: URIRef # The location of, for example, where an event is happening, where an organization is located, or where an action takes place. + locationCreated: URIRef # The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork. + lodgingUnitDescription: URIRef # A full description of the lodging unit. + lodgingUnitType: URIRef # Textual description of the unit type (including suite vs. room, size of bed, etc.). + logo: URIRef # An associated logo. + longitude: URIRef # The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)). + loser: URIRef # A sub property of participant. The loser of the action. + lowPrice: URIRef # The lowest price of all offers available.\n\nUsage guidelines:\n\n* Use values from 0123456789 (Unicode 'DIGIT ZERO' (U+0030) to 'DIGIT NINE' (U+0039)) rather than superficially similiar Unicode symbols.\n* Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to indicate a decimal point. Avoid using these symbols as a readability separator. + lyricist: URIRef # The person who wrote the words. + lyrics: URIRef # The words in the song. + mainContentOfPage: ( + URIRef # Indicates if this web page element is the main subject of the page. + ) + mainEntity: URIRef # Indicates the primary entity described in some page or other CreativeWork. + mainEntityOfPage: URIRef # Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details. + maintainer: URIRef # A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work. + makesOffer: URIRef # A pointer to products or services offered by the organization or person. + manufacturer: URIRef # The manufacturer of the product. + map: URIRef # A URL to a map of the place. + mapType: URIRef # Indicates the kind of Map, from the MapCategoryType Enumeration. + maps: URIRef # A URL to a map of the place. + marginOfError: URIRef # A marginOfError for an [[Observation]]. + masthead: URIRef # For a [[NewsMediaOrganization]], a link to the masthead page or a page listing top editorial management. + material: URIRef # A material that something is made from, e.g. leather, wool, cotton, paper. + materialExtent: URIRef # The quantity of the materials being described or an expression of the physical space they occupy. + mathExpression: URIRef # A mathematical expression (e.g. 'x^2-3x=0') that may be solved for a specific variable, simplified, or transformed. This can take many formats, e.g. LaTeX, Ascii-Math, or math as you would write with a keyboard. + maxPrice: URIRef # The highest price if the price is a range. + maxValue: URIRef # The upper value of some characteristic or property. + maximumAttendeeCapacity: ( + URIRef # The total number of individuals that may attend an event or venue. + ) + maximumEnrollment: ( + URIRef # The maximum number of students who may be enrolled in the program. + ) + maximumIntake: URIRef # Recommended intake of this supplement for a given population as defined by a specific recommending authority. + maximumPhysicalAttendeeCapacity: URIRef # The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]). + maximumVirtualAttendeeCapacity: URIRef # The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]] is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]). + mealService: URIRef # Description of the meals that will be provided or available for purchase. + measuredProperty: URIRef # The measuredProperty of an [[Observation]], either a schema.org property, a property from other RDF-compatible systems e.g. W3C RDF Data Cube, or schema.org extensions such as [GS1's](https://www.gs1.org/voc/?show=properties). + measuredValue: URIRef # The measuredValue of an [[Observation]]. + measurementTechnique: URIRef # A technique or technology used in a [[Dataset]] (or [[DataDownload]], [[DataCatalog]]), corresponding to the method used for measuring the corresponding variable(s) (described using [[variableMeasured]]). This is oriented towards scientific and scholarly dataset publication but may have broader applicability; it is not intended as a full representation of measurement, but rather as a high level summary for dataset discovery. For example, if [[variableMeasured]] is: molecule concentration, [[measurementTechnique]] could be: "mass spectrometry" or "nmr spectroscopy" or "colorimetry" or "immunofluorescence". If the [[variableMeasured]] is "depression rating", the [[measurementTechnique]] could be "Zung Scale" or "HAM-D" or "Beck Depression Inventory". If there are several [[variableMeasured]] properties recorded for some given data object, use a [[PropertyValue]] for each [[variableMeasured]] and attach the corresponding [[measurementTechnique]]. + mechanismOfAction: URIRef # The specific biochemical interaction through which this drug or supplement produces its pharmacological effect. + mediaAuthenticityCategory: URIRef # Indicates a MediaManipulationRatingEnumeration classification of a media object (in the context of how it was published or shared). + mediaItemAppearance: URIRef # In the context of a [[MediaReview]], indicates specific media item(s) that are grouped using a [[MediaReviewItem]]. + median: URIRef # The median value. + medicalAudience: URIRef # Medical audience for page. + medicalSpecialty: URIRef # A medical specialty of the provider. + medicineSystem: URIRef # The system of medicine that includes this MedicalEntity, for example 'evidence-based', 'homeopathic', 'chiropractic', etc. + meetsEmissionStandard: ( + URIRef # Indicates that the vehicle meets the respective emission standard. + ) + member: URIRef # A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals. + memberOf: URIRef # An Organization (or ProgramMembership) to which this Person or Organization belongs. + members: URIRef # A member of this organization. + membershipNumber: URIRef # A unique identifier for the membership. + membershipPointsEarned: URIRef # The number of membership points earned by the member. If necessary, the unitText can be used to express the units the points are issued in. (e.g. stars, miles, etc.) + memoryRequirements: URIRef # Minimum memory requirements. + mentions: URIRef # Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept. + menu: URIRef # Either the actual menu as a structured representation, as text, or a URL of the menu. + menuAddOn: URIRef # Additional menu item(s) such as a side dish of salad or side order of fries that can be added to this menu item. Additionally it can be a menu section containing allowed add-on menu items for this menu item. + merchant: URIRef # 'merchant' is an out-dated term for 'seller'. + merchantReturnDays: URIRef # Specifies either a fixed return date or the number of days (from the delivery date) that a product can be returned. Used when the [[returnPolicyCategory]] property is specified as [[MerchantReturnFiniteReturnWindow]]. + merchantReturnLink: ( + URIRef # Specifies a Web page or service by URL, for product returns. + ) + messageAttachment: URIRef # A CreativeWork attached to the message. + mileageFromOdometer: URIRef # The total distance travelled by the particular vehicle since its initial production, as read from its odometer.\n\nTypical unit code(s): KMT for kilometers, SMI for statute miles + minPrice: URIRef # The lowest price if the price is a range. + minValue: URIRef # The lower value of some characteristic or property. + minimumPaymentDue: URIRef # The minimum payment required at this time. + missionCoveragePrioritiesPolicy: URIRef # For a [[NewsMediaOrganization]], a statement on coverage priorities, including any public agenda or stance on issues. + model: URIRef # The model of the product. Use with the URL of a ProductModel or a textual representation of the model identifier. The URL of the ProductModel can be from an external source. It is recommended to additionally provide strong product identifiers via the gtin8/gtin13/gtin14 and mpn properties. + modelDate: URIRef # The release date of a vehicle model (often used to differentiate versions of the same make and model). + modifiedTime: URIRef # The date and time the reservation was modified. + molecularFormula: URIRef # The empirical formula is the simplest whole number ratio of all the atoms in a molecule. + molecularWeight: URIRef # This is the molecular weight of the entity being described, not of the parent. Units should be included in the form '<Number> <unit>', for example '12 amu' or as '<QuantitativeValue>. + monoisotopicMolecularWeight: URIRef # The monoisotopic mass is the sum of the masses of the atoms in a molecule using the unbound, ground-state, rest mass of the principal (most abundant) isotope for each element instead of the isotopic average mass. Please include the units the form '<Number> <unit>', for example '770.230488 g/mol' or as '<QuantitativeValue>. + monthlyMinimumRepaymentAmount: URIRef # The minimum payment is the lowest amount of money that one is required to pay on a credit card statement each month. + monthsOfExperience: URIRef # Indicates the minimal number of months of experience required for a position. + mpn: URIRef # The Manufacturer Part Number (MPN) of the product, or the product to which the offer refers. + multipleValues: URIRef # Whether multiple values are allowed for the property. Default is false. + muscleAction: URIRef # The movement the muscle generates. + musicArrangement: URIRef # An arrangement derived from the composition. + musicBy: URIRef # The composer of the soundtrack. + musicCompositionForm: ( + URIRef # The type of composition (e.g. overture, sonata, symphony, etc.). + ) + musicGroupMember: URIRef # A member of a music group—for example, John, Paul, George, or Ringo. + musicReleaseFormat: URIRef # Format of this release (the type of recording media used, ie. compact disc, digital media, LP, etc.). + musicalKey: URIRef # The key, mode, or scale this composition uses. + naics: URIRef # The North American Industry Classification System (NAICS) code for a particular organization or business person. + name: URIRef # The name of the item. + namedPosition: URIRef # A position played, performed or filled by a person or organization, as part of an organization. For example, an athlete in a SportsTeam might play in the position named 'Quarterback'. + nationality: URIRef # Nationality of the person. + naturalProgression: URIRef # The expected progression of the condition if it is not treated and allowed to progress naturally. + negativeNotes: URIRef # Indicates, in the context of a [[Review]] (e.g. framed as 'pro' vs 'con' considerations), negative considerations - either as unstructured text, or a list. + nerve: URIRef # The underlying innervation associated with the muscle. + nerveMotor: ( + URIRef # The neurological pathway extension that involves muscle control. + ) + netWorth: URIRef # The total financial value of the person as calculated by subtracting assets from liabilities. + newsUpdatesAndGuidelines: URIRef # Indicates a page with news updates and guidelines. This could often be (but is not required to be) the main page containing [[SpecialAnnouncement]] markup on a site. + nextItem: URIRef # A link to the ListItem that follows the current one. + noBylinesPolicy: URIRef # For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement explaining when authors of articles are not named in bylines. + nonEqual: URIRef # This ordering relation for qualitative values indicates that the subject is not equal to the object. + nonProprietaryName: URIRef # The generic name of this drug or supplement. + nonprofitStatus: URIRef # nonprofit Status indicates the legal status of a non-profit organization in its primary place of business. + normalRange: ( + URIRef # Range of acceptable values for a typical patient, when applicable. + ) + nsn: URIRef # Indicates the [NATO stock number](https://en.wikipedia.org/wiki/NATO_Stock_Number) (nsn) of a [[Product]]. + numAdults: URIRef # The number of adults staying in the unit. + numChildren: URIRef # The number of children staying in the unit. + numConstraints: URIRef # Indicates the number of constraints (not counting [[populationType]]) defined for a particular [[StatisticalPopulation]]. This helps applications understand if they have access to a sufficiently complete description of a [[StatisticalPopulation]]. + numTracks: URIRef # The number of tracks in this album or playlist. + numberOfAccommodationUnits: URIRef # Indicates the total (available plus unavailable) number of accommodation units in an [[ApartmentComplex]], or the number of accommodation units for a specific [[FloorPlan]] (within its specific [[ApartmentComplex]]). See also [[numberOfAvailableAccommodationUnits]]. + numberOfAirbags: URIRef # The number or type of airbags in the vehicle. + numberOfAvailableAccommodationUnits: URIRef # Indicates the number of available accommodation units in an [[ApartmentComplex]], or the number of accommodation units for a specific [[FloorPlan]] (within its specific [[ApartmentComplex]]). See also [[numberOfAccommodationUnits]]. + numberOfAxles: URIRef # The number of axles.\n\nTypical unit code(s): C62 + numberOfBathroomsTotal: URIRef # The total integer number of bathrooms in a some [[Accommodation]], following real estate conventions as [documented in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsTotalInteger+Field): "The simple sum of the number of bathrooms. For example for a property with two Full Bathrooms and one Half Bathroom, the Bathrooms Total Integer will be 3.". See also [[numberOfRooms]]. + numberOfBedrooms: URIRef # The total integer number of bedrooms in a some [[Accommodation]], [[ApartmentComplex]] or [[FloorPlan]]. + numberOfBeds: URIRef # The quantity of the given bed type available in the HotelRoom, Suite, House, or Apartment. + numberOfCredits: URIRef # The number of credits or units awarded by a Course or required to complete an EducationalOccupationalProgram. + numberOfDoors: URIRef # The number of doors.\n\nTypical unit code(s): C62 + numberOfEmployees: ( + URIRef # The number of employees in an organization e.g. business. + ) + numberOfEpisodes: URIRef # The number of episodes in this season or series. + numberOfForwardGears: URIRef # The total number of forward gears available for the transmission system of the vehicle.\n\nTypical unit code(s): C62 + numberOfFullBathrooms: URIRef # Number of full bathrooms - The total number of full and ¾ bathrooms in an [[Accommodation]]. This corresponds to the [BathroomsFull field in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsFull+Field). + numberOfItems: URIRef # The number of items in an ItemList. Note that some descriptions might not fully describe all items in a list (e.g., multi-page pagination); in such cases, the numberOfItems would be for the entire list. + numberOfLoanPayments: URIRef # The number of payments contractually required at origination to repay the loan. For monthly paying loans this is the number of months from the contractual first payment date to the maturity date. + numberOfPages: URIRef # The number of pages in the book. + numberOfPartialBathrooms: URIRef # Number of partial bathrooms - The total number of half and ¼ bathrooms in an [[Accommodation]]. This corresponds to the [BathroomsPartial field in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsPartial+Field). + numberOfPlayers: URIRef # Indicate how many people can play this game (minimum, maximum, or range). + numberOfPreviousOwners: URIRef # The number of owners of the vehicle, including the current one.\n\nTypical unit code(s): C62 + numberOfRooms: URIRef # The number of rooms (excluding bathrooms and closets) of the accommodation or lodging business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be put in the unitText property of the QuantitativeValue. + numberOfSeasons: URIRef # The number of seasons in this series. + numberedPosition: URIRef # A number associated with a role in an organization, for example, the number on an athlete's jersey. + nutrition: URIRef # Nutrition information about the recipe or menu item. + object: URIRef # The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn't). e.g. John read *a book*. + observationDate: URIRef # The observationDate of an [[Observation]]. + observedNode: URIRef # The observedNode of an [[Observation]], often a [[StatisticalPopulation]]. + occupancy: URIRef # The allowed total occupancy for the accommodation in persons (including infants etc). For individual accommodations, this is not necessarily the legal maximum but defines the permitted usage as per the contractual agreement (e.g. a double room used by a single person). Typical unit code(s): C62 for person + occupationLocation: URIRef # The region/country for which this occupational description is appropriate. Note that educational requirements and qualifications can vary between jurisdictions. + occupationalCategory: URIRef # A category describing the job, preferably using a term from a taxonomy such as [BLS O*NET-SOC](http://www.onetcenter.org/taxonomy.html), [ISCO-08](https://www.ilo.org/public/english/bureau/stat/isco/isco08/) or similar, with the property repeated for each applicable value. Ideally the taxonomy should be identified, and both the textual label and formal code for the category should be provided.\n Note: for historical reasons, any textual label and formal code provided as a literal may be assumed to be from O*NET-SOC. + occupationalCredentialAwarded: URIRef # A description of the qualification, award, certificate, diploma or other occupational credential awarded as a consequence of successful completion of this course or program. + offerCount: URIRef # The number of offers for the product. + offeredBy: URIRef # A pointer to the organization or person making the offer. + offers: URIRef # An offer to provide this item—for example, an offer to sell a product, rent the DVD of a movie, perform a service, or give away tickets to an event. Use [[businessFunction]] to indicate the kind of transaction offered, i.e. sell, lease, etc. This property can also be used to describe a [[Demand]]. While this property is listed as expected on a number of common types, it can be used in others. In that case, using a second type, such as Product or a subtype of Product, can clarify the nature of the offer. + offersPrescriptionByMail: URIRef # Whether prescriptions can be delivered by mail. + openingHours: URIRef # The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas ',' separating each day. Day or time ranges are specified using a hyphen '-'.\n\n* Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```.\n* Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. \n* Here is an example: <time itemprop="openingHours" datetime="Tu,Th 16:00-20:00">Tuesdays and Thursdays 4-8pm</time>.\n* If a business is open 7 days a week, then it can be specified as <time itemprop="openingHours" datetime="Mo-Su">Monday through Sunday, all day</time>. + openingHoursSpecification: URIRef # The opening hours of a certain place. + opens: URIRef # The opening hour of the place or service on the given day(s) of the week. + operatingSystem: ( + URIRef # Operating systems supported (Windows 7, OSX 10.6, Android 1.6). + ) + opponent: URIRef # A sub property of participant. The opponent on this action. + option: URIRef # A sub property of object. The options subject to this action. + orderDate: URIRef # Date order was placed. + orderDelivery: ( + URIRef # The delivery of the parcel related to this order or order item. + ) + orderItemNumber: URIRef # The identifier of the order item. + orderItemStatus: URIRef # The current status of the order item. + orderNumber: URIRef # The identifier of the transaction. + orderQuantity: URIRef # The number of the item ordered. If the property is not set, assume the quantity is one. + orderStatus: URIRef # The current status of the order. + orderedItem: URIRef # The item ordered. + organizer: URIRef # An organizer of an Event. + originAddress: URIRef # Shipper's address. + originalMediaContextDescription: URIRef # Describes, in a [[MediaReview]] when dealing with [[DecontextualizedContent]], background information that can contribute to better interpretation of the [[MediaObject]]. + originalMediaLink: URIRef # Link to the page containing an original version of the content, or directly to an online copy of the original [[MediaObject]] content, e.g. video file. + originatesFrom: URIRef # The vasculature the lymphatic structure originates, or afferents, from. + overdosage: URIRef # Any information related to overdose on a drug, including signs or symptoms, treatments, contact information for emergency response. + ownedFrom: URIRef # The date and time of obtaining the product. + ownedThrough: URIRef # The date and time of giving up ownership on the product. + ownershipFundingInfo: URIRef # For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable. + owns: URIRef # Products owned by the organization or person. + pageEnd: URIRef # The page on which the work ends; for example "138" or "xvi". + pageStart: URIRef # The page on which the work starts; for example "135" or "xiii". + pagination: URIRef # Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55" or "10-12, 46-49". + parent: URIRef # A parent of this person. + parentItem: URIRef # The parent of a question, answer or item in general. + parentOrganization: URIRef # The larger organization that this organization is a [[subOrganization]] of, if any. + parentService: URIRef # A broadcast service to which the broadcast service may belong to such as regional variations of a national channel. + parentTaxon: URIRef # Closest parent taxon of the taxon in question. + parents: URIRef # A parents of the person. + partOfEpisode: URIRef # The episode to which this clip belongs. + partOfInvoice: URIRef # The order is being paid as part of the referenced Invoice. + partOfOrder: ( + URIRef # The overall order the items in this delivery were included in. + ) + partOfSeason: URIRef # The season to which this episode belongs. + partOfSeries: URIRef # The series to which this episode or season belongs. + partOfSystem: ( + URIRef # The anatomical or organ system that this structure is part of. + ) + partOfTVSeries: URIRef # The TV series to which this episode or season belongs. + partOfTrip: URIRef # Identifies that this [[Trip]] is a subTrip of another Trip. For example Day 1, Day 2, etc. of a multi-day trip. + participant: URIRef # Other co-agents that participated in the action indirectly. e.g. John wrote a book with *Steve*. + partySize: URIRef # Number of people the reservation should accommodate. + passengerPriorityStatus: URIRef # The priority status assigned to a passenger for security or boarding (e.g. FastTrack or Priority). + passengerSequenceNumber: ( + URIRef # The passenger's sequence number as assigned by the airline. + ) + pathophysiology: URIRef # Changes in the normal mechanical, physical, and biochemical functions that are associated with this activity or condition. + pattern: URIRef # A pattern that something has, for example 'polka dot', 'striped', 'Canadian flag'. Values are typically expressed as text, although links to controlled value schemes are also supported. + payload: URIRef # The permitted weight of passengers and cargo, EXCLUDING the weight of the empty vehicle.\n\nTypical unit code(s): KGM for kilogram, LBR for pound\n\n* Note 1: Many databases specify the permitted TOTAL weight instead, which is the sum of [[weight]] and [[payload]]\n* Note 2: You can indicate additional information in the [[name]] of the [[QuantitativeValue]] node.\n* Note 3: You may also link to a [[QualitativeValue]] node that provides additional information using [[valueReference]].\n* Note 4: Note that you can use [[minValue]] and [[maxValue]] to indicate ranges. + paymentAccepted: URIRef # Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc. + paymentDue: URIRef # The date that payment is due. + paymentDueDate: URIRef # The date that payment is due. + paymentMethod: ( + URIRef # The name of the credit card or other method of payment for the order. + ) + paymentMethodId: URIRef # An identifier for the method of payment used (e.g. the last 4 digits of the credit card). + paymentStatus: ( + URIRef # The status of payment; whether the invoice has been paid or not. + ) + paymentUrl: URIRef # The URL for sending a payment. + penciler: URIRef # The individual who draws the primary narrative artwork. + percentile10: URIRef # The 10th percentile value. + percentile25: URIRef # The 25th percentile value. + percentile75: URIRef # The 75th percentile value. + percentile90: URIRef # The 90th percentile value. + performTime: URIRef # The length of time it takes to perform instructions or a direction (not including time to prepare the supplies), in [ISO 8601 duration format](http://en.wikipedia.org/wiki/ISO_8601). + performer: URIRef # A performer at the event—for example, a presenter, musician, musical group or actor. + performerIn: URIRef # Event that this person is a performer or participant in. + performers: URIRef # The main performer or performers of the event—for example, a presenter, musician, or actor. + permissionType: ( + URIRef # The type of permission granted the person, organization, or audience. + ) + permissions: URIRef # Permission(s) required to run the app (for example, a mobile app may require full internet access or may run only on wifi). + permitAudience: URIRef # The target audience for this permit. + permittedUsage: ( + URIRef # Indications regarding the permitted usage of the accommodation. + ) + petsAllowed: URIRef # Indicates whether pets are allowed to enter the accommodation or lodging business. More detailed information can be put in a text value. + phoneticText: URIRef # Representation of a text [[textValue]] using the specified [[speechToTextMarkup]]. For example the city name of Houston in IPA: /ˈhjuːstən/. + photo: URIRef # A photograph of this place. + photos: URIRef # Photographs of this place. + physicalRequirement: URIRef # A description of the types of physical activity associated with the job. Defined terms such as those in O*net may be used, but note that there is no way to specify the level of ability as well as its nature when using a defined term. + physiologicalBenefits: ( + URIRef # Specific physiologic benefits associated to the plan. + ) + pickupLocation: URIRef # Where a taxi will pick up a passenger or a rental car can be picked up. + pickupTime: ( + URIRef # When a taxi will pickup a passenger or a rental car can be picked up. + ) + playMode: URIRef # Indicates whether this game is multi-player, co-op or single-player. The game can be marked as multi-player, co-op and single-player at the same time. + playerType: URIRef # Player type required—for example, Flash or Silverlight. + playersOnline: URIRef # Number of players on the server. + polygon: URIRef # A polygon is the area enclosed by a point-to-point path for which the starting and ending points are the same. A polygon is expressed as a series of four or more space delimited points where the first and final points are identical. + populationType: URIRef # Indicates the populationType common to all members of a [[StatisticalPopulation]]. + position: URIRef # The position of an item in a series or sequence of items. + positiveNotes: URIRef # Indicates, in the context of a [[Review]] (e.g. framed as 'pro' vs 'con' considerations), positive considerations - either as unstructured text, or a list. + possibleComplication: URIRef # A possible unexpected and unfavorable evolution of a medical condition. Complications may include worsening of the signs or symptoms of the disease, extension of the condition to other organ systems, etc. + possibleTreatment: ( + URIRef # A possible treatment to address this condition, sign or symptom. + ) + postOfficeBoxNumber: URIRef # The post office box number for PO box addresses. + postOp: URIRef # A description of the postoperative procedures, care, and/or followups for this device. + postalCode: URIRef # The postal code. For example, 94043. + postalCodeBegin: URIRef # First postal code in a range (included). + postalCodeEnd: URIRef # Last postal code in the range (included). Needs to be after [[postalCodeBegin]]. + postalCodePrefix: URIRef # A defined range of postal codes indicated by a common textual prefix. Used for non-numeric systems such as UK. + postalCodeRange: URIRef # A defined range of postal codes. + potentialAction: URIRef # Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role. + potentialUse: URIRef # Intended use of the BioChemEntity by humans. + preOp: URIRef # A description of the workup, testing, and other preparations required before implanting this device. + predecessorOf: URIRef # A pointer from a previous, often discontinued variant of the product to its newer variant. + pregnancyCategory: URIRef # Pregnancy category of this drug. + pregnancyWarning: URIRef # Any precaution, guidance, contraindication, etc. related to this drug's use during pregnancy. + prepTime: URIRef # The length of time it takes to prepare the items to be used in instructions or a direction, in [ISO 8601 duration format](http://en.wikipedia.org/wiki/ISO_8601). + preparation: URIRef # Typical preparation that a patient must undergo before having the procedure performed. + prescribingInfo: URIRef # Link to prescribing information for the drug. + prescriptionStatus: URIRef # Indicates the status of drug prescription eg. local catalogs classifications or whether the drug is available by prescription or over-the-counter, etc. + previousItem: URIRef # A link to the ListItem that preceeds the current one. + previousStartDate: URIRef # Used in conjunction with eventStatus for rescheduled or cancelled events. This property contains the previously scheduled start date. For rescheduled events, the startDate property should be used for the newly scheduled start date. In the (rare) case of an event that has been postponed and rescheduled multiple times, this field may be repeated. + price: URIRef # The offer price of a product, or of a price component when attached to PriceSpecification and its subtypes.\n\nUsage guidelines:\n\n* Use the [[priceCurrency]] property (with standard formats: [ISO 4217 currency format](http://en.wikipedia.org/wiki/ISO_4217) e.g. "USD"; [Ticker symbol](https://en.wikipedia.org/wiki/List_of_cryptocurrencies) for cryptocurrencies e.g. "BTC"; well known names for [Local Exchange Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR") instead of including [ambiguous symbols](http://en.wikipedia.org/wiki/Dollar_sign#Currencies_that_use_the_dollar_or_peso_sign) such as '$' in the value.\n* Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to indicate a decimal point. Avoid using these symbols as a readability separator.\n* Note that both [RDFa](http://www.w3.org/TR/xhtml-rdfa-primer/#using-the-content-attribute) and Microdata syntax allow the use of a "content=" attribute for publishing simple machine-readable values alongside more human-friendly formatting.\n* Use values from 0123456789 (Unicode 'DIGIT ZERO' (U+0030) to 'DIGIT NINE' (U+0039)) rather than superficially similiar Unicode symbols. + priceComponent: URIRef # This property links to all [[UnitPriceSpecification]] nodes that apply in parallel for the [[CompoundPriceSpecification]] node. + priceComponentType: URIRef # Identifies a price component (for example, a line item on an invoice), part of the total price for an offer. + priceCurrency: URIRef # The currency of the price, or a price component when attached to [[PriceSpecification]] and its subtypes.\n\nUse standard formats: [ISO 4217 currency format](http://en.wikipedia.org/wiki/ISO_4217) e.g. "USD"; [Ticker symbol](https://en.wikipedia.org/wiki/List_of_cryptocurrencies) for cryptocurrencies e.g. "BTC"; well known names for [Local Exchange Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types e.g. "Ithaca HOUR". + priceRange: URIRef # The price range of the business, for example ```$$$```. + priceSpecification: URIRef # One or more detailed price specifications, indicating the unit price and delivery or payment charges. + priceType: URIRef # Defines the type of a price specified for an offered product, for example a list price, a (temporary) sale price or a manufacturer suggested retail price. If multiple prices are specified for an offer the [[priceType]] property can be used to identify the type of each such specified price. The value of priceType can be specified as a value from enumeration PriceTypeEnumeration or as a free form text string for price types that are not already predefined in PriceTypeEnumeration. + priceValidUntil: URIRef # The date after which the price is no longer available. + primaryImageOfPage: URIRef # Indicates the main image on the page. + primaryPrevention: URIRef # A preventative therapy used to prevent an initial occurrence of the medical condition, such as vaccination. + printColumn: URIRef # The number of the column in which the NewsArticle appears in the print edition. + printEdition: ( + URIRef # The edition of the print product in which the NewsArticle appears. + ) + printPage: URIRef # If this NewsArticle appears in print, this field indicates the name of the page on which the article is found. Please note that this field is intended for the exact page name (e.g. A5, B18). + printSection: URIRef # If this NewsArticle appears in print, this field indicates the print section in which the article appeared. + procedure: URIRef # A description of the procedure involved in setting up, using, and/or installing the device. + procedureType: URIRef # The type of procedure, for example Surgical, Noninvasive, or Percutaneous. + processingTime: ( + URIRef # Estimated processing time for the service using this channel. + ) + processorRequirements: ( + URIRef # Processor architecture required to run the application (e.g. IA64). + ) + producer: URIRef # The person or organization who produced the work (e.g. music album, movie, tv/radio series etc.). + produces: URIRef # The tangible thing generated by the service, e.g. a passport, permit, etc. + productGroupID: URIRef # Indicates a textual identifier for a ProductGroup. + productID: URIRef # The product identifier, such as ISBN. For example: ``` meta itemprop="productID" content="isbn:123-456-789" ```. + productSupported: URIRef # The product or service this support contact point is related to (such as product support for a particular product line). This can be a specific product or product line (e.g. "iPhone") or a general category of products or services (e.g. "smartphones"). + productionCompany: URIRef # The production company or studio responsible for the item e.g. series, video game, episode etc. + productionDate: URIRef # The date of production of the item, e.g. vehicle. + proficiencyLevel: URIRef # Proficiency needed for this content; expected values: 'Beginner', 'Expert'. + programMembershipUsed: URIRef # Any membership in a frequent flyer, hotel loyalty program, etc. being applied to the reservation. + programName: URIRef # The program providing the membership. + programPrerequisites: URIRef # Prerequisites for enrolling in the program. + programType: URIRef # The type of educational or occupational program. For example, classroom, internship, alternance, etc.. + programmingLanguage: URIRef # The computer programming language. + programmingModel: URIRef # Indicates whether API is managed or unmanaged. + propertyID: URIRef # A commonly used identifier for the characteristic represented by the property, e.g. a manufacturer or a standard code for a property. propertyID can be (1) a prefixed string, mainly meant to be used with standards for product properties; (2) a site-specific, non-prefixed string (e.g. the primary key of the property or the vendor-specific id of the property), or (3) a URL indicating the type of the property, either pointing to an external vocabulary, or a Web resource that describes the property (e.g. a glossary entry). Standards bodies should promote a standard prefix for the identifiers of properties from their standards. + proprietaryName: URIRef # Proprietary name given to the diet plan, typically by its originator or creator. + proteinContent: URIRef # The number of grams of protein. + provider: URIRef # The service provider, service operator, or service performer; the goods producer. Another party (a seller) may offer those services or goods on behalf of the provider. A provider may also serve as the seller. + providerMobility: URIRef # Indicates the mobility of a provided service (e.g. 'static', 'dynamic'). + providesBroadcastService: URIRef # The BroadcastService offered on this channel. + providesService: URIRef # The service provided by this channel. + publicAccess: URIRef # A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value + publicTransportClosuresInfo: URIRef # Information about public transport closures. + publication: URIRef # A publication event associated with the item. + publicationType: URIRef # The type of the medical article, taken from the US NLM MeSH publication type catalog. See also [MeSH documentation](http://www.nlm.nih.gov/mesh/pubtypes.html). + publishedBy: URIRef # An agent associated with the publication event. + publishedOn: URIRef # A broadcast service associated with the publication event. + publisher: URIRef # The publisher of the creative work. + publisherImprint: URIRef # The publishing division which published the comic. + publishingPrinciples: URIRef # The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]]. While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology. + purchaseDate: ( + URIRef # The date the item e.g. vehicle was purchased by the current owner. + ) + qualifications: ( + URIRef # Specific qualifications required for this role or Occupation. + ) + quarantineGuidelines: ( + URIRef # Guidelines about quarantine rules, e.g. in the context of a pandemic. + ) + query: URIRef # A sub property of instrument. The query used on this action. + quest: URIRef # The task that a player-controlled character, or group of characters may complete in order to gain a reward. + question: URIRef # A sub property of object. A question. + rangeIncludes: URIRef # Relates a property to a class that constitutes (one of) the expected type(s) for values of the property. + ratingCount: URIRef # The count of total number of ratings. + ratingExplanation: URIRef # A short explanation (e.g. one to two sentences) providing background context and other information that led to the conclusion expressed in the rating. This is particularly applicable to ratings associated with "fact check" markup using [[ClaimReview]]. + ratingValue: URIRef # The rating for the content.\n\nUsage guidelines:\n\n* Use values from 0123456789 (Unicode 'DIGIT ZERO' (U+0030) to 'DIGIT NINE' (U+0039)) rather than superficially similiar Unicode symbols.\n* Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to indicate a decimal point. Avoid using these symbols as a readability separator. + readBy: URIRef # A person who reads (performs) the audiobook. + readonlyValue: URIRef # Whether or not a property is mutable. Default is false. Specifying this for a property that also has a value makes it act similar to a "hidden" input in an HTML form. + realEstateAgent: URIRef # A sub property of participant. The real estate agent involved in the action. + recipe: URIRef # A sub property of instrument. The recipe/instructions used to perform the action. + recipeCategory: ( + URIRef # The category of the recipe—for example, appetizer, entree, etc. + ) + recipeCuisine: ( + URIRef # The cuisine of the recipe (for example, French or Ethiopian). + ) + recipeIngredient: ( + URIRef # A single ingredient used in the recipe, e.g. sugar, flour or garlic. + ) + recipeInstructions: URIRef # A step in making the recipe, in the form of a single item (document, video, etc.) or an ordered list with HowToStep and/or HowToSection items. + recipeYield: URIRef # The quantity produced by the recipe (for example, number of people served, number of servings, etc). + recipient: URIRef # A sub property of participant. The participant who is at the receiving end of the action. + recognizedBy: URIRef # An organization that acknowledges the validity, value or utility of a credential. Note: recognition may include a process of quality assurance or accreditation. + recognizingAuthority: URIRef # If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine. + recommendationStrength: ( + URIRef # Strength of the guideline's recommendation (e.g. 'class I'). + ) + recommendedIntake: URIRef # Recommended intake of this supplement for a given population as defined by a specific recommending authority. + recordLabel: URIRef # The label that issued the release. + recordedAs: URIRef # An audio recording of the work. + recordedAt: URIRef # The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event. + recordedIn: URIRef # The CreativeWork that captured all or part of this Event. + recordingOf: URIRef # The composition this track is a recording of. + recourseLoan: URIRef # The only way you get the money back in the event of default is the security. Recourse is where you still have the opportunity to go back to the borrower for the rest of the money. + referenceQuantity: URIRef # The reference quantity for which a certain price applies, e.g. 1 EUR per 4 kWh of electricity. This property is a replacement for unitOfMeasurement for the advanced cases where the price does not relate to a standard unit. + referencesOrder: URIRef # The Order(s) related to this Invoice. One or more Orders may be combined into a single Invoice. + refundType: URIRef # A refund type, from an enumerated list. + regionDrained: URIRef # The anatomical or organ system drained by this vessel; generally refers to a specific part of an organ. + regionsAllowed: URIRef # The regions where the media is allowed. If not specified, then it's assumed to be allowed everywhere. Specify the countries in [ISO 3166 format](http://en.wikipedia.org/wiki/ISO_3166). + relatedAnatomy: URIRef # Anatomical systems or structures that relate to the superficial anatomy. + relatedCondition: URIRef # A medical condition associated with this anatomy. + relatedDrug: URIRef # Any other drug related to this one, for example commonly-prescribed alternatives. + relatedLink: URIRef # A link related to this web page, for example to other related web pages. + relatedStructure: URIRef # Related anatomical structure(s) that are not part of the system but relate or connect to it, such as vascular bundles associated with an organ system. + relatedTherapy: URIRef # A medical therapy related to this anatomy. + relatedTo: URIRef # The most generic familial relation. + releaseDate: URIRef # The release date of a product or product model. This can be used to distinguish the exact variant of a product. + releaseNotes: URIRef # Description of what changed in this version. + releaseOf: URIRef # The album this is a release of. + releasedEvent: URIRef # The place and time the release was issued, expressed as a PublicationEvent. + relevantOccupation: URIRef # The Occupation for the JobPosting. + relevantSpecialty: ( + URIRef # If applicable, a medical specialty in which this entity is relevant. + ) + remainingAttendeeCapacity: ( + URIRef # The number of attendee places for an event that remain unallocated. + ) + renegotiableLoan: URIRef # Whether the terms for payment of interest can be renegotiated during the life of the loan. + repeatCount: ( + URIRef # Defines the number of times a recurring [[Event]] will take place + ) + repeatFrequency: URIRef # Defines the frequency at which [[Event]]s will occur according to a schedule [[Schedule]]. The intervals between events should be defined as a [[Duration]] of time. + repetitions: URIRef # Number of times one should repeat the activity. + replacee: URIRef # A sub property of object. The object that is being replaced. + replacer: URIRef # A sub property of object. The object that replaces. + replyToUrl: ( + URIRef # The URL at which a reply may be posted to the specified UserComment. + ) + reportNumber: URIRef # The number or other unique designator assigned to a Report by the publishing organization. + representativeOfPage: URIRef # Indicates whether this image is representative of the content of the page. + requiredCollateral: URIRef # Assets required to secure loan or credit repayments. It may take form of third party pledge, goods, financial instruments (cash, securities, etc.) + requiredGender: URIRef # Audiences defined by a person's gender. + requiredMaxAge: URIRef # Audiences defined by a person's maximum age. + requiredMinAge: URIRef # Audiences defined by a person's minimum age. + requiredQuantity: URIRef # The required quantity of the item(s). + requirements: URIRef # Component dependency requirements for application. This includes runtime environments and shared libraries that are not included in the application distribution package, but required to run the application (Examples: DirectX, Java or .NET runtime). + requiresSubscription: URIRef # Indicates if use of the media require a subscription (either paid or free). Allowed values are ```true``` or ```false``` (note that an earlier version had 'yes', 'no'). + reservationFor: ( + URIRef # The thing -- flight, event, restaurant,etc. being reserved. + ) + reservationId: URIRef # A unique identifier for the reservation. + reservationStatus: URIRef # The current status of the reservation. + reservedTicket: URIRef # A ticket associated with the reservation. + responsibilities: ( + URIRef # Responsibilities associated with this role or Occupation. + ) + restPeriods: URIRef # How often one should break from the activity. + restockingFee: URIRef # Use [[MonetaryAmount]] to specify a fixed restocking fee for product returns, or use [[Number]] to specify a percentage of the product price paid by the customer. + result: URIRef # The result produced in the action. e.g. John wrote *a book*. + resultComment: URIRef # A sub property of result. The Comment created or sent as a result of this action. + resultReview: URIRef # A sub property of result. The review that resulted in the performing of the action. + returnFees: ( + URIRef # The type of return fees for purchased products (for any return reason) + ) + returnLabelSource: URIRef # The method (from an enumeration) by which the customer obtains a return shipping label for a product returned for any reason. + returnMethod: ( + URIRef # The type of return method offered, specified from an enumeration. + ) + returnPolicyCategory: ( + URIRef # Specifies an applicable return policy (from an enumeration). + ) + returnPolicyCountry: URIRef # The country where the product has to be sent to for returns, for example "Ireland" using the [[name]] property of [[Country]]. You can also provide the two-letter [ISO 3166-1 alpha-2 country code](http://en.wikipedia.org/wiki/ISO_3166-1). Note that this can be different from the country where the product was originally shipped from or sent too. + returnPolicySeasonalOverride: URIRef # Seasonal override of a return policy. + returnShippingFeesAmount: URIRef # Amount of shipping costs for product returns (for any reason). Applicable when property [[returnFees]] equals [[ReturnShippingFees]]. + review: URIRef # A review of the item. + reviewAspect: URIRef # This Review or Rating is relevant to this part or facet of the itemReviewed. + reviewBody: URIRef # The actual body of the review. + reviewCount: URIRef # The count of total number of reviews. + reviewRating: URIRef # The rating given in this review. Note that reviews can themselves be rated. The ```reviewRating``` applies to rating given by the review. The [[aggregateRating]] property applies to the review itself, as a creative work. + reviewedBy: URIRef # People or organizations that have reviewed the content on this web page for accuracy and/or completeness. + reviews: URIRef # Review of the item. + riskFactor: URIRef # A modifiable or non-modifiable factor that increases the risk of a patient contracting this condition, e.g. age, coexisting condition. + risks: URIRef # Specific physiologic risks associated to the diet plan. + roleName: URIRef # A role played, performed or filled by a person or organization. For example, the team of creators for a comic book might fill the roles named 'inker', 'penciller', and 'letterer'; or an athlete in a SportsTeam might play in the position named 'Quarterback'. + roofLoad: URIRef # The permitted total weight of cargo and installations (e.g. a roof rack) on top of the vehicle.\n\nTypical unit code(s): KGM for kilogram, LBR for pound\n\n* Note 1: You can indicate additional information in the [[name]] of the [[QuantitativeValue]] node.\n* Note 2: You may also link to a [[QualitativeValue]] node that provides additional information using [[valueReference]]\n* Note 3: Note that you can use [[minValue]] and [[maxValue]] to indicate ranges. + rsvpResponse: URIRef # The response (yes, no, maybe) to the RSVP. + runsTo: URIRef # The vasculature the lymphatic structure runs, or efferents, to. + runtime: URIRef # Runtime platform or script interpreter dependencies (Example - Java v1, Python2.3, .Net Framework 3.0). + runtimePlatform: URIRef # Runtime platform or script interpreter dependencies (Example - Java v1, Python2.3, .Net Framework 3.0). + rxcui: URIRef # The RxCUI drug identifier from RXNORM. + safetyConsideration: URIRef # Any potential safety concern associated with the supplement. May include interactions with other drugs and foods, pregnancy, breastfeeding, known adverse reactions, and documented efficacy of the supplement. + salaryCurrency: URIRef # The currency (coded using [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) ) used for the main salary information in this job posting or for this employee. + salaryUponCompletion: URIRef # The expected salary upon completing the training. + sameAs: URIRef # URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website. + sampleType: URIRef # What type of code sample: full (compile ready) solution, code snippet, inline code, scripts, template. + saturatedFatContent: URIRef # The number of grams of saturated fat. + scheduleTimezone: URIRef # Indicates the timezone for which the time(s) indicated in the [[Schedule]] are given. The value provided should be among those listed in the IANA Time Zone Database. + scheduledPaymentDate: URIRef # The date the invoice is scheduled to be paid. + scheduledTime: URIRef # The time the object is scheduled to. + schemaVersion: URIRef # Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community. + schoolClosuresInfo: URIRef # Information about school closures. + screenCount: URIRef # The number of screens in the movie theater. + screenshot: URIRef # A link to a screenshot image of the app. + sdDatePublished: URIRef # Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]] + sdLicense: URIRef # A license document that applies to this structured data, typically indicated by URL. + sdPublisher: URIRef # Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The [[sdPublisher]] property helps make such practices more explicit. + season: URIRef # A season in a media series. + seasonNumber: URIRef # Position of the season within an ordered group of seasons. + seasons: URIRef # A season in a media series. + seatNumber: URIRef # The location of the reserved seat (e.g., 27). + seatRow: URIRef # The row location of the reserved seat (e.g., B). + seatSection: URIRef # The section location of the reserved seat (e.g. Orchestra). + seatingCapacity: URIRef # The number of persons that can be seated (e.g. in a vehicle), both in terms of the physical space available, and in terms of limitations set by law.\n\nTypical unit code(s): C62 for persons + seatingType: URIRef # The type/class of the seat. + secondaryPrevention: URIRef # A preventative therapy used to prevent reoccurrence of the medical condition after an initial episode of the condition. + securityClearanceRequirement: ( + URIRef # A description of any security clearance requirements of the job. + ) + securityScreening: ( + URIRef # The type of security screening the passenger is subject to. + ) + seeks: URIRef # A pointer to products or services sought by the organization or person (demand). + seller: URIRef # An entity which offers (sells / leases / lends / loans) the services / goods. A seller may also be a provider. + sender: URIRef # A sub property of participant. The participant who is at the sending end of the action. + sensoryRequirement: URIRef # A description of any sensory requirements and levels necessary to function on the job, including hearing and vision. Defined terms such as those in O*net may be used, but note that there is no way to specify the level of ability as well as its nature when using a defined term. + sensoryUnit: URIRef # The neurological pathway extension that inputs and sends information to the brain or spinal cord. + serialNumber: URIRef # The serial number or any alphanumeric identifier of a particular product. When attached to an offer, it is a shortcut for the serial number of the product included in the offer. + seriousAdverseOutcome: URIRef # A possible serious complication and/or serious side effect of this therapy. Serious adverse outcomes include those that are life-threatening; result in death, disability, or permanent damage; require hospitalization or prolong existing hospitalization; cause congenital anomalies or birth defects; or jeopardize the patient and may require medical or surgical intervention to prevent one of the outcomes in this definition. + serverStatus: URIRef # Status of a game server. + servesCuisine: URIRef # The cuisine of the restaurant. + serviceArea: URIRef # The geographic area where the service is provided. + serviceAudience: URIRef # The audience eligible for this service. + serviceLocation: URIRef # The location (e.g. civic structure, local business, etc.) where a person can go to access the service. + serviceOperator: URIRef # The operating organization, if different from the provider. This enables the representation of services that are provided by an organization, but operated by another organization like a subcontractor. + serviceOutput: URIRef # The tangible thing generated by the service, e.g. a passport, permit, etc. + servicePhone: URIRef # The phone number to use to access the service. + servicePostalAddress: URIRef # The address for accessing the service by mail. + serviceSmsNumber: URIRef # The number to access the service by text message. + serviceType: URIRef # The type of service being offered, e.g. veterans' benefits, emergency relief, etc. + serviceUrl: URIRef # The website to access the service. + servingSize: URIRef # The serving size, in terms of the number of volume or mass. + sha256: URIRef # The [SHA-2](https://en.wikipedia.org/wiki/SHA-2) SHA256 hash of the content of the item. For example, a zero-length input has value 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855' + sharedContent: URIRef # A CreativeWork such as an image, video, or audio clip shared as part of this posting. + shippingDestination: URIRef # indicates (possibly multiple) shipping destinations. These can be defined in several ways e.g. postalCode ranges. + shippingDetails: URIRef # Indicates information about the shipping policies and options associated with an [[Offer]]. + shippingLabel: URIRef # Label to match an [[OfferShippingDetails]] with a [[ShippingRateSettings]] (within the context of a [[shippingSettingsLink]] cross-reference). + shippingRate: URIRef # The shipping rate is the cost of shipping to the specified destination. Typically, the maxValue and currency values (of the [[MonetaryAmount]]) are most appropriate. + shippingSettingsLink: URIRef # Link to a page containing [[ShippingRateSettings]] and [[DeliveryTimeSettings]] details. + sibling: URIRef # A sibling of the person. + siblings: URIRef # A sibling of the person. + signDetected: URIRef # A sign detected by the test. + signOrSymptom: URIRef # A sign or symptom of this condition. Signs are objective or physically observable manifestations of the medical condition while symptoms are the subjective experience of the medical condition. + significance: URIRef # The significance associated with the superficial anatomy; as an example, how characteristics of the superficial anatomy can suggest underlying medical conditions or courses of treatment. + significantLink: URIRef # One of the more significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most. + significantLinks: URIRef # The most significant URLs on the page. Typically, these are the non-navigation links that are clicked on the most. + size: URIRef # A standardized size of a product or creative work, specified either through a simple textual string (for example 'XL', '32Wx34L'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable. + sizeGroup: URIRef # The size group (also known as "size type") for a product's size. Size groups are common in the fashion industry to define size segments and suggested audiences for wearable products. Multiple values can be combined, for example "men's big and tall", "petite maternity" or "regular" + sizeSystem: URIRef # The size system used to identify a product's size. Typically either a standard (for example, "GS1" or "ISO-EN13402"), country code (for example "US" or "JP"), or a measuring system (for example "Metric" or "Imperial"). + skills: URIRef # A statement of knowledge, skill, ability, task or any other assertion expressing a competency that is desired or required to fulfill this role or to work in this occupation. + sku: URIRef # The Stock Keeping Unit (SKU), i.e. a merchant-specific identifier for a product or service, or the product to which the offer refers. + slogan: URIRef # A slogan or motto associated with the item. + smiles: URIRef # A specification in form of a line notation for describing the structure of chemical species using short ASCII strings. Double bond stereochemistry \ indicators may need to be escaped in the string in formats where the backslash is an escape character. + smokingAllowed: URIRef # Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room. + sodiumContent: URIRef # The number of milligrams of sodium. + softwareAddOn: URIRef # Additional content for a software application. + softwareHelp: URIRef # Software application help. + softwareRequirements: URIRef # Component dependency requirements for application. This includes runtime environments and shared libraries that are not included in the application distribution package, but required to run the application (Examples: DirectX, Java or .NET runtime). + softwareVersion: URIRef # Version of the software instance. + sourceOrganization: ( + URIRef # The Organization on whose behalf the creator was working. + ) + sourcedFrom: URIRef # The neurological pathway that originates the neurons. + spatial: URIRef # The "spatial" property can be used in cases when more specific properties (e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate. + spatialCoverage: URIRef # The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York. + speakable: URIRef # Indicates sections of a Web page that are particularly 'speakable' in the sense of being highlighted as being especially appropriate for text-to-speech conversion. Other sections of a page may also be usefully spoken in particular circumstances; the 'speakable' property serves to indicate the parts most likely to be generally useful for speech. The *speakable* property can be repeated an arbitrary number of times, with three kinds of possible 'content-locator' values: 1.) *id-value* URL references - uses *id-value* of an element in the page being annotated. The simplest use of *speakable* has (potentially relative) URL values, referencing identified sections of the document concerned. 2.) CSS Selectors - addresses content in the annotated page, eg. via class attribute. Use the [[cssSelector]] property. 3.) XPaths - addresses content via XPaths (assuming an XML view of the content). Use the [[xpath]] property. For more sophisticated markup of speakable sections beyond simple ID references, either CSS selectors or XPath expressions to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]] which is defined to be a possible value of the *speakable* property. + specialCommitments: URIRef # Any special commitments associated with this job posting. Valid entries include VeteranCommit, MilitarySpouseCommit, etc. + specialOpeningHoursSpecification: URIRef # The special opening hours of a certain place.\n\nUse this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]]. + specialty: URIRef # One of the domain specialities to which this web page's content applies. + speechToTextMarkup: URIRef # Form of markup used. eg. [SSML](https://www.w3.org/TR/speech-synthesis11) or [IPA](https://www.wikidata.org/wiki/Property:P898). + speed: URIRef # The speed range of the vehicle. If the vehicle is powered by an engine, the upper limit of the speed range (indicated by [[maxValue]] should be the maximum speed achievable under regular conditions.\n\nTypical unit code(s): KMH for km/h, HM for mile per hour (0.447 04 m/s), KNT for knot\n\n*Note 1: Use [[minValue]] and [[maxValue]] to indicate the range. Typically, the minimal value is zero.\n* Note 2: There are many different ways of measuring the speed range. You can link to information about how the given value has been determined using the [[valueReference]] property. + spokenByCharacter: URIRef # The (e.g. fictional) character, Person or Organization to whom the quotation is attributed within the containing CreativeWork. + sponsor: URIRef # A person or organization that supports a thing through a pledge, promise, or financial contribution. e.g. a sponsor of a Medical Study or a corporate sponsor of an event. + sport: URIRef # A type of sport (e.g. Baseball). + sportsActivityLocation: URIRef # A sub property of location. The sports activity location where this action occurred. + sportsEvent: URIRef # A sub property of location. The sports event where this action occurred. + sportsTeam: URIRef # A sub property of participant. The sports team that participated on this action. + spouse: URIRef # The person's spouse. + stage: URIRef # The stage of the condition, if applicable. + stageAsNumber: URIRef # The stage represented as a number, e.g. 3. + starRating: URIRef # An official rating for a lodging business or food establishment, e.g. from national associations or standards bodies. Use the author property to indicate the rating organization, e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars). + startDate: URIRef # The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)). + startOffset: URIRef # The start time of the clip expressed as the number of seconds from the beginning of the work. + startTime: URIRef # The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from *January* to December. For media, including audio and video, it's the time offset of the start of a clip within a larger file.\n\nNote that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions. + status: URIRef # The status of the study (enumerated). + steeringPosition: URIRef # The position of the steering wheel or similar device (mostly for cars). + step: URIRef # A single step item (as HowToStep, text, document, video, etc.) or a HowToSection. + stepValue: URIRef # The stepValue attribute indicates the granularity that is expected (and required) of the value in a PropertyValueSpecification. + steps: URIRef # A single step item (as HowToStep, text, document, video, etc.) or a HowToSection (originally misnamed 'steps'; 'step' is preferred). + storageRequirements: URIRef # Storage requirements (free space required). + streetAddress: URIRef # The street address. For example, 1600 Amphitheatre Pkwy. + strengthUnit: URIRef # The units of an active ingredient's strength, e.g. mg. + strengthValue: URIRef # The value of an active ingredient's strength, e.g. 325. + structuralClass: ( + URIRef # The name given to how bone physically connects to each other. + ) + study: URIRef # A medical study or trial related to this entity. + studyDesign: URIRef # Specifics about the observational study design (enumerated). + studyLocation: URIRef # The location in which the study is taking/took place. + studySubject: URIRef # A subject of the study, i.e. one of the medical conditions, therapies, devices, drugs, etc. investigated by the study. + subEvent: URIRef # An Event that is part of this event. For example, a conference event includes many presentations, each of which is a subEvent of the conference. + subEvents: URIRef # Events that are a part of this event. For example, a conference event includes many presentations, each subEvents of the conference. + subOrganization: URIRef # A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific 'department' property. + subReservation: URIRef # The individual reservations included in the package. Typically a repeated property. + subStageSuffix: URIRef # The substage, e.g. 'a' for Stage IIIa. + subStructure: ( + URIRef # Component (sub-)structure(s) that comprise this anatomical structure. + ) + subTest: URIRef # A component test of the panel. + subTrip: URIRef # Identifies a [[Trip]] that is a subTrip of this Trip. For example Day 1, Day 2, etc. of a multi-day trip. + subjectOf: URIRef # A CreativeWork or Event about this Thing. + subtitleLanguage: URIRef # Languages in which subtitles/captions are available, in [IETF BCP 47 standard format](http://tools.ietf.org/html/bcp47). + successorOf: URIRef # A pointer from a newer variant of a product to its previous, often discontinued predecessor. + sugarContent: URIRef # The number of grams of sugar. + suggestedAge: URIRef # The age or age range for the intended audience or person, for example 3-12 months for infants, 1-5 years for toddlers. + suggestedAnswer: URIRef # An answer (possibly one of several, possibly incorrect) to a Question, e.g. on a Question/Answer site. + suggestedGender: URIRef # The suggested gender of the intended person or audience, for example "male", "female", or "unisex". + suggestedMaxAge: ( + URIRef # Maximum recommended age in years for the audience or user. + ) + suggestedMeasurement: URIRef # A suggested range of body measurements for the intended audience or person, for example inseam between 32 and 34 inches or height between 170 and 190 cm. Typically found on a size chart for wearable products. + suggestedMinAge: ( + URIRef # Minimum recommended age in years for the audience or user. + ) + suitableForDiet: URIRef # Indicates a dietary restriction or guideline for which this recipe or menu item is suitable, e.g. diabetic, halal etc. + superEvent: URIRef # An event that this event is a part of. For example, a collection of individual music performances might each have a music festival as their superEvent. + supersededBy: URIRef # Relates a term (i.e. a property, class or enumeration) to one that supersedes it. + supply: URIRef # A sub-property of instrument. A supply consumed when performing instructions or a direction. + supplyTo: URIRef # The area to which the artery supplies blood. + supportingData: URIRef # Supporting data for a SoftwareApplication. + surface: URIRef # A material used as a surface in some artwork, e.g. Canvas, Paper, Wood, Board, etc. + target: URIRef # Indicates a target EntryPoint for an Action. + targetCollection: ( + URIRef # A sub property of object. The collection target of the action. + ) + targetDescription: ( + URIRef # The description of a node in an established educational framework. + ) + targetName: URIRef # The name of a node in an established educational framework. + targetPlatform: ( + URIRef # Type of app development: phone, Metro style, desktop, XBox, etc. + ) + targetPopulation: URIRef # Characteristics of the population for which this is intended, or which typically uses it, e.g. 'adults'. + targetProduct: URIRef # Target Operating System / Product to which the code applies. If applies to several versions, just the product name can be used. + targetUrl: URIRef # The URL of a node in an established educational framework. + taxID: URIRef # The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain. + taxonRank: URIRef # The taxonomic rank of this taxon given preferably as a URI from a controlled vocabulary – (typically the ranks from TDWG TaxonRank ontology or equivalent Wikidata URIs). + taxonomicRange: URIRef # The taxonomic grouping of the organism that expresses, encodes, or in someway related to the BioChemEntity. + teaches: URIRef # The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term. + telephone: URIRef # The telephone number. + temporal: URIRef # The "temporal" property can be used in cases where more specific properties (e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate. + temporalCoverage: URIRef # The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content e.g. ScholarlyArticle, Book, TVSeries or TVEpisode may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945". Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated. + termCode: URIRef # A code that identifies this [[DefinedTerm]] within a [[DefinedTermSet]] + termDuration: URIRef # The amount of time in a term as defined by the institution. A term is a length of time where students take one or more classes. Semesters and quarters are common units for term. + termsOfService: URIRef # Human-readable terms of service documentation. + termsPerYear: URIRef # The number of times terms of study are offered per year. Semesters and quarters are common units for term. For example, if the student can only take 2 semesters for the program in one year, then termsPerYear should be 2. + text: URIRef # The textual content of this CreativeWork. + textValue: URIRef # Text value being annotated. + thumbnail: URIRef # Thumbnail image for an image or video. + thumbnailUrl: URIRef # A thumbnail image relevant to the Thing. + tickerSymbol: URIRef # The exchange traded instrument associated with a Corporation object. The tickerSymbol is expressed as an exchange and an instrument name separated by a space character. For the exchange component of the tickerSymbol attribute, we recommend using the controlled vocabulary of Market Identifier Codes (MIC) specified in ISO15022. + ticketNumber: URIRef # The unique identifier for the ticket. + ticketToken: URIRef # Reference to an asset (e.g., Barcode, QR code image or PDF) usable for entrance. + ticketedSeat: URIRef # The seat associated with the ticket. + timeOfDay: ( + URIRef # The time of day the program normally runs. For example, "evenings". + ) + timeRequired: URIRef # Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. 'PT30M', 'PT1H25M'. + timeToComplete: URIRef # The expected length of time to complete the program if attending full-time. + tissueSample: URIRef # The type of tissue sample required for the test. + title: URIRef # The title of the job. + titleEIDR: URIRef # An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing at the most general/abstract level, a work of film or television. For example, the motion picture known as "Ghostbusters" has a titleEIDR of "10.5240/7EC7-228A-510A-053E-CBB8-J". This title (or work) may have several variants, which EIDR calls "edits". See [[editEIDR]]. Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description. + toLocation: URIRef # A sub property of location. The final location of the object or the agent after the action. + toRecipient: URIRef # A sub property of recipient. The recipient who was directly sent the message. + tocContinuation: URIRef # A [[HyperTocEntry]] can have a [[tocContinuation]] indicated, which is another [[HyperTocEntry]] that would be the default next item to play or render. + tocEntry: URIRef # Indicates a [[HyperTocEntry]] in a [[HyperToc]]. + tongueWeight: URIRef # The permitted vertical load (TWR) of a trailer attached to the vehicle. Also referred to as Tongue Load Rating (TLR) or Vertical Load Rating (VLR)\n\nTypical unit code(s): KGM for kilogram, LBR for pound\n\n* Note 1: You can indicate additional information in the [[name]] of the [[QuantitativeValue]] node.\n* Note 2: You may also link to a [[QualitativeValue]] node that provides additional information using [[valueReference]].\n* Note 3: Note that you can use [[minValue]] and [[maxValue]] to indicate ranges. + tool: URIRef # A sub property of instrument. An object used (but not consumed) when performing instructions or a direction. + torque: URIRef # The torque (turning force) of the vehicle's engine.\n\nTypical unit code(s): NU for newton metre (N m), F17 for pound-force per foot, or F48 for pound-force per inch\n\n* Note 1: You can link to information about how the given value has been determined (e.g. reference RPM) using the [[valueReference]] property.\n* Note 2: You can use [[minValue]] and [[maxValue]] to indicate ranges. + totalJobOpenings: URIRef # The number of positions open for this job posting. Use a positive integer. Do not use if the number of positions is unclear or not known. + totalPaymentDue: URIRef # The total amount due. + totalPrice: URIRef # The total price for the reservation or ticket, including applicable taxes, shipping, etc.\n\nUsage guidelines:\n\n* Use values from 0123456789 (Unicode 'DIGIT ZERO' (U+0030) to 'DIGIT NINE' (U+0039)) rather than superficially similiar Unicode symbols.\n* Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to indicate a decimal point. Avoid using these symbols as a readability separator. + totalTime: URIRef # The total time required to perform instructions or a direction (including time to prepare the supplies), in [ISO 8601 duration format](http://en.wikipedia.org/wiki/ISO_8601). + tourBookingPage: URIRef # A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate. + touristType: URIRef # Attraction suitable for type(s) of tourist. eg. Children, visitors from a particular country, etc. + track: URIRef # A music recording (track)—usually a single song. If an ItemList is given, the list should contain items of type MusicRecording. + trackingNumber: URIRef # Shipper tracking number. + trackingUrl: URIRef # Tracking url for the parcel delivery. + tracks: URIRef # A music recording (track)—usually a single song. + trailer: URIRef # The trailer of a movie or tv/radio series, season, episode, etc. + trailerWeight: URIRef # The permitted weight of a trailer attached to the vehicle.\n\nTypical unit code(s): KGM for kilogram, LBR for pound\n* Note 1: You can indicate additional information in the [[name]] of the [[QuantitativeValue]] node.\n* Note 2: You may also link to a [[QualitativeValue]] node that provides additional information using [[valueReference]].\n* Note 3: Note that you can use [[minValue]] and [[maxValue]] to indicate ranges. + trainName: URIRef # The name of the train (e.g. The Orient Express). + trainNumber: URIRef # The unique identifier for the train. + trainingSalary: URIRef # The estimated salary earned while in the program. + transFatContent: URIRef # The number of grams of trans fat. + transcript: URIRef # If this MediaObject is an AudioObject or VideoObject, the transcript of that object. + transitTime: URIRef # The typical delay the order has been sent for delivery and the goods reach the final customer. Typical properties: minValue, maxValue, unitCode (d for DAY). + transitTimeLabel: URIRef # Label to match an [[OfferShippingDetails]] with a [[DeliveryTimeSettings]] (within the context of a [[shippingSettingsLink]] cross-reference). + translationOfWork: URIRef # The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the Origin of Species” + translator: URIRef # Organization or person who adapts a creative work to different languages, regional differences and technical requirements of a target market, or that translates during some event. + transmissionMethod: URIRef # How the disease spreads, either as a route or vector, for example 'direct contact', 'Aedes aegypti', etc. + travelBans: ( + URIRef # Information about travel bans, e.g. in the context of a pandemic. + ) + trialDesign: URIRef # Specifics about the trial design (enumerated). + tributary: URIRef # The anatomical or organ system that the vein flows into; a larger structure that the vein connects to. + typeOfBed: URIRef # The type of bed to which the BedDetail refers, i.e. the type of bed available in the quantity indicated by quantity. + typeOfGood: URIRef # The product that this structured value is referring to. + typicalAgeRange: URIRef # The typical expected age range, e.g. '7-9', '11-'. + typicalCreditsPerTerm: URIRef # The number of credits or units a full-time student would be expected to take in 1 term however 'term' is defined by the institution. + typicalTest: URIRef # A medical test typically performed given this condition. + underName: URIRef # The person or organization the reservation or ticket is for. + unitCode: URIRef # The unit of measurement given using the UN/CEFACT Common Code (3 characters) or a URL. Other codes than the UN/CEFACT Common Code may be used with a prefix followed by a colon. + unitText: URIRef # A string or text indicating the unit of measurement. Useful if you cannot provide a standard unit code for unitCode. + unnamedSourcesPolicy: URIRef # For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required. + unsaturatedFatContent: URIRef # The number of grams of unsaturated fat. + uploadDate: URIRef # Date when this media object was uploaded to this site. + upvoteCount: URIRef # The number of upvotes this question, answer or comment has received from the community. + url: URIRef # URL of the item. + urlTemplate: URIRef # An url template (RFC6570) that will be used to construct the target of the execution of the action. + usageInfo: URIRef # The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses. + usedToDiagnose: URIRef # A condition the test is used to diagnose. + userInteractionCount: URIRef # The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. + usesDevice: URIRef # Device used to perform the test. + usesHealthPlanIdStandard: URIRef # The standard for interpreting thePlan ID. The preferred is "HIOS". See the Centers for Medicare & Medicaid Services for more details. + utterances: URIRef # Text of an utterances (spoken words, lyrics etc.) that occurs at a certain section of a media object, represented as a [[HyperTocEntry]]. + validFor: URIRef # The duration of validity of a permit or similar thing. + validFrom: URIRef # The date when the item becomes valid. + validIn: URIRef # The geographic area where a permit or similar thing is valid. + validThrough: URIRef # The date after when the item is not valid. For example the end of an offer, salary period, or a period of opening hours. + validUntil: URIRef # The date when the item is no longer valid. + value: URIRef # The value of the quantitative value or property value node.\n\n* For [[QuantitativeValue]] and [[MonetaryAmount]], the recommended type for values is 'Number'.\n* For [[PropertyValue]], it can be 'Text;', 'Number', 'Boolean', or 'StructuredValue'.\n* Use values from 0123456789 (Unicode 'DIGIT ZERO' (U+0030) to 'DIGIT NINE' (U+0039)) rather than superficially similiar Unicode symbols.\n* Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to indicate a decimal point. Avoid using these symbols as a readability separator. + valueAddedTaxIncluded: URIRef # Specifies whether the applicable value-added tax (VAT) is included in the price specification or not. + valueMaxLength: URIRef # Specifies the allowed range for number of characters in a literal value. + valueMinLength: URIRef # Specifies the minimum allowed range for number of characters in a literal value. + valueName: URIRef # Indicates the name of the PropertyValueSpecification to be used in URL templates and form encoding in a manner analogous to HTML's input@name. + valuePattern: URIRef # Specifies a regular expression for testing literal values according to the HTML spec. + valueReference: URIRef # A secondary value that provides additional information on the original value, e.g. a reference temperature or a type of measurement. + valueRequired: URIRef # Whether the property must be filled in to complete the action. Default is false. + variableMeasured: URIRef # The variableMeasured property can indicate (repeated as necessary) the variables that are measured in some dataset, either described as text or as pairs of identifier and description using PropertyValue. + variantCover: URIRef # A description of the variant cover for the issue, if the issue is a variant printing. For example, "Bryan Hitch Variant Cover" or "2nd Printing Variant". + variesBy: URIRef # Indicates the property or properties by which the variants in a [[ProductGroup]] vary, e.g. their size, color etc. Schema.org properties can be referenced by their short name e.g. "color"; terms defined elsewhere can be referenced with their URIs. + vatID: URIRef # The Value-added Tax ID of the organization or person. + vehicleConfiguration: URIRef # A short text indicating the configuration of the vehicle, e.g. '5dr hatchback ST 2.5 MT 225 hp' or 'limited edition'. + vehicleEngine: URIRef # Information about the engine or engines of the vehicle. + vehicleIdentificationNumber: URIRef # The Vehicle Identification Number (VIN) is a unique serial number used by the automotive industry to identify individual motor vehicles. + vehicleInteriorColor: ( + URIRef # The color or color combination of the interior of the vehicle. + ) + vehicleInteriorType: URIRef # The type or material of the interior of the vehicle (e.g. synthetic fabric, leather, wood, etc.). While most interior types are characterized by the material used, an interior type can also be based on vehicle usage or target audience. + vehicleModelDate: URIRef # The release date of a vehicle model (often used to differentiate versions of the same make and model). + vehicleSeatingCapacity: URIRef # The number of passengers that can be seated in the vehicle, both in terms of the physical space available, and in terms of limitations set by law.\n\nTypical unit code(s): C62 for persons. + vehicleSpecialUsage: URIRef # Indicates whether the vehicle has been used for special purposes, like commercial rental, driving school, or as a taxi. The legislation in many countries requires this information to be revealed when offering a car for sale. + vehicleTransmission: URIRef # The type of component used for transmitting the power from a rotating power source to the wheels or other relevant component(s) ("gearbox" for cars). + vendor: URIRef # 'vendor' is an earlier term for 'seller'. + verificationFactCheckingPolicy: URIRef # Disclosure about verification and fact-checking processes for a [[NewsMediaOrganization]] or other fact-checking [[Organization]]. + version: URIRef # The version of the CreativeWork embodied by a specified resource. + video: URIRef # An embedded video object. + videoFormat: URIRef # The type of screening or video broadcast used (e.g. IMAX, 3D, SD, HD, etc.). + videoFrameSize: URIRef # The frame size of the video. + videoQuality: URIRef # The quality of the video. + volumeNumber: URIRef # Identifies the volume of publication or multi-part work; for example, "iii" or "2". + warning: URIRef # Any FDA or other warnings about the drug (text or URL). + warranty: URIRef # The warranty promise(s) included in the offer. + warrantyPromise: URIRef # The warranty promise(s) included in the offer. + warrantyScope: URIRef # The scope of the warranty promise. + webCheckinTime: ( + URIRef # The time when a passenger can check into the flight online. + ) + webFeed: URIRef # The URL for a feed, e.g. associated with a podcast series, blog, or series of date-stamped updates. This is usually RSS or Atom. + weight: URIRef # The weight of the product or person. + weightTotal: URIRef # The permitted total weight of the loaded vehicle, including passengers and cargo and the weight of the empty vehicle.\n\nTypical unit code(s): KGM for kilogram, LBR for pound\n\n* Note 1: You can indicate additional information in the [[name]] of the [[QuantitativeValue]] node.\n* Note 2: You may also link to a [[QualitativeValue]] node that provides additional information using [[valueReference]].\n* Note 3: Note that you can use [[minValue]] and [[maxValue]] to indicate ranges. + wheelbase: URIRef # The distance between the centers of the front and rear wheels.\n\nTypical unit code(s): CMT for centimeters, MTR for meters, INH for inches, FOT for foot/feet + width: URIRef # The width of the item. + winner: URIRef # A sub property of participant. The winner of the action. + wordCount: URIRef # The number of words in the text of the Article. + workExample: URIRef # Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook. + workFeatured: URIRef # A work featured in some event, e.g. exhibited in an ExhibitionEvent. Specific subproperties are available for workPerformed (e.g. a play), or a workPresented (a Movie at a ScreeningEvent). + workHours: URIRef # The typical working hours for this job (e.g. 1st shift, night shift, 8am-5pm). + workLocation: URIRef # A contact location for a person's place of work. + workPerformed: URIRef # A work performed in some event, for example a play performed in a TheaterEvent. + workPresented: URIRef # The movie presented during this event. + workTranslation: URIRef # A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation “Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo. + workload: URIRef # Quantitative measure of the physiologic output of the exercise; also referred to as energy expenditure. + worksFor: URIRef # Organizations that the person works for. + worstRating: URIRef # The lowest value allowed in this rating system. If worstRating is omitted, 1 is assumed. + xpath: URIRef # An XPath, e.g. of a [[SpeakableSpecification]] or [[WebPageElement]]. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element". + yearBuilt: URIRef # The year an [[Accommodation]] was constructed. This corresponds to the [YearBuilt field in RESO](https://ddwiki.reso.org/display/DDW17/YearBuilt+Field). + yearlyRevenue: URIRef # The size of the business in annual revenue. + yearsInOperation: URIRef # The age of the business. + # yield: URIRef # The quantity that results by performing instructions. For example, a paper airplane, 10 personalized candles. diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_SH.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_SH.py new file mode 100644 index 0000000000000000000000000000000000000000..5bcbbbbf16d2388cc9fef6da5e3027e87cb1e6c4 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_SH.py @@ -0,0 +1,293 @@ +from rdflib.namespace import DefinedNamespace, Namespace +from rdflib.term import URIRef + + +class SH(DefinedNamespace): + """ + W3C Shapes Constraint Language (SHACL) Vocabulary + + This vocabulary defines terms used in SHACL, the W3C Shapes Constraint Language. + + Generated from: https://www.w3.org/ns/shacl.ttl + Date: 2020-05-26 14:20:08.041103 + + """ + + _fail = True + + # http://www.w3.org/1999/02/22-rdf-syntax-ns#Property + alternativePath: URIRef # The (single) value of this property must be a list of path elements, representing the elements of alternative paths. + annotationProperty: URIRef # The annotation property that shall be set. + annotationValue: URIRef # The (default) values of the annotation property. + annotationVarName: URIRef # The name of the SPARQL variable from the SELECT clause that shall be used for the values. + ask: URIRef # The SPARQL ASK query to execute. + closed: URIRef # If set to true then the shape is closed. + condition: URIRef # The shapes that the focus nodes need to conform to before a rule is executed on them. + conforms: URIRef # True if the validation did not produce any validation results, and false otherwise. + construct: URIRef # The SPARQL CONSTRUCT query to execute. + datatype: URIRef # Specifies an RDF datatype that all value nodes must have. + deactivated: URIRef # If set to true then all nodes conform to this. + declare: URIRef # Links a resource with its namespace prefix declarations. + defaultValue: URIRef # A default value for a property, for example for user interface tools to pre-populate input fields. + description: URIRef # Human-readable descriptions for the property in the context of the surrounding shape. + detail: URIRef # Links a result with other results that provide more details, for example to describe violations against nested shapes. + disjoint: URIRef # Specifies a property where the set of values must be disjoint with the value nodes. + entailment: URIRef # An entailment regime that indicates what kind of inferencing is required by a shapes graph. + equals: URIRef # Specifies a property that must have the same values as the value nodes. + expression: URIRef # The node expression that must return true for the value nodes. + filterShape: ( + URIRef # The shape that all input nodes of the expression need to conform to. + ) + flags: ( + URIRef # An optional flag to be used with regular expression pattern matching. + ) + focusNode: URIRef # The focus node that was validated when the result was produced. + group: URIRef # Can be used to link to a property group to indicate that a property shape belongs to a group of related property shapes. + hasValue: URIRef # Specifies a value that must be among the value nodes. + ignoredProperties: URIRef # An optional RDF list of properties that are also permitted in addition to those explicitly enumerated via sh:property/sh:path. + intersection: URIRef # A list of node expressions that shall be intersected. + inversePath: URIRef # The (single) value of this property represents an inverse path (object to subject). + js: URIRef # Constraints expressed in JavaScript. + jsFunctionName: URIRef # The name of the JavaScript function to execute. + jsLibrary: URIRef # Declares which JavaScript libraries are needed to execute this. + jsLibraryURL: URIRef # Declares the URLs of a JavaScript library. This should be the absolute URL of a JavaScript file. Implementations may redirect those to local files. + labelTemplate: URIRef # Outlines how human-readable labels of instances of the associated Parameterizable shall be produced. The values can contain {?paramName} as placeholders for the actual values of the given parameter. + languageIn: ( + URIRef # Specifies a list of language tags that all value nodes must have. + ) + lessThan: URIRef # Specifies a property that must have smaller values than the value nodes. + lessThanOrEquals: URIRef # Specifies a property that must have smaller or equal values than the value nodes. + maxCount: ( + URIRef # Specifies the maximum number of values in the set of value nodes. + ) + maxExclusive: URIRef # Specifies the maximum exclusive value of each value node. + maxInclusive: URIRef # Specifies the maximum inclusive value of each value node. + maxLength: URIRef # Specifies the maximum string length of each value node. + message: URIRef # A human-readable message (possibly with placeholders for variables) explaining the cause of the result. + minCount: ( + URIRef # Specifies the minimum number of values in the set of value nodes. + ) + minExclusive: URIRef # Specifies the minimum exclusive value of each value node. + minInclusive: URIRef # Specifies the minimum inclusive value of each value node. + minLength: URIRef # Specifies the minimum string length of each value node. + name: URIRef # Human-readable labels for the property in the context of the surrounding shape. + namespace: URIRef # The namespace associated with a prefix in a prefix declaration. + node: URIRef # Specifies the node shape that all value nodes must conform to. + nodeKind: URIRef # Specifies the node kind (e.g. IRI or literal) each value node. + nodeValidator: URIRef # The validator(s) used to evaluate a constraint in the context of a node shape. + nodes: URIRef # The node expression producing the input nodes of a filter shape expression. + object: ( + URIRef # An expression producing the nodes that shall be inferred as objects. + ) + oneOrMorePath: URIRef # The (single) value of this property represents a path that is matched one or more times. + optional: URIRef # Indicates whether a parameter is optional. + order: URIRef # Specifies the relative order of this compared to its siblings. For example use 0 for the first, 1 for the second. + parameter: URIRef # The parameters of a function or constraint component. + path: URIRef # Specifies the property path of a property shape. + pattern: URIRef # Specifies a regular expression pattern that the string representations of the value nodes must match. + predicate: URIRef # An expression producing the properties that shall be inferred as predicates. + prefix: URIRef # The prefix of a prefix declaration. + prefixes: URIRef # The prefixes that shall be applied before parsing the associated SPARQL query. + property: URIRef # Links a shape to its property shapes. + propertyValidator: URIRef # The validator(s) used to evaluate a constraint in the context of a property shape. + qualifiedMaxCount: ( + URIRef # The maximum number of value nodes that can conform to the shape. + ) + qualifiedMinCount: ( + URIRef # The minimum number of value nodes that must conform to the shape. + ) + qualifiedValueShape: ( + URIRef # The shape that a specified number of values must conform to. + ) + qualifiedValueShapesDisjoint: URIRef # Can be used to mark the qualified value shape to be disjoint with its sibling shapes. + result: URIRef # The validation results contained in a validation report. + resultAnnotation: URIRef # Links a SPARQL validator with zero or more sh:ResultAnnotation instances, defining how to derive additional result properties based on the variables of the SELECT query. + resultMessage: URIRef # Human-readable messages explaining the cause of the result. + resultPath: URIRef # The path of a validation result, based on the path of the validated property shape. + resultSeverity: URIRef # The severity of the result, e.g. warning. + returnType: ( + URIRef # The expected type of values returned by the associated function. + ) + rule: URIRef # The rules linked to a shape. + select: URIRef # The SPARQL SELECT query to execute. + severity: URIRef # Defines the severity that validation results produced by a shape must have. Defaults to sh:Violation. + shapesGraph: ( + URIRef # Shapes graphs that should be used when validating this data graph. + ) + shapesGraphWellFormed: URIRef # If true then the validation engine was certain that the shapes graph has passed all SHACL syntax requirements during the validation process. + sourceConstraint: ( + URIRef # The constraint that was validated when the result was produced. + ) + sourceConstraintComponent: ( + URIRef # The constraint component that is the source of the result. + ) + sourceShape: URIRef # The shape that is was validated when the result was produced. + sparql: URIRef # Links a shape with SPARQL constraints. + subject: URIRef # An expression producing the resources that shall be inferred as subjects. + suggestedShapesGraph: URIRef # Suggested shapes graphs for this ontology. The values of this property may be used in the absence of specific sh:shapesGraph statements. + target: URIRef # Links a shape to a target specified by an extension language, for example instances of sh:SPARQLTarget. + targetClass: URIRef # Links a shape to a class, indicating that all instances of the class must conform to the shape. + targetNode: URIRef # Links a shape to individual nodes, indicating that these nodes must conform to the shape. + targetObjectsOf: URIRef # Links a shape to a property, indicating that all all objects of triples that have the given property as their predicate must conform to the shape. + targetSubjectsOf: URIRef # Links a shape to a property, indicating that all subjects of triples that have the given property as their predicate must conform to the shape. + union: URIRef # A list of node expressions that shall be used together. + uniqueLang: URIRef # Specifies whether all node values must have a unique (or no) language tag. + update: URIRef # The SPARQL UPDATE to execute. + validator: URIRef # The validator(s) used to evaluate constraints of either node or property shapes. + value: URIRef # An RDF node that has caused the result. + xone: URIRef # Specifies a list of shapes so that the value nodes must conform to exactly one of the shapes. + zeroOrMorePath: URIRef # The (single) value of this property represents a path that is matched zero or more times. + zeroOrOnePath: URIRef # The (single) value of this property represents a path that is matched zero or one times. + + # http://www.w3.org/2000/01/rdf-schema#Class + AbstractResult: URIRef # The base class of validation results, typically not instantiated directly. + ConstraintComponent: URIRef # The class of constraint components. + Function: URIRef # The class of SHACL functions. + JSConstraint: URIRef # The class of constraints backed by a JavaScript function. + JSExecutable: URIRef # Abstract base class of resources that declare an executable JavaScript. + JSFunction: URIRef # The class of SHACL functions that execute a JavaScript function when called. + JSLibrary: URIRef # Represents a JavaScript library, typically identified by one or more URLs of files to include. + JSRule: URIRef # The class of SHACL rules expressed using JavaScript. + JSTarget: URIRef # The class of targets that are based on JavaScript functions. + JSTargetType: URIRef # The (meta) class for parameterizable targets that are based on JavaScript functions. + JSValidator: URIRef # A SHACL validator based on JavaScript. This can be used to declare SHACL constraint components that perform JavaScript-based validation when used. + NodeKind: URIRef # The class of all node kinds, including sh:BlankNode, sh:IRI, sh:Literal or the combinations of these: sh:BlankNodeOrIRI, sh:BlankNodeOrLiteral, sh:IRIOrLiteral. + NodeShape: URIRef # A node shape is a shape that specifies constraint that need to be met with respect to focus nodes. + Parameter: URIRef # The class of parameter declarations, consisting of a path predicate and (possibly) information about allowed value type, cardinality and other characteristics. + Parameterizable: URIRef # Superclass of components that can take parameters, especially functions and constraint components. + PrefixDeclaration: URIRef # The class of prefix declarations, consisting of pairs of a prefix with a namespace. + PropertyGroup: URIRef # Instances of this class represent groups of property shapes that belong together. + PropertyShape: URIRef # A property shape is a shape that specifies constraints on the values of a focus node for a given property or path. + ResultAnnotation: URIRef # A class of result annotations, which define the rules to derive the values of a given annotation property as extra values for a validation result. + Rule: URIRef # The class of SHACL rules. Never instantiated directly. + SPARQLAskExecutable: ( + URIRef # The class of SPARQL executables that are based on an ASK query. + ) + SPARQLAskValidator: URIRef # The class of validators based on SPARQL ASK queries. The queries are evaluated for each value node and are supposed to return true if the given node conforms. + SPARQLConstraint: URIRef # The class of constraints based on SPARQL SELECT queries. + SPARQLConstructExecutable: ( + URIRef # The class of SPARQL executables that are based on a CONSTRUCT query. + ) + SPARQLExecutable: URIRef # The class of resources that encapsulate a SPARQL query. + SPARQLFunction: ( + URIRef # A function backed by a SPARQL query - either ASK or SELECT. + ) + SPARQLRule: URIRef # The class of SHACL rules based on SPARQL CONSTRUCT queries. + SPARQLSelectExecutable: ( + URIRef # The class of SPARQL executables based on a SELECT query. + ) + SPARQLSelectValidator: URIRef # The class of validators based on SPARQL SELECT queries. The queries are evaluated for each focus node and are supposed to produce bindings for all focus nodes that do not conform. + SPARQLTarget: URIRef # The class of targets that are based on SPARQL queries. + SPARQLTargetType: URIRef # The (meta) class for parameterizable targets that are based on SPARQL queries. + SPARQLUpdateExecutable: ( + URIRef # The class of SPARQL executables based on a SPARQL UPDATE. + ) + Severity: URIRef # The class of validation result severity levels, including violation and warning levels. + Shape: URIRef # A shape is a collection of constraints that may be targeted for certain nodes. + Target: URIRef # The base class of targets such as those based on SPARQL queries. + TargetType: URIRef # The (meta) class for parameterizable targets. Instances of this are instantiated as values of the sh:target property. + TripleRule: URIRef # A rule based on triple (subject, predicate, object) pattern. + ValidationReport: URIRef # The class of SHACL validation reports. + ValidationResult: URIRef # The class of validation results. + Validator: URIRef # The class of validators, which provide instructions on how to process a constraint definition. This class serves as base class for the SPARQL-based validators and other possible implementations. + + # http://www.w3.org/2000/01/rdf-schema#Resource + this: URIRef # A node expression that represents the current focus node. + + # http://www.w3.org/ns/shacl#ConstraintComponent + AndConstraintComponent: URIRef # A constraint component that can be used to test whether a value node conforms to all members of a provided list of shapes. + ClassConstraintComponent: URIRef # A constraint component that can be used to verify that each value node is an instance of a given type. + ClosedConstraintComponent: URIRef # A constraint component that can be used to indicate that focus nodes must only have values for those properties that have been explicitly enumerated via sh:property/sh:path. + DatatypeConstraintComponent: URIRef # A constraint component that can be used to restrict the datatype of all value nodes. + DisjointConstraintComponent: URIRef # A constraint component that can be used to verify that the set of value nodes is disjoint with the the set of nodes that have the focus node as subject and the value of a given property as predicate. + EqualsConstraintComponent: URIRef # A constraint component that can be used to verify that the set of value nodes is equal to the set of nodes that have the focus node as subject and the value of a given property as predicate. + ExpressionConstraintComponent: URIRef # A constraint component that can be used to verify that a given node expression produces true for all value nodes. + HasValueConstraintComponent: URIRef # A constraint component that can be used to verify that one of the value nodes is a given RDF node. + InConstraintComponent: URIRef # A constraint component that can be used to exclusively enumerate the permitted value nodes. + JSConstraintComponent: URIRef # A constraint component with the parameter sh:js linking to a sh:JSConstraint containing a sh:script. + LanguageInConstraintComponent: URIRef # A constraint component that can be used to enumerate language tags that all value nodes must have. + LessThanConstraintComponent: URIRef # A constraint component that can be used to verify that each value node is smaller than all the nodes that have the focus node as subject and the value of a given property as predicate. + LessThanOrEqualsConstraintComponent: URIRef # A constraint component that can be used to verify that every value node is smaller than all the nodes that have the focus node as subject and the value of a given property as predicate. + MaxCountConstraintComponent: URIRef # A constraint component that can be used to restrict the maximum number of value nodes. + MaxExclusiveConstraintComponent: URIRef # A constraint component that can be used to restrict the range of value nodes with a maximum exclusive value. + MaxInclusiveConstraintComponent: URIRef # A constraint component that can be used to restrict the range of value nodes with a maximum inclusive value. + MaxLengthConstraintComponent: URIRef # A constraint component that can be used to restrict the maximum string length of value nodes. + MinCountConstraintComponent: URIRef # A constraint component that can be used to restrict the minimum number of value nodes. + MinExclusiveConstraintComponent: URIRef # A constraint component that can be used to restrict the range of value nodes with a minimum exclusive value. + MinInclusiveConstraintComponent: URIRef # A constraint component that can be used to restrict the range of value nodes with a minimum inclusive value. + MinLengthConstraintComponent: URIRef # A constraint component that can be used to restrict the minimum string length of value nodes. + NodeConstraintComponent: URIRef # A constraint component that can be used to verify that all value nodes conform to the given node shape. + NodeKindConstraintComponent: URIRef # A constraint component that can be used to restrict the RDF node kind of each value node. + NotConstraintComponent: URIRef # A constraint component that can be used to verify that value nodes do not conform to a given shape. + OrConstraintComponent: URIRef # A constraint component that can be used to restrict the value nodes so that they conform to at least one out of several provided shapes. + PatternConstraintComponent: URIRef # A constraint component that can be used to verify that every value node matches a given regular expression. + PropertyConstraintComponent: URIRef # A constraint component that can be used to verify that all value nodes conform to the given property shape. + QualifiedMaxCountConstraintComponent: URIRef # A constraint component that can be used to verify that a specified maximum number of value nodes conforms to a given shape. + QualifiedMinCountConstraintComponent: URIRef # A constraint component that can be used to verify that a specified minimum number of value nodes conforms to a given shape. + SPARQLConstraintComponent: URIRef # A constraint component that can be used to define constraints based on SPARQL queries. + UniqueLangConstraintComponent: URIRef # A constraint component that can be used to specify that no pair of value nodes may use the same language tag. + XoneConstraintComponent: URIRef # A constraint component that can be used to restrict the value nodes so that they conform to exactly one out of several provided shapes. + + # http://www.w3.org/ns/shacl#NodeKind + BlankNode: URIRef # The node kind of all blank nodes. + BlankNodeOrIRI: URIRef # The node kind of all blank nodes or IRIs. + BlankNodeOrLiteral: URIRef # The node kind of all blank nodes or literals. + IRI: URIRef # The node kind of all IRIs. + IRIOrLiteral: URIRef # The node kind of all IRIs or literals. + Literal: URIRef # The node kind of all literals. + + # http://www.w3.org/ns/shacl#Parameter + + # http://www.w3.org/ns/shacl#Severity + Info: URIRef # The severity for an informational validation result. + Violation: URIRef # The severity for a violation validation result. + Warning: URIRef # The severity for a warning validation result. + + # Valid non-python identifiers + _extras = [ + "and", + "class", + "in", + "not", + "or", + "AndConstraintComponent-and", + "ClassConstraintComponent-class", + "ClosedConstraintComponent-closed", + "ClosedConstraintComponent-ignoredProperties", + "DatatypeConstraintComponent-datatype", + "DisjointConstraintComponent-disjoint", + "EqualsConstraintComponent-equals", + "ExpressionConstraintComponent-expression", + "HasValueConstraintComponent-hasValue", + "InConstraintComponent-in", + "JSConstraint-js", + "LanguageInConstraintComponent-languageIn", + "LessThanConstraintComponent-lessThan", + "LessThanOrEqualsConstraintComponent-lessThanOrEquals", + "MaxCountConstraintComponent-maxCount", + "MaxExclusiveConstraintComponent-maxExclusive", + "MaxInclusiveConstraintComponent-maxInclusive", + "MaxLengthConstraintComponent-maxLength", + "MinCountConstraintComponent-minCount", + "MinExclusiveConstraintComponent-minExclusive", + "MinInclusiveConstraintComponent-minInclusive", + "MinLengthConstraintComponent-minLength", + "NodeConstraintComponent-node", + "NodeKindConstraintComponent-nodeKind", + "NotConstraintComponent-not", + "OrConstraintComponent-or", + "PatternConstraintComponent-flags", + "PatternConstraintComponent-pattern", + "PropertyConstraintComponent-property", + "QualifiedMaxCountConstraintComponent-qualifiedMaxCount", + "QualifiedMaxCountConstraintComponent-qualifiedValueShape", + "QualifiedMaxCountConstraintComponent-qualifiedValueShapesDisjoint", + "QualifiedMinCountConstraintComponent-qualifiedMinCount", + "QualifiedMinCountConstraintComponent-qualifiedValueShape", + "QualifiedMinCountConstraintComponent-qualifiedValueShapesDisjoint", + "SPARQLConstraintComponent-sparql", + "UniqueLangConstraintComponent-uniqueLang", + "XoneConstraintComponent-xone", + ] + + _NS = Namespace("http://www.w3.org/ns/shacl#") diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_SKOS.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_SKOS.py new file mode 100644 index 0000000000000000000000000000000000000000..e87df6f0916a7efc9ad9e692d7ef2c7dc63de4de --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_SKOS.py @@ -0,0 +1,66 @@ +from rdflib.namespace import DefinedNamespace, Namespace +from rdflib.term import URIRef + + +class SKOS(DefinedNamespace): + """ + SKOS Vocabulary + + An RDF vocabulary for describing the basic structure and content of concept schemes such as thesauri, + classification schemes, subject heading lists, taxonomies, 'folksonomies', other types of controlled + vocabulary, and also concept schemes embedded in glossaries and terminologies. + + Generated from: https://www.w3.org/2009/08/skos-reference/skos.rdf + Date: 2020-05-26 14:20:08.489187 + + """ + + _fail = True + + # http://www.w3.org/1999/02/22-rdf-syntax-ns#Property + altLabel: URIRef # An alternative lexical label for a resource. + broadMatch: URIRef # skos:broadMatch is used to state a hierarchical mapping link between two conceptual resources in different concept schemes. + broader: URIRef # Relates a concept to a concept that is more general in meaning. + broaderTransitive: ( + URIRef # skos:broaderTransitive is a transitive superproperty of skos:broader. + ) + changeNote: URIRef # A note about a modification to a concept. + closeMatch: URIRef # skos:closeMatch is used to link two concepts that are sufficiently similar that they can be used interchangeably in some information retrieval applications. In order to avoid the possibility of "compound errors" when combining mappings across more than two concept schemes, skos:closeMatch is not declared to be a transitive property. + definition: URIRef # A statement or formal explanation of the meaning of a concept. + editorialNote: ( + URIRef # A note for an editor, translator or maintainer of the vocabulary. + ) + exactMatch: URIRef # skos:exactMatch is used to link two concepts, indicating a high degree of confidence that the concepts can be used interchangeably across a wide range of information retrieval applications. skos:exactMatch is a transitive property, and is a sub-property of skos:closeMatch. + example: URIRef # An example of the use of a concept. + hasTopConcept: URIRef # Relates, by convention, a concept scheme to a concept which is topmost in the broader/narrower concept hierarchies for that scheme, providing an entry point to these hierarchies. + hiddenLabel: URIRef # A lexical label for a resource that should be hidden when generating visual displays of the resource, but should still be accessible to free text search operations. + historyNote: URIRef # A note about the past state/use/meaning of a concept. + inScheme: URIRef # Relates a resource (for example a concept) to a concept scheme in which it is included. + mappingRelation: URIRef # Relates two concepts coming, by convention, from different schemes, and that have comparable meanings + member: URIRef # Relates a collection to one of its members. + memberList: ( + URIRef # Relates an ordered collection to the RDF list containing its members. + ) + narrowMatch: URIRef # skos:narrowMatch is used to state a hierarchical mapping link between two conceptual resources in different concept schemes. + narrower: URIRef # Relates a concept to a concept that is more specific in meaning. + narrowerTransitive: URIRef # skos:narrowerTransitive is a transitive superproperty of skos:narrower. + notation: URIRef # A notation, also known as classification code, is a string of characters such as "T58.5" or "303.4833" used to uniquely identify a concept within the scope of a given concept scheme. + note: URIRef # A general note, for any purpose. + prefLabel: ( + URIRef # The preferred lexical label for a resource, in a given language. + ) + related: URIRef # Relates a concept to a concept with which there is an associative semantic relationship. + relatedMatch: URIRef # skos:relatedMatch is used to state an associative mapping link between two conceptual resources in different concept schemes. + scopeNote: ( + URIRef # A note that helps to clarify the meaning and/or the use of a concept. + ) + semanticRelation: URIRef # Links a concept to a concept related by meaning. + topConceptOf: URIRef # Relates a concept to the concept scheme that it is a top level concept of. + + # http://www.w3.org/2002/07/owl#Class + Collection: URIRef # A meaningful collection of concepts. + Concept: URIRef # An idea or notion; a unit of thought. + ConceptScheme: URIRef # A set of concepts, optionally including statements about semantic relationships between those concepts. + OrderedCollection: URIRef # An ordered collection of concepts, where both the grouping and the ordering are meaningful. + + _NS = Namespace("http://www.w3.org/2004/02/skos/core#") diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_SOSA.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_SOSA.py new file mode 100644 index 0000000000000000000000000000000000000000..9f281d56d6879eaf339a02ef4edb71744a171e5e --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_SOSA.py @@ -0,0 +1,68 @@ +from rdflib.namespace import DefinedNamespace, Namespace +from rdflib.term import URIRef + + +class SOSA(DefinedNamespace): + """ + Sensor, Observation, Sample, and Actuator (SOSA) Ontology + + This ontology is based on the SSN Ontology by the W3C Semantic Sensor Networks Incubator Group (SSN-XG), + together with considerations from the W3C/OGC Spatial Data on the Web Working Group. + + Generated from: http://www.w3.org/ns/sosa/ + Date: 2020-05-26 14:20:08.792504 + + """ + + # http://www.w3.org/2000/01/rdf-schema#Class + ActuatableProperty: URIRef # An actuatable quality (property, characteristic) of a FeatureOfInterest. + Actuation: URIRef # An Actuation carries out an (Actuation) Procedure to change the state of the world using an Actuator. + Actuator: URIRef # A device that is used by, or implements, an (Actuation) Procedure that changes the state of the world. + FeatureOfInterest: URIRef # The thing whose property is being estimated or calculated in the course of an Observation to arrive at a Result or whose property is being manipulated by an Actuator, or which is being sampled or transformed in an act of Sampling. + ObservableProperty: URIRef # An observable quality (property, characteristic) of a FeatureOfInterest. + Observation: URIRef # Act of carrying out an (Observation) Procedure to estimate or calculate a value of a property of a FeatureOfInterest. Links to a Sensor to describe what made the Observation and how; links to an ObservableProperty to describe what the result is an estimate of, and to a FeatureOfInterest to detail what that property was associated with. + ObservationCollection: URIRef # Collection of one or more observations, whose members share a common value for one or more property + Platform: URIRef # A Platform is an entity that hosts other entities, particularly Sensors, Actuators, Samplers, and other Platforms. + Procedure: URIRef # A workflow, protocol, plan, algorithm, or computational method specifying how to make an Observation, create a Sample, or make a change to the state of the world (via an Actuator). A Procedure is re-usable, and might be involved in many Observations, Samplings, or Actuations. It explains the steps to be carried out to arrive at reproducible results. + Result: URIRef # The Result of an Observation, Actuation, or act of Sampling. To store an observation's simple result value one can use the hasSimpleResult property. + Sample: URIRef # Feature which is intended to be representative of a FeatureOfInterest on which Observations may be made. + Sampler: URIRef # A device that is used by, or implements, a Sampling Procedure to create or transform one or more samples. + Sampling: URIRef # An act of Sampling carries out a sampling Procedure to create or transform one or more samples. + Sensor: URIRef # Device, agent (including humans), or software (simulation) involved in, or implementing, a Procedure. Sensors respond to a stimulus, e.g., a change in the environment, or input data composed from the results of prior Observations, and generate a Result. Sensors can be hosted by Platforms. + + # http://www.w3.org/2002/07/owl#DatatypeProperty + hasSimpleResult: ( + URIRef # The simple value of an Observation or Actuation or act of Sampling. + ) + resultTime: URIRef # The result time is the instant of time when the Observation, Actuation or Sampling activity was completed. + + # http://www.w3.org/2002/07/owl#ObjectProperty + actsOnProperty: URIRef # Relation between an Actuation and the property of a FeatureOfInterest it is acting upon. + hasFeatureOfInterest: URIRef # A relation between an Observation and the entity whose quality was observed, or between an Actuation and the entity whose property was modified, or between an act of Sampling and the entity that was sampled. + hasMember: URIRef # Link to a member of a collection of observations that share the same value for one or more of the characteristic properties + hasOriginalSample: URIRef # link to the original sample that is related to the context sample through a chain of isSampleOf relations + hasResult: URIRef # Relation linking an Observation or Actuation or act of Sampling and a Result or Sample. + hasSample: URIRef # Relation between a FeatureOfInterest and the Sample used to represent it. + hasSampledFeature: URIRef # link to the ultimate feature of interest of the context sample - i.e. the end of a chain of isSampleOf relations + hasUltimateFeatureOfInterest: URIRef # link to the ultimate feature of interest of an observation or act of sampling. This is useful when the proximate feature of interest is a sample of the ultimate feature of interest, directly or trasntitively. + hosts: URIRef # Relation between a Platform and a Sensor, Actuator, Sampler, or Platform, hosted or mounted on it. + isActedOnBy: URIRef # Relation between an ActuatableProperty of a FeatureOfInterest and an Actuation changing its state. + isFeatureOfInterestOf: URIRef # A relation between a FeatureOfInterest and an Observation about it, an Actuation acting on it, or an act of Sampling that sampled it. + isHostedBy: URIRef # Relation between a Sensor, Actuator, Sampler, or Platform, and the Platform that it is mounted on or hosted by. + isObservedBy: URIRef # Relation between an ObservableProperty and the Sensor able to observe it. + isResultOf: URIRef # Relation linking a Result to the Observation or Actuation or act of Sampling that created or caused it. + isSampleOf: URIRef # Relation from a Sample to the FeatureOfInterest that it is intended to be representative of. + madeActuation: URIRef # Relation between an Actuator and the Actuation it has made. + madeByActuator: URIRef # Relation linking an Actuation to the Actuator that made that Actuation. + madeBySampler: URIRef # Relation linking an act of Sampling to the Sampler (sampling device or entity) that made it. + madeBySensor: URIRef # Relation between an Observation and the Sensor which made the Observation. + madeObservation: ( + URIRef # Relation between a Sensor and an Observation made by the Sensor. + ) + madeSampling: URIRef # Relation between a Sampler (sampling device or entity) and the Sampling act it performed. + observedProperty: URIRef # Relation linking an Observation to the property that was observed. The ObservableProperty should be a property of the FeatureOfInterest (linked by hasFeatureOfInterest) of this Observation. + observes: URIRef # Relation between a Sensor and an ObservableProperty that it is capable of sensing. + phenomenonTime: URIRef # The time that the Result of an Observation, Actuation or Sampling applies to the FeatureOfInterest. Not necessarily the same as the resultTime. May be an Interval or an Instant, or some other compound TemporalEntity. + usedProcedure: URIRef # A relation to link to a re-usable Procedure used in making an Observation, an Actuation, or a Sample, typically through a Sensor, Actuator or Sampler. + + _NS = Namespace("http://www.w3.org/ns/sosa/") diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_SSN.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_SSN.py new file mode 100644 index 0000000000000000000000000000000000000000..5f1851179ee2d912763ba752b526f06607c6bf0c --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_SSN.py @@ -0,0 +1,46 @@ +from rdflib.namespace import DefinedNamespace, Namespace +from rdflib.term import URIRef + + +class SSN(DefinedNamespace): + """ + Semantic Sensor Network Ontology + + This ontology describes sensors, actuators and observations, and related concepts. It does not describe domain + concepts, time, locations, etc. these are intended to be included from other ontologies via OWL imports. + + Generated from: http://www.w3.org/ns/ssn/ + Date: 2020-05-26 14:20:09.068204 + + """ + + # http://www.w3.org/2002/07/owl#Class + Deployment: URIRef # Describes the Deployment of one or more Systems for a particular purpose. Deployment may be done on a Platform. + Input: URIRef # Any information that is provided to a Procedure for its use. + Output: URIRef # Any information that is reported from a Procedure. + Property: URIRef # A quality of an entity. An aspect of an entity that is intrinsic to and cannot exist without the entity. + Stimulus: URIRef # An event in the real world that 'triggers' the Sensor. The properties associated to the Stimulus may be different to the eventual observed ObservableProperty. It is the event, not the object, that triggers the Sensor. + System: URIRef # System is a unit of abstraction for pieces of infrastructure that implement Procedures. A System may have components, its subsystems, which are other systems. + + # http://www.w3.org/2002/07/owl#FunctionalProperty + wasOriginatedBy: ( + URIRef # Relation between an Observation and the Stimulus that originated it. + ) + + # http://www.w3.org/2002/07/owl#ObjectProperty + deployedOnPlatform: URIRef # Relation between a Deployment and the Platform on which the Systems are deployed. + deployedSystem: URIRef # Relation between a Deployment and a deployed System. + detects: URIRef # A relation from a Sensor to the Stimulus that the Sensor detects. The Stimulus itself will be serving as a proxy for some ObservableProperty. + forProperty: URIRef # A relation between some aspect of an entity and a Property. + hasDeployment: URIRef # Relation between a System and a Deployment, recording that the System is deployed in that Deployment. + hasInput: URIRef # Relation between a Procedure and an Input to it. + hasOutput: URIRef # Relation between a Procedure and an Output of it. + hasProperty: URIRef # Relation between an entity and a Property of that entity. + hasSubSystem: URIRef # Relation between a System and its component parts. + implementedBy: URIRef # Relation between a Procedure (an algorithm, procedure or method) and an entity that implements that Procedure in some executable way. + implements: URIRef # Relation between an entity that implements a Procedure in some executable way and the Procedure (an algorithm, procedure or method). + inDeployment: URIRef # Relation between a Platform and a Deployment, meaning that the deployedSystems of the Deployment are hosted on the Platform. + isPropertyOf: URIRef # Relation between a Property and the entity it belongs to. + isProxyFor: URIRef # A relation from a Stimulus to the Property that the Stimulus is serving as a proxy for. + + _NS = Namespace("http://www.w3.org/ns/ssn/") diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_TIME.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_TIME.py new file mode 100644 index 0000000000000000000000000000000000000000..0370180eca9388df1b91ff62cd3f23f0a59c2b94 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_TIME.py @@ -0,0 +1,135 @@ +from rdflib.namespace import DefinedNamespace, Namespace +from rdflib.term import URIRef + + +class TIME(DefinedNamespace): + """ + OWL-Time + + Generated from: http://www.w3.org/2006/time# + Date: 2020-05-26 14:20:10.531265 + + """ + + # http://www.w3.org/2000/01/rdf-schema#Datatype + generalDay: URIRef # Day of month - formulated as a text string with a pattern constraint to reproduce the same lexical form as gDay, except that values up to 99 are permitted, in order to support calendars with more than 31 days in a month. Note that the value-space is not defined, so a generic OWL2 processor cannot compute ordering relationships of values of this type. + generalMonth: URIRef # Month of year - formulated as a text string with a pattern constraint to reproduce the same lexical form as gMonth, except that values up to 20 are permitted, in order to support calendars with more than 12 months in the year. Note that the value-space is not defined, so a generic OWL2 processor cannot compute ordering relationships of values of this type. + generalYear: URIRef # Year number - formulated as a text string with a pattern constraint to reproduce the same lexical form as gYear, but not restricted to values from the Gregorian calendar. Note that the value-space is not defined, so a generic OWL2 processor cannot compute ordering relationships of values of this type. + + # http://www.w3.org/2002/07/owl#Class + DateTimeDescription: URIRef # Description of date and time structured with separate values for the various elements of a calendar-clock system. The temporal reference system is fixed to Gregorian Calendar, and the range of year, month, day properties restricted to corresponding XML Schema types xsd:gYear, xsd:gMonth and xsd:gDay, respectively. + DateTimeInterval: URIRef # DateTimeInterval is a subclass of ProperInterval, defined using the multi-element DateTimeDescription. + DayOfWeek: URIRef # The day of week + Duration: URIRef # Duration of a temporal extent expressed as a number scaled by a temporal unit + DurationDescription: URIRef # Description of temporal extent structured with separate values for the various elements of a calendar-clock system. The temporal reference system is fixed to Gregorian Calendar, and the range of each of the numeric properties is restricted to xsd:decimal + GeneralDateTimeDescription: URIRef # Description of date and time structured with separate values for the various elements of a calendar-clock system + GeneralDurationDescription: URIRef # Description of temporal extent structured with separate values for the various elements of a calendar-clock system. + Instant: URIRef # A temporal entity with zero extent or duration + Interval: URIRef # A temporal entity with an extent or duration + MonthOfYear: URIRef # The month of the year + ProperInterval: URIRef # A temporal entity with non-zero extent or duration, i.e. for which the value of the beginning and end are different + TRS: URIRef # A temporal reference system, such as a temporal coordinate system (with an origin, direction, and scale), a calendar-clock combination, or a (possibly hierarchical) ordinal system. This is a stub class, representing the set of all temporal reference systems. + TemporalDuration: URIRef # Time extent; duration of a time interval separate from its particular start position + TemporalEntity: URIRef # A temporal interval or instant. + TemporalPosition: URIRef # A position on a time-line + TemporalUnit: URIRef # A standard duration, which provides a scale factor for a time extent, or the granularity or precision for a time position. + TimePosition: URIRef # A temporal position described using either a (nominal) value from an ordinal reference system, or a (numeric) value in a temporal coordinate system. + TimeZone: URIRef # A Time Zone specifies the amount by which the local time is offset from UTC. A time zone is usually denoted geographically (e.g. Australian Eastern Daylight Time), with a constant value in a given region. The region where it applies and the offset from UTC are specified by a locally recognised governing authority. + + # http://www.w3.org/2002/07/owl#DatatypeProperty + day: URIRef # Day position in a calendar-clock system. The range of this property is not specified, so can be replaced by any specific representation of a calendar day from any calendar. + dayOfYear: URIRef # The number of the day within the year + days: URIRef # length of, or element of the length of, a temporal extent expressed in days + hasXSDDuration: URIRef # Extent of a temporal entity, expressed using xsd:duration + hour: URIRef # Hour position in a calendar-clock system. + hours: URIRef # length of, or element of the length of, a temporal extent expressed in hours + inXSDDate: URIRef # Position of an instant, expressed using xsd:date + inXSDDateTimeStamp: ( + URIRef # Position of an instant, expressed using xsd:dateTimeStamp + ) + inXSDgYear: URIRef # Position of an instant, expressed using xsd:gYear + inXSDgYearMonth: URIRef # Position of an instant, expressed using xsd:gYearMonth + minute: URIRef # Minute position in a calendar-clock system. + minutes: URIRef # length, or element of, a temporal extent expressed in minutes + month: URIRef # Month position in a calendar-clock system. The range of this property is not specified, so can be replaced by any specific representation of a calendar month from any calendar. + months: URIRef # length of, or element of the length of, a temporal extent expressed in months + nominalPosition: URIRef # The (nominal) value indicating temporal position in an ordinal reference system + numericDuration: URIRef # Value of a temporal extent expressed as a decimal number scaled by a temporal unit + numericPosition: URIRef # The (numeric) value indicating position within a temporal coordinate system + second: URIRef # Second position in a calendar-clock system. + seconds: URIRef # length of, or element of the length of, a temporal extent expressed in seconds + week: URIRef # Week number within the year. + weeks: URIRef # length of, or element of the length of, a temporal extent expressed in weeks + year: URIRef # Year position in a calendar-clock system. The range of this property is not specified, so can be replaced by any specific representation of a calendar year from any calendar. + years: URIRef # length of, or element of the length of, a temporal extent expressed in years + + # http://www.w3.org/2002/07/owl#DeprecatedClass + January: URIRef # January + Year: URIRef # Year duration + + # http://www.w3.org/2002/07/owl#DeprecatedProperty + inXSDDateTime: URIRef # Position of an instant, expressed using xsd:dateTime + xsdDateTime: URIRef # Value of DateTimeInterval expressed as a compact value. + + # http://www.w3.org/2002/07/owl#FunctionalProperty + hasTRS: URIRef # The temporal reference system used by a temporal position or extent description. + + # http://www.w3.org/2002/07/owl#ObjectProperty + after: URIRef # Gives directionality to time. If a temporal entity T1 is after another temporal entity T2, then the beginning of T1 is after the end of T2. + dayOfWeek: ( + URIRef # The day of week, whose value is a member of the class time:DayOfWeek + ) + hasBeginning: URIRef # Beginning of a temporal entity. + hasDateTimeDescription: URIRef # Value of DateTimeInterval expressed as a structured value. The beginning and end of the interval coincide with the limits of the shortest element in the description. + hasDuration: URIRef # Duration of a temporal entity, event or activity, or thing, expressed as a scaled value + hasDurationDescription: URIRef # Duration of a temporal entity, expressed using a structured description + hasEnd: URIRef # End of a temporal entity. + hasTemporalDuration: URIRef # Duration of a temporal entity. + hasTime: URIRef # Supports the association of a temporal entity (instant or interval) to any thing + inDateTime: ( + URIRef # Position of an instant, expressed using a structured description + ) + inTemporalPosition: URIRef # Position of a time instant + inTimePosition: URIRef # Position of a time instant expressed as a TimePosition + inside: URIRef # An instant that falls inside the interval. It is not intended to include beginnings and ends of intervals. + intervalAfter: URIRef # If a proper interval T1 is intervalAfter another proper interval T2, then the beginning of T1 is after the end of T2. + intervalBefore: URIRef # If a proper interval T1 is intervalBefore another proper interval T2, then the end of T1 is before the beginning of T2. + intervalContains: URIRef # If a proper interval T1 is intervalContains another proper interval T2, then the beginning of T1 is before the beginning of T2, and the end of T1 is after the end of T2. + intervalDisjoint: URIRef # If a proper interval T1 is intervalDisjoint another proper interval T2, then the beginning of T1 is after the end of T2, or the end of T1 is before the beginning of T2, i.e. the intervals do not overlap in any way, but their ordering relationship is not known. + intervalDuring: URIRef # If a proper interval T1 is intervalDuring another proper interval T2, then the beginning of T1 is after the beginning of T2, and the end of T1 is before the end of T2. + intervalEquals: URIRef # If a proper interval T1 is intervalEquals another proper interval T2, then the beginning of T1 is coincident with the beginning of T2, and the end of T1 is coincident with the end of T2. + intervalFinishedBy: URIRef # If a proper interval T1 is intervalFinishedBy another proper interval T2, then the beginning of T1 is before the beginning of T2, and the end of T1 is coincident with the end of T2. + intervalFinishes: URIRef # If a proper interval T1 is intervalFinishes another proper interval T2, then the beginning of T1 is after the beginning of T2, and the end of T1 is coincident with the end of T2. + intervalIn: URIRef # If a proper interval T1 is intervalIn another proper interval T2, then the beginning of T1 is after the beginning of T2 or is coincident with the beginning of T2, and the end of T1 is before the end of T2, or is coincident with the end of T2, except that end of T1 may not be coincident with the end of T2 if the beginning of T1 is coincident with the beginning of T2. + intervalMeets: URIRef # If a proper interval T1 is intervalMeets another proper interval T2, then the end of T1 is coincident with the beginning of T2. + intervalMetBy: URIRef # If a proper interval T1 is intervalMetBy another proper interval T2, then the beginning of T1 is coincident with the end of T2. + intervalOverlappedBy: URIRef # If a proper interval T1 is intervalOverlappedBy another proper interval T2, then the beginning of T1 is after the beginning of T2, the beginning of T1 is before the end of T2, and the end of T1 is after the end of T2. + intervalOverlaps: URIRef # If a proper interval T1 is intervalOverlaps another proper interval T2, then the beginning of T1 is before the beginning of T2, the end of T1 is after the beginning of T2, and the end of T1 is before the end of T2. + intervalStartedBy: URIRef # If a proper interval T1 is intervalStarted another proper interval T2, then the beginning of T1 is coincident with the beginning of T2, and the end of T1 is after the end of T2. + intervalStarts: URIRef # If a proper interval T1 is intervalStarts another proper interval T2, then the beginning of T1 is coincident with the beginning of T2, and the end of T1 is before the end of T2. + monthOfYear: URIRef # The month of the year, whose value is a member of the class time:MonthOfYear + timeZone: URIRef # The time zone for clock elements in the temporal position + unitType: URIRef # The temporal unit which provides the precision of a date-time value or scale of a temporal extent + + # http://www.w3.org/2002/07/owl#TransitiveProperty + before: URIRef # Gives directionality to time. If a temporal entity T1 is before another temporal entity T2, then the end of T1 is before the beginning of T2. Thus, "before" can be considered to be basic to instants and derived for intervals. + + # http://www.w3.org/2006/time#DayOfWeek + Friday: URIRef # Friday + Monday: URIRef # Monday + Saturday: URIRef # Saturday + Sunday: URIRef # Sunday + Thursday: URIRef # Thursday + Tuesday: URIRef # Tuesday + Wednesday: URIRef # Wednesday + + # http://www.w3.org/2006/time#TemporalUnit + unitDay: URIRef # day + unitHour: URIRef # hour + unitMinute: URIRef # minute + unitMonth: URIRef # month + unitSecond: URIRef # second + unitWeek: URIRef # week + unitYear: URIRef # year + + _NS = Namespace("http://www.w3.org/2006/time#") diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_VANN.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_VANN.py new file mode 100644 index 0000000000000000000000000000000000000000..95ee40db8e6b195eae22e444688e66821c5ccd23 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_VANN.py @@ -0,0 +1,27 @@ +from rdflib.namespace import DefinedNamespace, Namespace +from rdflib.term import URIRef + + +class VANN(DefinedNamespace): + """ + VANN: A vocabulary for annotating vocabulary descriptions + + This document describes a vocabulary for annotating descriptions of vocabularies with examples and usage + notes. + + Generated from: https://vocab.org/vann/vann-vocab-20100607.rdf + Date: 2020-05-26 14:21:15.580430 + + """ + + _fail = True + + # http://www.w3.org/2002/07/owl#AnnotationProperty + changes: URIRef # A reference to a resource that describes changes between this version of a vocabulary and the previous. + example: URIRef # A reference to a resource that provides an example of how this resource can be used. + preferredNamespacePrefix: URIRef # The preferred namespace prefix to use when using terms from this vocabulary in an XML document. + preferredNamespaceUri: URIRef # The preferred namespace URI to use when using terms from this vocabulary in an XML document. + termGroup: URIRef # A group of related terms in a vocabulary. + usageNote: URIRef # A reference to a resource that provides information on how this resource is to be used. + + _NS = Namespace("http://purl.org/vocab/vann/") diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_VOID.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_VOID.py new file mode 100644 index 0000000000000000000000000000000000000000..5905e789dae1f9fd95573c4196a8c852ab1a7247 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_VOID.py @@ -0,0 +1,65 @@ +from rdflib.namespace import DefinedNamespace, Namespace +from rdflib.term import URIRef + + +class VOID(DefinedNamespace): + """ + Vocabulary of Interlinked Datasets (VoID) + + The Vocabulary of Interlinked Datasets (VoID) is an RDF Schema vocabulary for expressing metadata about RDF + datasets. It is intended as a bridge between the publishers and users of RDF data, with applications ranging + from data discovery to cataloging and archiving of datasets. This document provides a formal definition of the + new RDF classes and properties introduced for VoID. It is a companion to the main specification document for + VoID, Describing Linked Datasets with the VoID Vocabulary. + + Generated from: http://rdfs.org/ns/void# + Date: 2020-05-26 14:20:11.911298 + + """ + + _fail = True + + # http://www.w3.org/1999/02/22-rdf-syntax-ns#Property + classPartition: URIRef # A subset of a void:Dataset that contains only the entities of a certain rdfs:Class. + classes: URIRef # The total number of distinct classes in a void:Dataset. In other words, the number of distinct resources occurring as objects of rdf:type triples in the dataset. + dataDump: URIRef # An RDF dump, partial or complete, of a void:Dataset. + distinctObjects: URIRef # The total number of distinct objects in a void:Dataset. In other words, the number of distinct resources that occur in the object position of triples in the dataset. Literals are included in this count. + distinctSubjects: URIRef # The total number of distinct subjects in a void:Dataset. In other words, the number of distinct resources that occur in the subject position of triples in the dataset. + documents: URIRef # The total number of documents, for datasets that are published as a set of individual documents, such as RDF/XML documents or RDFa-annotated web pages. Non-RDF documents, such as web pages in HTML or images, are usually not included in this count. This property is intended for datasets where the total number of triples or entities is hard to determine. void:triples or void:entities should be preferred where practical. + entities: ( + URIRef # The total number of entities that are described in a void:Dataset. + ) + exampleResource: URIRef # example resource of dataset + feature: URIRef # feature + inDataset: URIRef # Points to the void:Dataset that a document is a part of. + linkPredicate: URIRef # a link predicate + objectsTarget: URIRef # The dataset describing the objects of the triples contained in the Linkset. + openSearchDescription: URIRef # An OpenSearch description document for a free-text search service over a void:Dataset. + properties: URIRef # The total number of distinct properties in a void:Dataset. In other words, the number of distinct resources that occur in the predicate position of triples in the dataset. + property: URIRef # The rdf:Property that is the predicate of all triples in a property-based partition. + propertyPartition: URIRef # A subset of a void:Dataset that contains only the triples of a certain rdf:Property. + rootResource: URIRef # A top concept or entry point for a void:Dataset that is structured in a tree-like fashion. All resources in a dataset can be reached by following links from its root resources in a small number of steps. + sparqlEndpoint: URIRef # has a SPARQL endpoint at + subjectsTarget: URIRef # The dataset describing the subjects of triples contained in the Linkset. + subset: URIRef # has subset + target: URIRef # One of the two datasets linked by the Linkset. + triples: URIRef # The total number of triples contained in a void:Dataset. + uriLookupEndpoint: ( + URIRef # Defines a simple URI look-up protocol for accessing a dataset. + ) + uriRegexPattern: ( + URIRef # Defines a regular expression pattern matching URIs in the dataset. + ) + uriSpace: URIRef # A URI that is a common string prefix of all the entity URIs in a void:Dataset. + vocabulary: URIRef # A vocabulary that is used in the dataset. + + # http://www.w3.org/2000/01/rdf-schema#Class + Dataset: URIRef # A set of RDF triples that are published, maintained or aggregated by a single provider. + DatasetDescription: URIRef # A web resource whose foaf:primaryTopic or foaf:topics include void:Datasets. + Linkset: URIRef # A collection of RDF links between two void:Datasets. + TechnicalFeature: URIRef # A technical feature of a void:Dataset, such as a supported RDF serialization format. + + # Valid non-python identifiers + _extras = ["class"] + + _NS = Namespace("http://rdfs.org/ns/void#") diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_WGS.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_WGS.py new file mode 100644 index 0000000000000000000000000000000000000000..1416154cd895388b3aaf400345d4241f6ec3889e --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_WGS.py @@ -0,0 +1,25 @@ +from rdflib.namespace import DefinedNamespace, Namespace +from rdflib.term import URIRef + + +class WGS(DefinedNamespace): + """ + Basic Geo (WGS84 lat/long) Vocabulary + + The HTML Specification for the vocabulary can be found + here . + """ + + _NS = Namespace("https://www.w3.org/2003/01/geo/wgs84_pos#") + + # http://www.w3.org/2000/01/rdf-schema#Class + SpatialThing: URIRef + Point: URIRef + + # http://www.w3.org/2002/07/owl#DatatypeProperty + alt: URIRef + + lat: URIRef # http://www.w3.org/2003/01/geo/wgs84_pos#lat + lat_long: URIRef + location: URIRef + long: URIRef diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_XSD.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_XSD.py new file mode 100644 index 0000000000000000000000000000000000000000..f12524ff2d9278bcfaabd1cbd5f30f8eb04e7a74 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/_XSD.py @@ -0,0 +1,103 @@ +from rdflib.namespace import DefinedNamespace, Namespace +from rdflib.term import URIRef + + +class XSD(DefinedNamespace): + """ + W3C XML Schema Definition Language (XSD) 1.1 Part 2: Datatypes + + Generated from: ../schemas/datatypes.xsd + Date: 2021-09-05 20:37+10 + + """ + + _NS = Namespace("http://www.w3.org/2001/XMLSchema#") + + ENTITIES: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#ENTITIES + ENTITY: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#ENTITY + ID: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#ID + IDREF: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#IDREF + IDREFS: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#IDREFS + NCName: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#NCName + NMTOKEN: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#NMTOKEN + NMTOKENS: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#NMTOKENS + NOTATION: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#NOTATIONNOTATION cannot be used directly in a schema; rather a type + Name: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#Name + QName: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#QName + anyURI: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#anyURI + base64Binary: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#base64Binary + boolean: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#boolean + byte: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#byte + date: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#date + dateTime: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#dateTime + dateTimeStamp: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#dateTimeStamp + dayTimeDuration: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#dayTimeDuration + decimal: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#decimal + double: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#double + duration: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#duration + float: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#float + gDay: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#gDay + gMonth: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#gMonth + gMonthDay: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#gMonthDay + gYear: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#gYear + gYearMonth: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#gYearMonth + hexBinary: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#binary + int: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#int + integer: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#integer + language: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#language + long: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#long + negativeInteger: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#negativeInteger + nonNegativeInteger: ( + URIRef # see: http://www.w3.org/TR/xmlschema11-2/#nonNegativeInteger + ) + nonPositiveInteger: ( + URIRef # see: http://www.w3.org/TR/xmlschema11-2/#nonPositiveInteger + ) + normalizedString: ( + URIRef # see: http://www.w3.org/TR/xmlschema11-2/#normalizedString + ) + positiveInteger: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#positiveInteger + short: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#short + string: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#string + time: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#time + token: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#token + unsignedByte: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#unsignedByte + unsignedInt: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#unsignedInt + unsignedLong: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#unsignedLong + unsignedShort: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#unsignedShort + yearMonthDuration: ( + URIRef # see: http://www.w3.org/TR/xmlschema11-2/#yearMonthDuration + ) + + # fundamental facets - https://www.w3.org/TR/xmlschema11-2/#rf-fund-facets + ordered: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#rf-ordered + bounded: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#rf-bounded + cardinality: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#rf-cardinality + numeric: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#rf-numeric + + # constraining facets - https://www.w3.org/TR/xmlschema11-2/#rf-facets + length: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#rf-length + minLength: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#rf-minLength + maxLength: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#rf-maxLength + pattern: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#rf-pattern + enumeration: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#rf-enumeration + whiteSpace: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#rf-whiteSpace + maxExclusive: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#rf-maxExclusive + maxInclusive: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#rf-maxInclusive + minExclusive: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#rf-minExclusive + minInclusive: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#rf-minInclusive + totalDigits: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#rf-totalDigits + fractionDigits: URIRef # see: http://www.w3.org/TR/xmlschema11-2/#rf-fractionDigits + Assertions: URIRef # see: https://www.w3.org/TR/xmlschema11-2/#rf-assertions + explicitTimezone: ( + URIRef # see: http://www.w3.org/TR/xmlschema11-2/#rf-explicitTimezone + ) + + # The Seven-property Model - https://www.w3.org/TR/xmlschema11-2/#theSevenPropertyModel + year: URIRef # see: https://www.w3.org/TR/xmlschema11-2/#vp-dt-http://www.w3.org/TR/xmlschema11-2/#rf-whiteSpace + month: URIRef # see: https://www.w3.org/TR/xmlschema11-2/#vp-dt-month + day: URIRef # see: https://www.w3.org/TR/xmlschema11-2/#vp-dt-day + hour: URIRef # see: https://www.w3.org/TR/xmlschema11-2/#vp-dt-hour + minute: URIRef # see: https://www.w3.org/TR/xmlschema11-2/#vp-dt-minute + second: URIRef # see: https://www.w3.org/TR/xmlschema11-2/#vp-dt-second + timezoneOffset: URIRef # see: https://www.w3.org/TR/xmlschema11-2/#vp-dt-timezone diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__init__.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e3d3e88cdc9d6cc47752bc228881a2509eea7cde --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__init__.py @@ -0,0 +1,1032 @@ +""" +# Namespace Utilities + +RDFLib provides mechanisms for managing Namespaces. + +In particular, there is a [`Namespace`][rdflib.namespace.Namespace] class +that takes as its argument the base URI of the namespace. + +```python +>>> from rdflib.namespace import Namespace +>>> RDFS = Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#") + +``` + +Fully qualified URIs in the namespace can be constructed either by attribute +or by dictionary access on Namespace instances: + +```python +>>> RDFS.seeAlso +rdflib.term.URIRef('http://www.w3.org/1999/02/22-rdf-syntax-ns#seeAlso') +>>> RDFS['seeAlso'] +rdflib.term.URIRef('http://www.w3.org/1999/02/22-rdf-syntax-ns#seeAlso') + +``` + +## Automatic handling of unknown predicates + +As a programming convenience, a namespace binding is automatically +created when [`URIRef`][rdflib.term.URIRef] predicates are added to the graph. + +## Importable namespaces + +The following namespaces are available by directly importing from rdflib: + +* BRICK +* CSVW +* DC +* DCAT +* DCMITYPE +* DCTERMS +* DCAM +* DOAP +* FOAF +* ODRL2 +* ORG +* OWL +* PROF +* PROV +* QB +* RDF +* RDFS +* SDO +* SH +* SKOS +* SOSA +* SSN +* TIME +* VANN +* VOID +* WGS +* XSD + +```python +>>> from rdflib.namespace import RDFS +>>> RDFS.seeAlso +rdflib.term.URIRef('http://www.w3.org/2000/01/rdf-schema#seeAlso') + +``` +""" + +from __future__ import annotations + +import logging +import warnings + +try: + # Python >= 3.14 + from annotationlib import ( + get_annotations, # type: ignore[attr-defined,unused-ignore] + ) +except ImportError: # pragma: no cover + try: + # Python >= 3.10 + from inspect import get_annotations # type: ignore[attr-defined,unused-ignore] + except ImportError: + + def get_annotations(thing: Any) -> dict: + return thing.__annotations__ + + +from functools import lru_cache +from pathlib import Path +from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Set, Tuple, Union +from unicodedata import category +from urllib.parse import urldefrag, urljoin + +from rdflib.term import URIRef, Variable, _is_valid_uri + +if TYPE_CHECKING: + from rdflib.graph import Graph + from rdflib.store import Store + + +__all__ = [ + "is_ncname", + "split_uri", + "Namespace", + "ClosedNamespace", + "DefinedNamespace", + "NamespaceManager", + "BRICK", + "CSVW", + "DC", + "DCAM", + "DCAT", + "DCMITYPE", + "DCTERMS", + "DOAP", + "FOAF", + "GEO", + "ODRL2", + "ORG", + "OWL", + "PROF", + "PROV", + "QB", + "RDF", + "RDFS", + "SDO", + "SH", + "SKOS", + "SOSA", + "SSN", + "TIME", + "VANN", + "VOID", + "WGS", + "XSD", +] + +logger = logging.getLogger(__name__) + + +class Namespace(str): + """Utility class for quickly generating URIRefs with a common prefix. + + ```python + >>> from rdflib.namespace import Namespace + >>> n = Namespace("http://example.org/") + >>> n.Person # as attribute + rdflib.term.URIRef('http://example.org/Person') + >>> n['first-name'] # as item - for things that are not valid python identifiers + rdflib.term.URIRef('http://example.org/first-name') + >>> n.Person in n + True + >>> n2 = Namespace("http://example2.org/") + >>> n.Person in n2 + False + + ``` + """ + + def __new__(cls, value: Union[str, bytes]) -> Namespace: + try: + rt = str.__new__(cls, value) + except UnicodeDecodeError: + rt = str.__new__(cls, value, "utf-8") # type: ignore[arg-type] + return rt + + # type error: Signature of "title" incompatible with supertype "str" + @property + def title(self) -> URIRef: # type: ignore[override] + # Override for DCTERMS.title to return a URIRef instead of str.title method + return URIRef(self + "title") + + def term(self, name: str) -> URIRef: + # need to handle slices explicitly because of __getitem__ override + return URIRef(self + (name if isinstance(name, str) else "")) + + def __getitem__(self, key: str) -> URIRef: # type: ignore[override] + return self.term(key) + + def __getattr__(self, name: str) -> URIRef: + if name.startswith("__"): # ignore any special Python names! + raise AttributeError + return self.term(name) + + def __repr__(self) -> str: + return f"Namespace({super().__repr__()})" + + def __contains__(self, ref: str) -> bool: # type: ignore[override] + """Allows to check if a URI is within (starts with) this Namespace. + + ```python + >>> from rdflib import URIRef + >>> namespace = Namespace('http://example.org/') + >>> uri = URIRef('http://example.org/foo') + >>> uri in namespace + True + >>> person_class = namespace['Person'] + >>> person_class in namespace + True + >>> obj = URIRef('http://not.example.org/bar') + >>> obj in namespace + False + + ``` + """ + return ref.startswith(self) # test namespace membership with "ref in ns" syntax + + +class URIPattern(str): + """Utility class for creating URIs according to some pattern. + + This supports either new style formatting with .format + or old-style with % operator. + + ```python + >>> u=URIPattern("http://example.org/%s/%d/resource") + >>> u%('books', 12345) + rdflib.term.URIRef('http://example.org/books/12345/resource') + + ``` + """ + + def __new__(cls, value: Union[str, bytes]) -> URIPattern: + try: + rt = str.__new__(cls, value) + except UnicodeDecodeError: + if TYPE_CHECKING: + assert isinstance(value, bytes) + rt = str.__new__(cls, value, "utf-8") + return rt + + def __mod__(self, *args, **kwargs) -> URIRef: + return URIRef(super().__mod__(*args, **kwargs)) + + def format(self, *args, **kwargs) -> URIRef: + return URIRef(super().format(*args, **kwargs)) + + def __repr__(self) -> str: + return f"URIPattern({super().__repr__()})" + + +# _DFNS_RESERVED_ATTRS are attributes for which DefinedNamespaceMeta should +# always raise AttributeError if they are not defined and which should not be +# considered part of __dir__ results. These should be all annotations on +# `DefinedNamespaceMeta`. +_DFNS_RESERVED_ATTRS: Set[str] = { + "__slots__", + "_NS", + "_warn", + "_fail", + "_extras", + "_underscore_num", +} + +# Some libraries probe classes for certain attributes or items. +# This is a list of those attributes and items that should be ignored. +_IGNORED_ATTR_LOOKUP: Set[str] = { + "_pytestfixturefunction", # pytest tries to look this up on Defined namespaces + "_partialmethod", # sphinx tries to look this up during autodoc generation +} + + +class DefinedNamespaceMeta(type): + """Utility metaclass for generating URIRefs with a common prefix.""" + + __slots__: Tuple[str, ...] = tuple() + + _NS: Namespace + _warn: bool = True + _fail: bool = False # True means mimic ClosedNamespace + _extras: List[str] = [] # List of non-pythonesque items + _underscore_num: bool = False # True means pass "_n" constructs + + @lru_cache(maxsize=None) + def __getitem__(cls, name: str, default=None) -> URIRef: + name = str(name) + + if name in _DFNS_RESERVED_ATTRS: + raise KeyError( + f"DefinedNamespace like object has no access item named {name!r}" + ) + elif name in _IGNORED_ATTR_LOOKUP: + raise KeyError() + if (cls._warn or cls._fail) and name not in cls: + if cls._fail: + raise AttributeError(f"term '{name}' not in namespace '{cls._NS}'") + else: + warnings.warn( + f"Code: {name} is not defined in namespace {cls.__name__}", + stacklevel=3, + ) + return cls._NS[name] + + def __getattr__(cls, name: str): + if name in _IGNORED_ATTR_LOOKUP: + raise AttributeError() + elif name in _DFNS_RESERVED_ATTRS: + raise AttributeError( + f"DefinedNamespace like object has no attribute {name!r}" + ) + elif name.startswith("__"): + return super(DefinedNamespaceMeta, cls).__getattribute__(name) + return cls.__getitem__(name) + + def __repr__(cls) -> str: + try: + ns_repr = repr(cls._NS) + except AttributeError: + ns_repr = "" + return f"Namespace({ns_repr})" + + def __str__(cls) -> str: + try: + return str(cls._NS) + except AttributeError: + return "" + + def __add__(cls, other: str) -> URIRef: + return cls.__getitem__(other) + + def __contains__(cls, item: str) -> bool: + """Determine whether a URI or an individual item belongs to this namespace""" + try: + this_ns = cls._NS + except AttributeError: + return False + item_str = str(item) + if item_str.startswith(str(this_ns)): + item_str = item_str[len(str(this_ns)) :] + return any( + item_str in get_annotations(c) + or item_str in c._extras + or (cls._underscore_num and item_str[0] == "_" and item_str[1:].isdigit()) + for c in cls.mro() + if issubclass(c, DefinedNamespace) + ) + + def __dir__(cls) -> Iterable[str]: + attrs = {str(x) for x in get_annotations(cls)} + # Removing these as they should not be considered part of the namespace. + attrs.difference_update(_DFNS_RESERVED_ATTRS) + values = {cls[str(x)] for x in attrs} + return values + + def as_jsonld_context(self, pfx: str) -> dict: # noqa: N804 + """Returns this DefinedNamespace as a JSON-LD 'context' object""" + terms = {pfx: str(self._NS)} + for key, term in get_annotations(self).items(): + if issubclass(term, URIRef): + terms[key] = f"{pfx}:{key}" + + return {"@context": terms} + + +class DefinedNamespace(metaclass=DefinedNamespaceMeta): + """A Namespace with an enumerated list of members. + + Warnings are emitted if unknown members are referenced if _warn is True. + """ + + __slots__: Tuple[str, ...] = tuple() + + def __init__(self): + raise TypeError("namespace may not be instantiated") + + +class ClosedNamespace(Namespace): + """ + A namespace with a closed list of members + + Trying to create terms not listed is an error + """ + + __uris: Dict[str, URIRef] + + def __new__(cls, uri: str, terms: List[str]): + rt = super().__new__(cls, uri) + rt.__uris = {t: URIRef(rt + t) for t in terms} # type: ignore[attr-defined] + return rt + + @property + def uri(self) -> str: # Back-compat + return str(self) + + def term(self, name: str) -> URIRef: + uri = self.__uris.get(name) + if uri is None: + raise KeyError(f"term '{name}' not in namespace '{self}'") + return uri + + def __getitem__(self, key: str) -> URIRef: # type: ignore[override] + return self.term(key) + + def __getattr__(self, name: str) -> URIRef: + if name.startswith("__"): # ignore any special Python names! + raise AttributeError + else: + try: + return self.term(name) + except KeyError as e: + raise AttributeError(e) + + def __repr__(self) -> str: + return f"{self.__module__}.{self.__class__.__name__}({str(self)!r})" + + def __dir__(self) -> List[str]: + return list(self.__uris) + + def __contains__(self, ref: str) -> bool: # type: ignore[override] + return ( + ref in self.__uris.values() + ) # test namespace membership with "ref in ns" syntax + + def _ipython_key_completions_(self) -> List[str]: + return dir(self) + + +XMLNS = Namespace("http://www.w3.org/XML/1998/namespace") + +if TYPE_CHECKING: + from rdflib._type_checking import _NamespaceSetString + +_with_bind_override_fix = True + + +class NamespaceManager: + """Class for managing prefix => namespace mappings + + This class requires an RDFlib Graph as an input parameter and may optionally have + the parameter bind_namespaces set. This second parameter selects a strategy which + is one of the following: + + * core: + * binds several core RDF prefixes only + * owl, rdf, rdfs, xsd, xml from the NAMESPACE_PREFIXES_CORE object + * rdflib: + * binds all the namespaces shipped with RDFLib as DefinedNamespace instances + * all the core namespaces and all the following: brick, csvw, dc, dcat + * dcmitype, dcterms, dcam, doap, foaf, geo, odrl, org, prof, prov, qb, schema + * sh, skos, sosa, ssn, time, vann, void + * see the NAMESPACE_PREFIXES_RDFLIB object for the up-to-date list + * this is default + * none: + * binds no namespaces to prefixes + * note this is NOT default behaviour + * cc: + * using prefix bindings from prefix.cc which is a online prefixes database + * not implemented yet - this is aspirational + + !!! warning "Breaking changes" + + The namespaces bound for specific values of `bind_namespaces` + constitute part of RDFLib's public interface, so changes to them should + only be additive within the same minor version. Removing values, or + removing namespaces that are bound by default, constitutes a breaking + change. + + See the sample usage + + ```python + >>> import rdflib + >>> from rdflib import Graph + >>> from rdflib.namespace import Namespace, NamespaceManager + >>> EX = Namespace('http://example.com/') + >>> namespace_manager = NamespaceManager(Graph()) + >>> namespace_manager.bind('ex', EX, override=False) + >>> g = Graph() + >>> g.namespace_manager = namespace_manager + >>> all_ns = [n for n in g.namespace_manager.namespaces()] + >>> assert ('ex', rdflib.term.URIRef('http://example.com/')) in all_ns + + ``` + """ + + def __init__(self, graph: Graph, bind_namespaces: _NamespaceSetString = "rdflib"): + self.graph = graph + self.__cache: Dict[str, Tuple[str, URIRef, str]] = {} + self.__cache_strict: Dict[str, Tuple[str, URIRef, str]] = {} + self.__log = None + self.__strie: Dict[str, Any] = {} + self.__trie: Dict[str, Any] = {} + # This type declaration is here becuase there is no common base class + # for all namespaces and without it the inferred type of ns is not + # compatible with all prefixes. + ns: Any + # bind Namespaces as per options. + # default is core + if bind_namespaces == "none": + # binds no namespaces to prefixes + # note this is NOT default + pass + elif bind_namespaces == "rdflib": + # bind all the Namespaces shipped with RDFLib + for prefix, ns in _NAMESPACE_PREFIXES_RDFLIB.items(): + self.bind(prefix, ns) + # ... don't forget the core ones too + for prefix, ns in _NAMESPACE_PREFIXES_CORE.items(): + self.bind(prefix, ns) + elif bind_namespaces == "cc": + # bind any prefix that can be found with lookups to prefix.cc + # first bind core and rdflib ones + # work out remainder - namespaces without prefixes + # only look those ones up + raise NotImplementedError("Haven't got to this option yet") + elif bind_namespaces == "core": + # bind a few core RDF namespaces - default + for prefix, ns in _NAMESPACE_PREFIXES_CORE.items(): + self.bind(prefix, ns) + else: + raise ValueError(f"unsupported namespace set {bind_namespaces}") + + def __contains__(self, ref: str) -> bool: + # checks if a reference is in any of the managed namespaces with syntax + # "ref in manager". Note that we don't use "ref in ns", as + # NamespaceManager.namespaces() returns Iterator[Tuple[str, URIRef]] + # rather than Iterator[Tuple[str, Namespace]] + return any(ref.startswith(ns) for prefix, ns in self.namespaces()) + + def reset(self) -> None: + self.__cache = {} + self.__strie = {} + self.__trie = {} + for p, n in self.namespaces(): # repopulate the trie + insert_trie(self.__trie, str(n)) + + @property + def store(self) -> Store: + return self.graph.store + + def qname(self, uri: str) -> str: + prefix, namespace, name = self.compute_qname(uri) + if prefix == "": + return name + else: + return ":".join((prefix, name)) + + def curie(self, uri: str, generate: bool = True) -> str: + """ + From a URI, generate a valid CURIE. + + Result is guaranteed to contain a colon separating the prefix from the + name, even if the prefix is an empty string. + + !!! warning "Side-effect" + When `generate` is `True` (which is the default) and there is no + matching namespace for the URI in the namespace manager then a new + namespace will be added with prefix `ns{index}`. + + Thus, when `generate` is `True`, this function is not a pure + function because of this side-effect. + + This default behaviour is chosen so that this function operates + similarly to `NamespaceManager.qname`. + + Args: + uri: URI to generate CURIE for. + generate: Whether to add a prefix for the namespace if one doesn't + already exist. Default: `True`. + + Returns: + CURIE for the URI + + Raises: + KeyError: If generate is `False` and the namespace doesn't already have + a prefix. + """ + prefix, namespace, name = self.compute_qname(uri, generate=generate) + return ":".join((prefix, name)) + + def qname_strict(self, uri: str) -> str: + prefix, namespace, name = self.compute_qname_strict(uri) + if prefix == "": + return name + else: + return ":".join((prefix, name)) + + def normalizeUri(self, rdfTerm: str) -> str: # noqa: N802, N803 + """ + Takes an RDF Term and 'normalizes' it into a QName (using the + registered prefix) or (unlike compute_qname) the Notation 3 + form for URIs: <...URI...> + """ + try: + namespace, name = split_uri(rdfTerm) + if namespace not in self.__strie: + insert_strie(self.__strie, self.__trie, str(namespace)) + namespace = URIRef(str(namespace)) + except Exception: + if isinstance(rdfTerm, Variable): + return "?%s" % rdfTerm + else: + return "<%s>" % rdfTerm + prefix = self.store.prefix(namespace) + if prefix is None and isinstance(rdfTerm, Variable): + return "?%s" % rdfTerm + elif prefix is None: + return "<%s>" % rdfTerm + else: + qNameParts = self.compute_qname(rdfTerm) # noqa: N806 + return ":".join([qNameParts[0], qNameParts[-1]]) + + def compute_qname(self, uri: str, generate: bool = True) -> Tuple[str, URIRef, str]: + prefix: Optional[str] + if uri not in self.__cache: + if not _is_valid_uri(uri): + raise ValueError( + '"{}" does not look like a valid URI, cannot serialize this. Did you want to urlencode it?'.format( + uri + ) + ) + + try: + namespace, name = split_uri(uri) + except ValueError as e: + namespace = URIRef(uri) + prefix = self.store.prefix(namespace) + name = "" # empty prefix case, safe since not prefix is error + if not prefix: + raise e + if namespace not in self.__strie: + insert_strie(self.__strie, self.__trie, namespace) + + if self.__strie[namespace]: + pl_namespace = get_longest_namespace(self.__strie[namespace], uri) + if pl_namespace is not None: + namespace = pl_namespace + name = uri[len(namespace) :] + + namespace = URIRef(namespace) + prefix = self.store.prefix(namespace) # warning multiple prefixes problem + + if prefix is None: + if not generate: + raise KeyError( + "No known prefix for {} and generate=False".format(namespace) + ) + num = 1 + while 1: + prefix = "ns%s" % num + if not self.store.namespace(prefix): + break + num += 1 + self.bind(prefix, namespace) + self.__cache[uri] = (prefix, namespace, name) + return self.__cache[uri] + + def compute_qname_strict( + self, uri: str, generate: bool = True + ) -> Tuple[str, str, str]: + # code repeated to avoid branching on strict every time + # if output needs to be strict (e.g. for xml) then + # only the strict output should bear the overhead + namespace: str + prefix: Optional[str] + prefix, namespace, name = self.compute_qname(uri, generate) + if is_ncname(str(name)): + return prefix, namespace, name + else: + if uri not in self.__cache_strict: + try: + namespace, name = split_uri(uri, NAME_START_CATEGORIES) + except ValueError: + message = ( + "This graph cannot be serialized to a strict format " + "because there is no valid way to shorten {}".format(uri) + ) + raise ValueError(message) + # omitted for strict since NCNames cannot be empty + # namespace = URIRef(uri) + # prefix = self.store.prefix(namespace) + # if not prefix: + # raise e + + if namespace not in self.__strie: + insert_strie(self.__strie, self.__trie, namespace) + + # omitted for strict + # if self.__strie[namespace]: + # pl_namespace = get_longest_namespace(self.__strie[namespace], uri) + # if pl_namespace is not None: + # namespace = pl_namespace + # name = uri[len(namespace):] + + namespace = URIRef(namespace) + prefix = self.store.prefix( + namespace + ) # warning multiple prefixes problem + + if prefix is None: + if not generate: + raise KeyError( + "No known prefix for {} and generate=False".format( + namespace + ) + ) + num = 1 + while 1: + prefix = "ns%s" % num + if not self.store.namespace(prefix): + break + num += 1 + self.bind(prefix, namespace) + self.__cache_strict[uri] = (prefix, namespace, name) + + return self.__cache_strict[uri] + + def expand_curie(self, curie: str) -> URIRef: + """ + Expand a CURIE of the form , e.g. "rdf:type" + into its full expression: + + >>> import rdflib + >>> g = rdflib.Graph() + >>> g.namespace_manager.expand_curie("rdf:type") + rdflib.term.URIRef('http://www.w3.org/1999/02/22-rdf-syntax-ns#type') + + Raises exception if a namespace is not bound to the prefix. + + """ + if not type(curie) is str: # noqa: E714 + raise TypeError(f"Argument must be a string, not {type(curie).__name__}.") + parts = curie.split(":", 1) + if len(parts) != 2: + raise ValueError( + "Malformed curie argument, format should be e.g. “foaf:name”." + ) + ns = self.store.namespace(parts[0]) + if ns is not None: + return URIRef(f"{str(ns)}{parts[1]}") + else: + raise ValueError( + f"Prefix \"{curie.split(':')[0]}\" not bound to any namespace." + ) + + def _store_bind(self, prefix: str, namespace: URIRef, override: bool) -> None: + if not _with_bind_override_fix: + return self.store.bind(prefix, namespace) + try: + return self.store.bind(prefix, namespace, override=override) + except TypeError as error: + if "override" in str(error): + logger.debug( + "caught a TypeError, " + "retrying call to %s.bind without override, " + "see https://github.com/RDFLib/rdflib/issues/1880 for more info", + type(self.store), + exc_info=True, + ) + return self.store.bind(prefix, namespace) + + def bind( + self, + prefix: Optional[str], + namespace: Any, + override: bool = True, + replace: bool = False, + ) -> None: + """Bind a given namespace to the prefix + + If override, rebind, even if the given namespace is already + bound to another prefix. + + If replace, replace any existing prefix with the new namespace + """ + + namespace = URIRef(str(namespace)) + # When documenting explain that override only applies in what cases + if prefix is None: + prefix = "" + elif " " in prefix: + raise KeyError("Prefixes may not contain spaces.") + + bound_namespace = self.store.namespace(prefix) + + # Check if the bound_namespace contains a URI + # and if so convert it into a URIRef for comparison + # This is to prevent duplicate namespaces with the + # same URI + if bound_namespace: + bound_namespace = URIRef(bound_namespace) + if bound_namespace and bound_namespace != namespace: + if replace: + self._store_bind(prefix, namespace, override=override) + insert_trie(self.__trie, str(namespace)) + return + # prefix already in use for different namespace + # + # append number to end of prefix until we find one + # that's not in use. + if not prefix: + prefix = "default" + + num = 1 + while 1: + new_prefix = "%s%s" % (prefix, num) + tnamespace = self.store.namespace(new_prefix) + if tnamespace and namespace == URIRef(tnamespace): + # the prefix is already bound to the correct + # namespace + return + if not self.store.namespace(new_prefix): + break + num += 1 + self._store_bind(new_prefix, namespace, override=override) + else: + bound_prefix = self.store.prefix(namespace) + if bound_prefix is None: + self._store_bind(prefix, namespace, override=override) + elif bound_prefix == prefix: + pass # already bound + else: + if override or bound_prefix.startswith("_"): # or a generated prefix + self._store_bind(prefix, namespace, override=override) + + insert_trie(self.__trie, str(namespace)) + + def namespaces(self) -> Iterable[Tuple[str, URIRef]]: + for prefix, namespace in self.store.namespaces(): + namespace = URIRef(namespace) + yield prefix, namespace + + def absolutize(self, uri: str, defrag: int = 1) -> URIRef: + base = Path.cwd().as_uri() + result = urljoin("%s/" % base, uri, allow_fragments=not defrag) + if defrag: + result = urldefrag(result)[0] + if not defrag: + if uri and uri[-1] == "#" and result[-1] != "#": + result = "%s#" % result + return URIRef(result) + + +# From: http://www.w3.org/TR/REC-xml#NT-CombiningChar +# +# * Name start characters must have one of the categories Ll, Lu, Lo, +# Lt, Nl. +# +# * Name characters other than Name-start characters must have one of +# the categories Mc, Me, Mn, Lm, or Nd. +# +# * Characters in the compatibility area (i.e. with character code +# greater than #xF900 and less than #xFFFE) are not allowed in XML +# names. +# +# * Characters which have a font or compatibility decomposition +# (i.e. those with a "compatibility formatting tag" in field 5 of the +# database -- marked by field 5 beginning with a "<") are not allowed. +# +# * The following characters are treated as name-start characters rather +# than name characters, because the property file classifies them as +# Alphabetic: [#x02BB-#x02C1], #x0559, #x06E5, #x06E6. +# +# * Characters #x20DD-#x20E0 are excluded (in accordance with Unicode +# 2.0, section 5.14). +# +# * Character #x00B7 is classified as an extender, because the property +# list so identifies it. +# +# * Character #x0387 is added as a name character, because #x00B7 is its +# canonical equivalent. +# +# * Characters ':' and '_' are allowed as name-start characters. +# +# * Characters '-' and '.' are allowed as name characters. + + +NAME_START_CATEGORIES = ["Ll", "Lu", "Lo", "Lt", "Nl"] +SPLIT_START_CATEGORIES = NAME_START_CATEGORIES + ["Nd"] +NAME_CATEGORIES = NAME_START_CATEGORIES + ["Mc", "Me", "Mn", "Lm", "Nd"] +ALLOWED_NAME_CHARS = ["\u00B7", "\u0387", "-", ".", "_", "%", "(", ")"] + + +# http://www.w3.org/TR/REC-xml-names/#NT-NCName +# [4] NCName ::= (Letter | '_') (NCNameChar)* /* An XML Name, minus +# the ":" */ +# [5] NCNameChar ::= Letter | Digit | '.' | '-' | '_' | CombiningChar +# | Extender + + +def is_ncname(name: str) -> int: + if name: + first = name[0] + if first == "_" or category(first) in NAME_START_CATEGORIES: + for i in range(1, len(name)): + c = name[i] + if not category(c) in NAME_CATEGORIES: # noqa: E713 + if c in ALLOWED_NAME_CHARS: + continue + return 0 + # if in compatibility area + # if decomposition(c)!='': + # return 0 + + return 1 + + return 0 + + +def split_uri( + uri: str, split_start: List[str] = SPLIT_START_CATEGORIES +) -> Tuple[str, str]: + if uri.startswith(XMLNS): + return (XMLNS, uri.split(XMLNS)[1]) + length = len(uri) + for i in range(0, length): + c = uri[-i - 1] + if not category(c) in NAME_CATEGORIES: # noqa: E713 + if c in ALLOWED_NAME_CHARS: + continue + for j in range(-1 - i, length): + if category(uri[j]) in split_start or uri[j] == "_": + # _ prevents early split, roundtrip not generate + ns = uri[:j] + if not ns: + break + ln = uri[j:] + return (ns, ln) + break + raise ValueError("Can't split '{}'".format(uri)) + + +def insert_trie( + trie: Dict[str, Any], value: str +) -> Dict[str, Any]: # aka get_subtrie_or_insert + """Insert a value into the trie if it is not already contained in the trie. + Return the subtree for the value regardless of whether it is a new value + or not.""" + if value in trie: + return trie[value] + multi_check = False + for key in tuple(trie.keys()): + if len(value) > len(key) and value.startswith(key): + return insert_trie(trie[key], value) + elif key.startswith(value): # we know the value is not in the trie + if not multi_check: + trie[value] = {} + multi_check = True # there can be multiple longer existing prefixes + dict_ = trie.pop( + key + ) # does not break strie since key<->dict_ remains unchanged + trie[value][key] = dict_ + if value not in trie: + trie[value] = {} + return trie[value] + + +def insert_strie(strie: Dict[str, Any], trie: Dict[str, Any], value: str) -> None: + if value not in strie: + strie[value] = insert_trie(trie, value) + + +def get_longest_namespace(trie: Dict[str, Any], value: str) -> Optional[str]: + for key in trie: + if value.startswith(key): + out = get_longest_namespace(trie[key], value) + if out is None: + return key + else: + return out + return None + + +from rdflib.namespace._BRICK import BRICK +from rdflib.namespace._CSVW import CSVW +from rdflib.namespace._DC import DC +from rdflib.namespace._DCAM import DCAM +from rdflib.namespace._DCAT import DCAT +from rdflib.namespace._DCMITYPE import DCMITYPE +from rdflib.namespace._DCTERMS import DCTERMS +from rdflib.namespace._DOAP import DOAP +from rdflib.namespace._FOAF import FOAF +from rdflib.namespace._GEO import GEO +from rdflib.namespace._ODRL2 import ODRL2 +from rdflib.namespace._ORG import ORG +from rdflib.namespace._OWL import OWL +from rdflib.namespace._PROF import PROF +from rdflib.namespace._PROV import PROV +from rdflib.namespace._QB import QB +from rdflib.namespace._RDF import RDF +from rdflib.namespace._RDFS import RDFS +from rdflib.namespace._SDO import SDO +from rdflib.namespace._SH import SH +from rdflib.namespace._SKOS import SKOS +from rdflib.namespace._SOSA import SOSA +from rdflib.namespace._SSN import SSN +from rdflib.namespace._TIME import TIME +from rdflib.namespace._VANN import VANN +from rdflib.namespace._VOID import VOID +from rdflib.namespace._WGS import WGS +from rdflib.namespace._XSD import XSD + +# prefixes for the core Namespaces shipped with RDFLib +_NAMESPACE_PREFIXES_CORE = { + "owl": OWL, + "rdf": RDF, + "rdfs": RDFS, + "xsd": XSD, + # Namespace binding for XML - needed for RDF/XML + "xml": XMLNS, +} + + +# prefixes for all the non-core Namespaces shipped with RDFLib +_NAMESPACE_PREFIXES_RDFLIB = { + "brick": BRICK, + "csvw": CSVW, + "dc": DC, + "dcat": DCAT, + "dcmitype": DCMITYPE, + "dcterms": DCTERMS, + "dcam": DCAM, + "doap": DOAP, + "foaf": FOAF, + "geo": GEO, + "odrl": ODRL2, + "org": ORG, + "prof": PROF, + "prov": PROV, + "qb": QB, + "schema": SDO, + "sh": SH, + "skos": SKOS, + "sosa": SOSA, + "ssn": SSN, + "time": TIME, + "vann": VANN, + "void": VOID, + "wgs": WGS, +} diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_BRICK.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_BRICK.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..804466b787af104db9ffdc14ac6939d4e78699cd Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_BRICK.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_CSVW.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_CSVW.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9b405cf7c472f86f28682231c8c5bb5b7b7252ea Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_CSVW.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_DC.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_DC.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d366eadaa78c4f19a549a9a89fdb04f717c589b3 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_DC.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_DCAM.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_DCAM.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..108eed51c66917d184c80ede28d60f2d8c3c3156 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_DCAM.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_DCAT.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_DCAT.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9972f7371c9080223009184ec08010ba115b690d Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_DCAT.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_DCMITYPE.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_DCMITYPE.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6c6d45a347e0d68c47f6d8c196be7f1be20d4932 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_DCMITYPE.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_DCTERMS.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_DCTERMS.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5f0ca9fb99bb054b3042412738d969eb114d71d4 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_DCTERMS.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_DOAP.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_DOAP.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..489f7577218af0b45028b023f2f11686c4c159c3 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_DOAP.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_FOAF.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_FOAF.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..186a89fe58a3553aaf74d1c8219e501316d64385 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_FOAF.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_GEO.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_GEO.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4d76870d2330d9ba90b9ccf360f8fb48ff855d34 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_GEO.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_ODRL2.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_ODRL2.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9ee30bb5cc47de948495006ccc9f6ea254aa7918 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_ODRL2.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_ORG.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_ORG.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..54eaa93ad37f6da51bdce2ce65f3249c590b5dab Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_ORG.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_OWL.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_OWL.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..82a87dfeee134318dd8507df48e7beb257879ad0 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_OWL.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_PROF.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_PROF.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..49dc32e334ebb7db3b9899695e5c34994d22b535 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_PROF.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_PROV.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_PROV.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..83e47c29f25850662f26fb1d1b47a0e1d76cb131 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_PROV.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_QB.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_QB.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ffb249368e73ea5d0fc06674e88e142e27305ffe Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_QB.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_RDF.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_RDF.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7d472eec6f98948833519339ce18b6d21c76e1b3 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_RDF.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_RDFS.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_RDFS.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f1f788701d0df67f68f1eee33641a969e934297a Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_RDFS.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_SDO.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_SDO.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..81a311ebb91f91844660dad52ebd902aa01638b2 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_SDO.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_SH.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_SH.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1413160190adf7680e8ce1252c087c34d6779446 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_SH.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_SKOS.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_SKOS.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7f35c9f359008d8f03fd2fcdf8430e7a370ab7f9 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_SKOS.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_SOSA.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_SOSA.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2f3bfc9202072c15f1f513d1851a2c46d45519f5 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_SOSA.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_SSN.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_SSN.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..875ed11ba845193cb67a3fc923b4cc1299fba88d Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_SSN.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_TIME.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_TIME.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..02094c8b0630fcdd8e1359b4b5db9186f5a88ac0 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_TIME.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_VANN.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_VANN.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e4f526451897430d9deeaed402af0f5c5e9ab1ba Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_VANN.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_VOID.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_VOID.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..911683a46a37c7ce97e0564b1a74f2336b88eaff Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_VOID.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_WGS.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_WGS.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a04f4ca736b25815b4d4f52a8ebbd4e019f8c747 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_WGS.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_XSD.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_XSD.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b7058f6aa432595b6186aab5b5fc9838f7cf3dec Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/_XSD.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/__init__.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6b27e6827b6a412297eb4ef0a962eddf2d028fd9 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/namespace/__pycache__/__init__.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/__init__.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4622bb0a10a3b028dc39a0693f94680a5f45f970 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/__init__.py @@ -0,0 +1,7 @@ +""" +Default plugins for rdflib. + +This is a namespace package and contains the default plugins for +rdflib. + +""" diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/__pycache__/__init__.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6f7ba0f28eac00dc8fb3892c55a6ed8d160ded53 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/__pycache__/__init__.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/RDFVOC.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/RDFVOC.py new file mode 100644 index 0000000000000000000000000000000000000000..33f9c87d5fe2db051b5db9e009adae31742a8ced --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/RDFVOC.py @@ -0,0 +1,19 @@ +from rdflib.namespace import RDF # noqa: N999 +from rdflib.term import URIRef + + +class RDFVOC(RDF): + _underscore_num = True + _fail = True + + # http://www.w3.org/TR/rdf-syntax-grammar/#eventterm-attribute-URI + # A mapping from unqualified terms to their qualified version. + RDF: URIRef + Description: URIRef + ID: URIRef + about: URIRef + parseType: URIRef # noqa: N815 + resource: URIRef + li: URIRef + nodeID: URIRef # noqa: N815 + datatype: URIRef diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/__init__.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b2f4e9b8109d553e91c87331326c92bc0cedd63d --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/__init__.py @@ -0,0 +1,8 @@ +"""Module for builtin RDF parser + +All builtin [RDF parser][rdflib.parser.Parser] available +in [RDFLib Graphs method `parse`][rdflib.graph.Graph.parse] are listed here. + +Registration of builtin and external plugins +is described in [`rdflib.plugin`][rdflib.plugin]. +""" diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/__pycache__/RDFVOC.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/__pycache__/RDFVOC.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b4d55db166ba1c269961f002187a81a117ed4a47 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/__pycache__/RDFVOC.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/__pycache__/__init__.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..eb647e31ad86884f3d2e9e1423ae54362904f280 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/__pycache__/__init__.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/__pycache__/hext.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/__pycache__/hext.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..aba5627ce1eca0ebb53942d43abb60719774523c Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/__pycache__/hext.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/__pycache__/jsonld.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/__pycache__/jsonld.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5ff793ead9c3409b2406f39bfd4dd2e6fc9af363 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/__pycache__/jsonld.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/__pycache__/notation3.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/__pycache__/notation3.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9c61819290a160356c56bf48e30c1e3ae6ab7b91 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/__pycache__/notation3.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/__pycache__/nquads.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/__pycache__/nquads.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7027d4edadd89a0168cdfbaccfbfa93510414ba1 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/__pycache__/nquads.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/__pycache__/ntriples.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/__pycache__/ntriples.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8c502d462153e4d8522763b3e369d88d20c39f1f Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/__pycache__/ntriples.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/__pycache__/patch.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/__pycache__/patch.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bfe33bc51e47147960d0931b345940eba5b63b2f Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/__pycache__/patch.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/__pycache__/rdfxml.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/__pycache__/rdfxml.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6bea61bfe5557e5fea77e5a6bcc66c4b057b15d4 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/__pycache__/rdfxml.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/__pycache__/trig.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/__pycache__/trig.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7fdbc12cb4ad497c6b0a745c8c01633d7e2b4d96 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/__pycache__/trig.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/__pycache__/trix.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/__pycache__/trix.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..38bcbda9a845b5155ce89697b1193f20a410d915 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/__pycache__/trix.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/hext.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/hext.py new file mode 100644 index 0000000000000000000000000000000000000000..99aa476982206d22288ddb392bfde1ec504c7072 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/hext.py @@ -0,0 +1,172 @@ +""" +This is a rdflib plugin for parsing Hextuple files, which are Newline-Delimited JSON +(ndjson) files, into Conjunctive. The store that backs the graph *must* be able to +handle contexts, i.e. multiple graphs. +""" + +from __future__ import annotations + +import json +import warnings +from io import TextIOWrapper +from typing import TYPE_CHECKING, Any, BinaryIO, List, Optional, TextIO, Union + +from rdflib.graph import ConjunctiveGraph, Dataset, Graph +from rdflib.parser import InputSource, Parser +from rdflib.term import BNode, Literal, URIRef + +try: + import orjson + + _HAS_ORJSON = True +except ImportError: + orjson = None # type: ignore[assignment, unused-ignore] + _HAS_ORJSON = False + +if TYPE_CHECKING: + from io import BufferedReader + +__all__ = ["HextuplesParser"] + + +class HextuplesParser(Parser): + """ + An RDFLib parser for Hextuples + """ + + def __init__(self): + super(HextuplesParser, self).__init__() + self.default_context: Optional[Graph] = None + self.skolemize = False + + def _parse_hextuple( + self, ds: Union[Dataset, ConjunctiveGraph], tup: List[Union[str, None]] + ) -> None: + # all values check + # subject, predicate, value, datatype cannot be None + # language and graph may be None + if tup[0] is None or tup[1] is None or tup[2] is None or tup[3] is None: + raise ValueError( + f"subject, predicate, value, datatype cannot be None. Given: {tup}" + ) + + # 1 - subject + s: Union[URIRef, BNode] + if tup[0].startswith("_"): + s = BNode(value=tup[0].replace("_:", "")) + if self.skolemize: + s = s.skolemize() + else: + s = URIRef(tup[0]) + + # 2 - predicate + p = URIRef(tup[1]) + + # 3 - value + o: Union[URIRef, BNode, Literal] + if tup[3] == "globalId": + o = URIRef(tup[2]) + elif tup[3] == "localId": + o = BNode(value=tup[2].replace("_:", "")) + if self.skolemize: + o = o.skolemize() + else: # literal + if tup[4] is None: + o = Literal(tup[2], datatype=URIRef(tup[3])) + else: + o = Literal(tup[2], lang=tup[4]) + + # 6 - context + if tup[5] is not None: + c = ( + BNode(tup[5].replace("_:", "")) + if tup[5].startswith("_:") + else URIRef(tup[5]) + ) + if isinstance(c, BNode) and self.skolemize: + c = c.skolemize() + + ds.get_context(c).add((s, p, o)) + elif self.default_context is not None: + self.default_context.add((s, p, o)) + else: + raise Exception("No context to parse into!") + + # type error: Signature of "parse" incompatible with supertype "Parser" + def parse(self, source: InputSource, graph: Graph, skolemize: bool = False, **kwargs: Any) -> None: # type: ignore[override] + if kwargs.get("encoding") not in [None, "utf-8"]: + warnings.warn( + f"Hextuples files are always utf-8 encoded, " + f"I was passed: {kwargs.get('encoding')}, " + "but I'm still going to use utf-8" + ) + + assert ( + graph.store.context_aware + ), "Hextuples Parser needs a context-aware store!" + + self.skolemize = skolemize + # Set default_union to True to mimic ConjunctiveGraph behavior + ds = Dataset(store=graph.store, default_union=True) + ds_default = ds.default_context # the DEFAULT_DATASET_GRAPH_ID + if isinstance(graph, (Dataset, ConjunctiveGraph)): + self.default_context = graph.default_context + elif graph.identifier is not None: + if graph.identifier == ds_default.identifier: + self.default_context = graph + else: + self.default_context = ds.get_context(graph.identifier) + else: + # mypy thinks this is unreachable, but graph.identifier can be None + self.default_context = ds_default # type: ignore[unreachable] + if self.default_context is not ds_default: + ds.default_context = self.default_context + ds.remove_graph(ds_default) # remove the original unused default graph + + try: + text_stream: Optional[TextIO] = source.getCharacterStream() + except (AttributeError, LookupError): + text_stream = None + try: + binary_stream: Optional[BinaryIO] = source.getByteStream() + except (AttributeError, LookupError): + binary_stream = None + + if text_stream is None and binary_stream is None: + raise ValueError( + f"Source does not have a character stream or a byte stream and cannot be used {type(source)}" + ) + if TYPE_CHECKING: + assert text_stream is not None or binary_stream is not None + use_stream: Union[TextIO, BinaryIO] + if _HAS_ORJSON: + if binary_stream is not None: + use_stream = binary_stream + else: + if TYPE_CHECKING: + assert isinstance(text_stream, TextIOWrapper) + use_stream = text_stream + loads = orjson.loads + else: + if text_stream is not None: + use_stream = text_stream + else: + if TYPE_CHECKING: + assert isinstance(binary_stream, BufferedReader) + use_stream = TextIOWrapper(binary_stream, encoding="utf-8") + loads = json.loads + + for line in use_stream: # type: Union[str, bytes] + if len(line) == 0 or line.isspace(): + # Skipping empty lines because this is what was being done before for the first and last lines, albeit in an rather indirect way. + # The result is that we accept input that would otherwise be invalid. + # Possibly we should just let this result in an error. + continue + # this complex handing is because the 'value' component is + # allowed to be "" but not None + # all other "" values are treated as None + raw_line: List[str] = loads(line) + hex_tuple_line = [x if x != "" else None for x in raw_line] + if raw_line[2] == "": + hex_tuple_line[2] = "" + self._parse_hextuple(ds, hex_tuple_line) diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/jsonld.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/jsonld.py new file mode 100644 index 0000000000000000000000000000000000000000..fe9503b5467efe5d0a997b9e8688a033f8df04ba --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/jsonld.py @@ -0,0 +1,703 @@ +""" +This parser will interpret a JSON-LD document as an RDF Graph. See http://json-ld.org/ + +Example: + ```python + >>> from rdflib import Graph, URIRef, Literal + >>> test_json = ''' + ... { + ... "@context": { + ... "dc": "http://purl.org/dc/terms/", + ... "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", + ... "rdfs": "http://www.w3.org/2000/01/rdf-schema#" + ... }, + ... "@id": "http://example.org/about", + ... "dc:title": { + ... "@language": "en", + ... "@value": "Someone's Homepage" + ... } + ... } + ... ''' + >>> g = Graph().parse(data=test_json, format='json-ld') + >>> list(g) == [(URIRef('http://example.org/about'), + ... URIRef('http://purl.org/dc/terms/title'), + ... Literal("Someone's Homepage", lang='en'))] + True + + ``` +""" + +# From: https://github.com/RDFLib/rdflib-jsonld/blob/feature/json-ld-1.1/rdflib_jsonld/parser.py + +# NOTE: This code reads the entire JSON object into memory before parsing, but +# we should consider streaming the input to deal with arbitrarily large graphs. +from __future__ import annotations + +import secrets +import warnings +from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Union + +import rdflib.parser +from rdflib.graph import ConjunctiveGraph, Graph +from rdflib.namespace import RDF, XSD +from rdflib.parser import InputSource, URLInputSource +from rdflib.term import BNode, IdentifiedNode, Literal, Node, URIRef + +from ..shared.jsonld.context import UNDEF, Context, Term +from ..shared.jsonld.keys import ( + CONTEXT, + GRAPH, + ID, + INCLUDED, + INDEX, + JSON, + LANG, + LIST, + NEST, + NONE, + REV, + SET, + TYPE, + VALUE, + VOCAB, +) +from ..shared.jsonld.util import ( + _HAS_ORJSON, + VOCAB_DELIMS, + context_from_urlinputsource, + json, + orjson, + source_to_json, +) + +__all__ = ["JsonLDParser", "to_rdf"] + +TYPE_TERM = Term(str(RDF.type), TYPE, VOCAB) # type: ignore[call-arg] + +ALLOW_LISTS_OF_LISTS = True # NOTE: Not allowed in JSON-LD 1.0 + + +class JsonLDParser(rdflib.parser.Parser): + def __init__(self): + super(JsonLDParser, self).__init__() + + def parse( + self, + source: InputSource, + sink: Graph, + version: float = 1.1, + skolemize: bool = False, + encoding: Optional[str] = "utf-8", + base: Optional[str] = None, + context: Optional[ + Union[ + List[Union[Dict[str, Any], str, None]], + Dict[str, Any], + str, + ] + ] = None, + generalized_rdf: Optional[bool] = False, + extract_all_scripts: Optional[bool] = False, + **kwargs: Any, + ) -> None: + """Parse JSON-LD from a source document. + + The source document can be JSON or HTML with embedded JSON script + elements (type attribute = `application/ld+json`). To process as HTML + `source.content_type` must be set to "text/html" or + `application/xhtml+xml. + + Args: + source: InputSource with JSON-formatted data (JSON or HTML) + sink: Graph to receive the parsed triples + version: parse as JSON-LD version, defaults to 1.1 + skolemize: whether to skolemize blank nodes, defaults to False + encoding: character encoding of the JSON (should be "utf-8" + base: JSON-LD [Base IRI](https://www.w3.org/TR/json-ld/#base-iri), defaults to None + context: JSON-LD [Context](https://www.w3.org/TR/json-ld/#the-context), defaults to None + generalized_rdf: parse as [Generalized RDF](https://www.w3.org/TR/json-ld/#relationship-to-rdf), defaults to False + extract_all_scripts: if source is an HTML document then extract + script element). This is ignored if `source.system_id` contains + a fragment identifier, in which case only the script element with + matching id attribute is extracted. + """ + if encoding not in ("utf-8", "utf-16"): + warnings.warn( + "JSON should be encoded as unicode. " + "Given encoding was: %s" % encoding + ) + + if not base: + base = sink.absolutize(source.getPublicId() or source.getSystemId() or "") + + context_data = context + if not context_data and hasattr(source, "url") and hasattr(source, "links"): + if TYPE_CHECKING: + assert isinstance(source, URLInputSource) + context_data = context_from_urlinputsource(source) + + try: + version = float(version) + except ValueError: + version = 1.1 + + # Get the optional fragment identifier + try: + fragment_id = URIRef(source.getSystemId()).fragment + except Exception: + fragment_id = None + + data, html_base = source_to_json(source, fragment_id, extract_all_scripts) + if html_base is not None: + base = URIRef(html_base, base=base) + + # NOTE: A ConjunctiveGraph parses into a Graph sink, so no sink will be + # context_aware. Keeping this check in case RDFLib is changed, or + # someone passes something context_aware to this parser directly. + conj_sink: Graph + if not sink.context_aware: + conj_sink = ConjunctiveGraph(store=sink.store, identifier=sink.identifier) + else: + conj_sink = sink + + to_rdf( + data, + conj_sink, + base, + context_data, + version, + bool(generalized_rdf), + skolemize=skolemize, + ) + + +def to_rdf( + data: Any, + dataset: Graph, + base: Optional[str] = None, + context_data: Optional[ + Union[ + List[Union[Dict[str, Any], str, None]], + Dict[str, Any], + str, + ] + ] = None, + version: Optional[float] = None, + generalized_rdf: bool = False, + allow_lists_of_lists: Optional[bool] = None, + skolemize: bool = False, +): + # TODO: docstring w. args and return value + context = Context(base=base, version=version) + if context_data: + context.load(context_data) + parser = Parser( + generalized_rdf=generalized_rdf, + allow_lists_of_lists=allow_lists_of_lists, + skolemize=skolemize, + ) + return parser.parse(data, context, dataset) + + +class Parser: + def __init__( + self, + generalized_rdf: bool = False, + allow_lists_of_lists: Optional[bool] = None, + skolemize: bool = False, + ): + self.skolemize = skolemize + self.generalized_rdf = generalized_rdf + self.allow_lists_of_lists = ( + allow_lists_of_lists + if allow_lists_of_lists is not None + else ALLOW_LISTS_OF_LISTS + ) + self.invalid_uri_to_bnode: dict[str, BNode] = {} + + def parse(self, data: Any, context: Context, dataset: Graph) -> Graph: + topcontext = False + resources: Union[Dict[str, Any], List[Any]] + if isinstance(data, list): + resources = data + elif isinstance(data, dict): + local_context = data.get(CONTEXT) + if local_context: + context.load(local_context, context.base) + topcontext = True + resources = data + # type error: Subclass of "Dict[str, Any]" and "List[Any]" cannot exist: would have incompatible method signatures + if not isinstance(resources, list): # type: ignore[unreachable] + resources = [resources] + + if context.vocab: + dataset.bind(None, context.vocab) + for name, term in context.terms.items(): + if term.id and term.id.endswith(VOCAB_DELIMS): + dataset.bind(name, term.id) + + # type error: "Graph" has no attribute "default_context" + graph = dataset.default_context if dataset.context_aware else dataset # type: ignore[attr-defined] + + for node in resources: + self._add_to_graph(dataset, graph, context, node, topcontext) + + return graph + + def _add_to_graph( + self, + dataset: Graph, + graph: Graph, + context: Context, + node: Any, + topcontext: bool = False, + ) -> Optional[Node]: + if not isinstance(node, dict) or context.get_value(node): + # type error: Return value expected + return # type: ignore[return-value] + + if CONTEXT in node and not topcontext: + local_context = node[CONTEXT] + if local_context: + context = context.subcontext(local_context) + else: + context = Context(base=context.doc_base) + + # type error: Incompatible types in assignment (expression has type "Optional[Context]", variable has type "Context") + context = context.get_context_for_type(node) # type: ignore[assignment] + + id_val = context.get_id(node) + + if id_val is None: + nested_id = self._get_nested_id(context, node) + if nested_id is not None and len(nested_id) > 0: + id_val = nested_id + + if isinstance(id_val, str): + subj = self._to_rdf_id(context, id_val) + else: + subj = BNode() + if self.skolemize: + subj = subj.skolemize() + + if subj is None: + return None + + # NOTE: crude way to signify that this node might represent a named graph + no_id = id_val is None + + for key, obj in node.items(): + if key == CONTEXT or key in context.get_keys(ID): + continue + + if key == REV or key in context.get_keys(REV): + for rkey, robj in obj.items(): + self._key_to_graph( + dataset, + graph, + context, + subj, + rkey, + robj, + reverse=True, + no_id=no_id, + ) + else: + self._key_to_graph(dataset, graph, context, subj, key, obj, no_id=no_id) + + return subj + + # type error: Missing return statement + def _get_nested_id(self, context: Context, node: Dict[str, Any]) -> Optional[str]: # type: ignore[return] + for key, obj in node.items(): + if context.version >= 1.1 and key in context.get_keys(NEST): + term = context.terms.get(key) + if term and term.id is None: + continue + objs = obj if isinstance(obj, list) else [obj] + for obj in objs: + if not isinstance(obj, dict): + continue + id_val = context.get_id(obj) + if not id_val: + subcontext = context.get_context_for_term( + context.terms.get(key) + ) + id_val = self._get_nested_id(subcontext, obj) + if isinstance(id_val, str): + return id_val + + def _key_to_graph( + self, + dataset: Graph, + graph: Graph, + context: Context, + subj: Node, + key: str, + obj: Any, + reverse: bool = False, + no_id: bool = False, + ) -> None: + if isinstance(obj, list): + obj_nodes = obj + else: + obj_nodes = [obj] + + term = context.terms.get(key) + if term: + term_id = term.id + if term.type == JSON: + obj_nodes = [self._to_typed_json_value(obj)] + elif LIST in term.container: + obj_nodes = [self._expand_nested_list(obj_nodes)] + elif isinstance(obj, dict): + obj_nodes = self._parse_container(context, term, obj) + else: + term_id = None + + if TYPE in (key, term_id): + term = TYPE_TERM + + if GRAPH in (key, term_id): + if dataset.context_aware and not no_id: + if TYPE_CHECKING: + assert isinstance(dataset, ConjunctiveGraph) + # type error: Argument 1 to "get_context" of "ConjunctiveGraph" has incompatible type "Node"; expected "Union[IdentifiedNode, str, None]" + subgraph = dataset.get_context(subj) # type: ignore[arg-type] + else: + subgraph = graph + for onode in obj_nodes: + self._add_to_graph(dataset, subgraph, context, onode) + return + + if SET in (key, term_id): + for onode in obj_nodes: + self._add_to_graph(dataset, graph, context, onode) + return + + if INCLUDED in (key, term_id): + for onode in obj_nodes: + self._add_to_graph(dataset, graph, context, onode) + return + + if context.version >= 1.1 and key in context.get_keys(NEST): + term = context.terms.get(key) + if term and term.id is None: + return + objs = obj if isinstance(obj, list) else [obj] + for obj in objs: + if not isinstance(obj, dict): + continue + for nkey, nobj in obj.items(): + # NOTE: we've already captured subject + if nkey in context.get_keys(ID): + continue + subcontext = context.get_context_for_type(obj) + # type error: Argument 3 to "_key_to_graph" of "Parser" has incompatible type "Optional[Context]"; expected "Context" + self._key_to_graph(dataset, graph, subcontext, subj, nkey, nobj) # type: ignore[arg-type] + return + + pred_uri = term.id if term else context.expand(key) + + context = context.get_context_for_term(term) + + # Flatten deep nested lists + def flatten(n: Iterable[Any]) -> List[Any]: + flattened = [] + for obj in n: + if isinstance(obj, dict): + objs = context.get_set(obj) + if objs is not None: + obj = objs + if isinstance(obj, list): + flattened += flatten(obj) + continue + flattened.append(obj) + return flattened + + obj_nodes = flatten(obj_nodes) + + if not pred_uri: + return + + if term and term.reverse: + reverse = not reverse + + pred: IdentifiedNode + bid = self._get_bnodeid(pred_uri) + if bid: + if not self.generalized_rdf: + return + pred = BNode(bid) + if self.skolemize: + pred = pred.skolemize() + else: + pred = URIRef(pred_uri) + + for obj_node in obj_nodes: + obj = self._to_object(dataset, graph, context, term, obj_node) + if obj is None: + continue + if reverse: + graph.add((obj, pred, subj)) + else: + graph.add((subj, pred, obj)) + + def _parse_container( + self, context: Context, term: Term, obj: Dict[str, Any] + ) -> List[Any]: + if LANG in term.container: + obj_nodes = [] + for lang, values in obj.items(): + if not isinstance(values, list): + values = [values] + if lang in context.get_keys(NONE): + obj_nodes += values + else: + for v in values: + obj_nodes.append((v, lang)) + return obj_nodes + + v11 = context.version >= 1.1 + + if v11 and GRAPH in term.container and ID in term.container: + return [ + ( + dict({GRAPH: o}) + if k in context.get_keys(NONE) + else dict({ID: k, GRAPH: o}) if isinstance(o, dict) else o + ) + for k, o in obj.items() + ] + + elif v11 and GRAPH in term.container and INDEX in term.container: + return [dict({GRAPH: o}) for k, o in obj.items()] + + elif v11 and GRAPH in term.container: + return [dict({GRAPH: obj})] + + elif v11 and ID in term.container: + return [ + ( + dict({ID: k}, **o) + if isinstance(o, dict) and k not in context.get_keys(NONE) + else o + ) + for k, o in obj.items() + ] + + elif v11 and TYPE in term.container: + return [ + ( + self._add_type( + context, + ( + {ID: context.expand(o) if term.type == VOCAB else o} + if isinstance(o, str) + else o + ), + k, + ) + if isinstance(o, (dict, str)) and k not in context.get_keys(NONE) + else o + ) + for k, o in obj.items() + ] + + elif INDEX in term.container: + obj_nodes = [] + for key, nodes in obj.items(): + if not isinstance(nodes, list): + nodes = [nodes] + for node in nodes: + if v11 and term.index and key not in context.get_keys(NONE): + if not isinstance(node, dict): + node = {ID: node} + values = node.get(term.index, []) + if not isinstance(values, list): + values = [values] + values.append(key) + node[term.index] = values + obj_nodes.append(node) + return obj_nodes + + return [obj] + + @staticmethod + def _add_type(context: Context, o: Dict[str, Any], k: str) -> Dict[str, Any]: + otype = context.get_type(o) or [] + if otype and not isinstance(otype, list): + otype = [otype] + otype.append(k) + o[TYPE] = otype + return o + + def _to_object( + self, + dataset: Graph, + graph: Graph, + context: Context, + term: Optional[Term], + node: Any, + inlist: bool = False, + ) -> Optional[Node]: + if isinstance(node, tuple): + value, lang = node + if value is None: + # type error: Return value expected + return # type: ignore[return-value] + if lang and " " in lang: + # type error: Return value expected + return # type: ignore[return-value] + return Literal(value, lang=lang) + + if isinstance(node, dict): + node_list = context.get_list(node) + if node_list is not None: + if inlist and not self.allow_lists_of_lists: + # type error: Return value expected + return # type: ignore[return-value] + listref = self._add_list(dataset, graph, context, term, node_list) + if listref: + return listref + + else: # expand compacted value + if term and term.type: + if term.type == JSON: + node = self._to_typed_json_value(node) + elif node is None: + # type error: Return value expected + return # type: ignore[return-value] + elif term.type == ID and isinstance(node, str): + node = {ID: context.resolve(node)} + elif term.type == VOCAB and isinstance(node, str): + node = {ID: context.expand(node) or context.resolve_iri(node)} + else: + node = {TYPE: term.type, VALUE: node} + else: + if node is None: + # type error: Return value expected + return # type: ignore[return-value] + if isinstance(node, float): + return Literal(node, datatype=XSD.double) + + if term and term.language is not UNDEF: + lang = term.language + else: + lang = context.language + return Literal(node, lang=lang) + + lang = context.get_language(node) + datatype = not lang and context.get_type(node) or None + value = context.get_value(node) + # type error: Unsupported operand types for in ("Optional[Any]" and "Generator[str, None, None]") + if datatype in context.get_keys(JSON): # type: ignore[operator] + node = self._to_typed_json_value(value) + datatype = context.get_type(node) + value = context.get_value(node) + + if lang or context.get_key(VALUE) in node or VALUE in node: + if value is None: + return None + if lang: + if " " in lang: + # type error: Return value expected + return # type: ignore[return-value] + return Literal(value, lang=lang) + elif datatype: + return Literal(value, datatype=context.expand(datatype)) + else: + return Literal(value) + else: + return self._add_to_graph(dataset, graph, context, node) + + def _to_rdf_id(self, context: Context, id_val: str) -> Optional[IdentifiedNode]: + bid = self._get_bnodeid(id_val) + if bid: + b = BNode(bid) + if self.skolemize: + return b.skolemize() + return b + else: + uri = context.resolve(id_val) + if not self.generalized_rdf and ":" not in uri: + return None + node: IdentifiedNode = URIRef(uri) + if not str(node): + if id_val not in self.invalid_uri_to_bnode: + self.invalid_uri_to_bnode[id_val] = BNode(secrets.token_urlsafe(20)) + node = self.invalid_uri_to_bnode[id_val] + return node + + def _get_bnodeid(self, ref: str) -> Optional[str]: + if not ref.startswith("_:"): + # type error: Return value expected + return # type: ignore[return-value] + bid = ref.split("_:", 1)[-1] + return bid or None + + def _add_list( + self, + dataset: Graph, + graph: Graph, + context: Context, + term: Optional[Term], + node_list: Any, + ) -> IdentifiedNode: + if not isinstance(node_list, list): + node_list = [node_list] + + first_subj: Union[URIRef, BNode] = BNode() + if self.skolemize and isinstance(first_subj, BNode): + first_subj = first_subj.skolemize() + + rest: Union[URIRef, BNode, None] + subj, rest = first_subj, None + + for node in node_list: + if node is None: + continue + + if rest: + # type error: Statement is unreachable + graph.add((subj, RDF.rest, rest)) # type: ignore[unreachable] + subj = rest + + obj = self._to_object(dataset, graph, context, term, node, inlist=True) + + if obj is None: + continue + + graph.add((subj, RDF.first, obj)) + rest = BNode() + if self.skolemize and isinstance(rest, BNode): + rest = rest.skolemize() + + if rest: + graph.add((subj, RDF.rest, RDF.nil)) + return first_subj + else: + return RDF.nil + + @staticmethod + def _to_typed_json_value(value: Any) -> Dict[str, str]: + if _HAS_ORJSON: + val_string: str = orjson.dumps( + value, + option=orjson.OPT_SORT_KEYS | orjson.OPT_NON_STR_KEYS, + ).decode("utf-8") + else: + val_string = json.dumps( + value, separators=(",", ":"), sort_keys=True, ensure_ascii=False + ) + return { + TYPE: RDF.JSON, + VALUE: val_string, + } + + @classmethod + def _expand_nested_list(cls, obj_nodes: List[Any]) -> Dict[str, List[Any]]: + result = [ + cls._expand_nested_list(o) if isinstance(o, list) else o for o in obj_nodes + ] + return {LIST: result} diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/notation3.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/notation3.py new file mode 100644 index 0000000000000000000000000000000000000000..ae184e8557adc00cb6efe53846d916e1937bc783 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/notation3.py @@ -0,0 +1,2068 @@ +""" +notation3.py - Standalone Notation3 Parser +Derived from CWM, the Closed World Machine + +Authors of the original suite: + +* Dan Connolly <@@> +* Tim Berners-Lee <@@> +* Yosi Scharf <@@> +* Joseph M. Reagle Jr. +* Rich Salz + +http://www.w3.org/2000/10/swap/notation3.py + +Copyright 2000-2007, World Wide Web Consortium. +Copyright 2001, MIT. +Copyright 2001, Zolera Systems Inc. + +License: W3C Software License +http://www.w3.org/Consortium/Legal/copyright-software + +Modified by Sean B. Palmer +Copyright 2007, Sean B. Palmer. + +Modified to work with rdflib by Gunnar Aastrand Grimnes +Copyright 2010, Gunnar A. Grimnes + +""" + +from __future__ import annotations + +import codecs +import os +import re +import sys + +# importing typing for `typing.List` because `List`` is used for something else +import typing +from decimal import Decimal +from typing import ( + IO, + TYPE_CHECKING, + Any, + Callable, + Dict, + Match, + MutableSequence, + NoReturn, + Optional, + Pattern, + Set, + Tuple, + TypeVar, + Union, +) +from uuid import uuid4 + +from rdflib.compat import long_type +from rdflib.exceptions import ParserError +from rdflib.graph import Dataset, Graph, QuotedGraph +from rdflib.term import ( + _XSD_PFX, + BNode, + IdentifiedNode, + Identifier, + Literal, + Node, + URIRef, + Variable, + _unique_id, +) + +__all__ = [ + "BadSyntax", + "N3Parser", + "TurtleParser", + "splitFragP", + "join", + "base", + "runNamespace", + "uniqueURI", + "hexify", + "Formula", + "RDFSink", + "SinkParser", + "sfloat", +] + +from rdflib.parser import Parser + +if TYPE_CHECKING: + from rdflib.parser import InputSource + +_AnyT = TypeVar("_AnyT") + + +def splitFragP(uriref: str, punc: int = 0) -> Tuple[str, str]: + """Split a URI reference before the fragment + + Punctuation is kept. e.g. + + ```python + >>> splitFragP("abc#def") + ('abc', '#def') + + >>> splitFragP("abcdef") + ('abcdef', '') + + ``` + """ + + i = uriref.rfind("#") + if i >= 0: + return uriref[:i], uriref[i:] + else: + return uriref, "" + + +_StrT = TypeVar("_StrT", bound=str) + + +def join(here: str, there: str) -> str: + """join an absolute URI and URI reference + (non-ascii characters are supported/doctested; + haven't checked the details of the IRI spec though) + + `here` is assumed to be absolute. + `there` is URI reference. + + ```python + >>> join('http://example/x/y/z', '../abc') + 'http://example/x/abc' + + ``` + + Raise ValueError if there uses relative path + syntax but here has no hierarchical path. + + ```python + >>> join('mid:foo@example', '../foo') # doctest: +NORMALIZE_WHITESPACE + Traceback (most recent call last): + raise ValueError(here) + ValueError: Base has no slash + after colon - with relative '../foo'. + + >>> join('http://example/x/y/z', '') + 'http://example/x/y/z' + + >>> join('mid:foo@example', '#foo') + 'mid:foo@example#foo' + + ``` + + We grok IRIs + + ```python + >>> len('Andr\\xe9') + 5 + + >>> join('http://example.org/', '#Andr\\xe9') + 'http://example.org/#Andr\\xe9' + + ``` + """ + + # assert(here.find("#") < 0), \ + # "Base may not contain hash: '%s'" % here # why must caller splitFrag? + + slashl = there.find("/") + colonl = there.find(":") + + # join(base, 'foo:/') -- absolute + if colonl >= 0 and (slashl < 0 or colonl < slashl): + return there + + bcolonl = here.find(":") + assert bcolonl >= 0, ( + "Base uri '%s' is not absolute" % here + ) # else it's not absolute + + path, frag = splitFragP(there) + if not path: + return here + frag + + # join('mid:foo@example', '../foo') bzzt + if here[bcolonl + 1 : bcolonl + 2] != "/": + raise ValueError( + "Base <%s> has no slash after " + "colon - with relative '%s'." % (here, there) + ) + + if here[bcolonl + 1 : bcolonl + 3] == "//": + bpath = here.find("/", bcolonl + 3) + else: + bpath = bcolonl + 1 + + # join('http://xyz', 'foo') + if bpath < 0: + bpath = len(here) + here = here + "/" + + # join('http://xyz/', '//abc') => 'http://abc' + if there[:2] == "//": + return here[: bcolonl + 1] + there + + # join('http://xyz/', '/abc') => 'http://xyz/abc' + if there[:1] == "/": + return here[:bpath] + there + + slashr = here.rfind("/") + + while 1: + if path[:2] == "./": + path = path[2:] + if path == ".": + path = "" + elif path[:3] == "../" or path == "..": + path = path[3:] + i = here.rfind("/", bpath, slashr) + if i >= 0: + here = here[: i + 1] + slashr = i + else: + break + + return here[: slashr + 1] + path + frag + + +def base() -> str: + """The base URI for this process - the Web equiv of cwd + + Relative or absolute unix-standard filenames parsed relative to + this yield the URI of the file. + If we had a reliable way of getting a computer name, + we should put it in the hostname just to prevent ambiguity + """ + # return "file://" + hostname + os.getcwd() + "/" + return "file://" + _fixslash(os.getcwd()) + "/" + + +def _fixslash(s: str) -> str: + """Fix windowslike filename to unixlike - (#ifdef WINDOWS)""" + s = s.replace("\\", "/") + if s[0] != "/" and s[1] == ":": + s = s[2:] # @@@ Hack when drive letter present + return s + + +CONTEXT = 0 +PRED = 1 +SUBJ = 2 +OBJ = 3 + +PARTS = PRED, SUBJ, OBJ +ALL4 = CONTEXT, PRED, SUBJ, OBJ + +SYMBOL = 0 +FORMULA = 1 +LITERAL = 2 +LITERAL_DT = 21 +LITERAL_LANG = 22 +ANONYMOUS = 3 +XMLLITERAL = 25 + +Logic_NS = "http://www.w3.org/2000/10/swap/log#" +NODE_MERGE_URI = Logic_NS + "is" # Pseudo-property indicating node merging +forSomeSym = Logic_NS + "forSome" +forAllSym = Logic_NS + "forAll" + +RDF_type_URI = "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" +RDF_NS_URI = "http://www.w3.org/1999/02/22-rdf-syntax-ns#" +OWL_NS = "http://www.w3.org/2002/07/owl#" +DAML_sameAs_URI = OWL_NS + "sameAs" +parsesTo_URI = Logic_NS + "parsesTo" +RDF_spec = "http://www.w3.org/TR/REC-rdf-syntax/" + +List_NS = RDF_NS_URI # From 20030808 +_Old_Logic_NS = "http://www.w3.org/2000/10/swap/log.n3#" + +N3_first = (SYMBOL, List_NS + "first") +N3_rest = (SYMBOL, List_NS + "rest") +N3_li = (SYMBOL, List_NS + "li") +N3_nil = (SYMBOL, List_NS + "nil") +N3_List = (SYMBOL, List_NS + "List") +N3_Empty = (SYMBOL, List_NS + "Empty") + + +runNamespaceValue: Optional[str] = None + + +def runNamespace() -> str: + """Returns a URI suitable as a namespace for run-local objects""" + # @@@ include hostname (privacy?) (hash it?) + global runNamespaceValue + if runNamespaceValue is None: + runNamespaceValue = join(base(), _unique_id()) + "#" + return runNamespaceValue + + +nextu = 0 + + +def uniqueURI() -> str: + """A unique URI""" + global nextu + nextu += 1 + return runNamespace() + "u_" + str(nextu) + + +tracking = False +chatty_flag = 50 + +# from why import BecauseOfData, becauseSubexpression + + +def BecauseOfData(*args: Any, **kargs: Any) -> None: + # print args, kargs + pass + + +def becauseSubexpression(*args: Any, **kargs: Any) -> None: + # print args, kargs + pass + + +N3_forSome_URI = forSomeSym +N3_forAll_URI = forAllSym + +# Magic resources we know about + +ADDED_HASH = "#" # Stop where we use this in case we want to remove it! +# This is the hash on namespace URIs + +RDF_type = (SYMBOL, RDF_type_URI) +DAML_sameAs = (SYMBOL, DAML_sameAs_URI) + +LOG_implies_URI = "http://www.w3.org/2000/10/swap/log#implies" + +BOOLEAN_DATATYPE = _XSD_PFX + "boolean" +DECIMAL_DATATYPE = _XSD_PFX + "decimal" +DOUBLE_DATATYPE = _XSD_PFX + "double" +FLOAT_DATATYPE = _XSD_PFX + "float" +INTEGER_DATATYPE = _XSD_PFX + "integer" + +option_noregen = 0 # If set, do not regenerate genids on output + +# @@ I18n - the notname chars need extending for well known unicode non-text +# characters. The XML spec switched to assuming unknown things were name +# characters. +# _namechars = string.lowercase + string.uppercase + string.digits + '_-' +_notQNameChars = set("\t\r\n !\"#$&'()*,+/;<=>?@[\\]^`{|}~") # else valid qname :-/ +_notKeywordsChars = _notQNameChars | {"."} +_notNameChars = _notQNameChars | {":"} # Assume anything else valid name :-/ +_rdfns = "http://www.w3.org/1999/02/22-rdf-syntax-ns#" + +hexChars = set("ABCDEFabcdef0123456789") +escapeChars = set("(_~.-!$&'()*+,;=/?#@%)") # valid for \ escapes in localnames +numberChars = set("0123456789-") +numberCharsPlus = numberChars | {"+", "."} + + +def unicodeExpand(m: Match) -> str: + try: + return chr(int(m.group(1), 16)) + except Exception: + raise Exception("Invalid unicode code point: " + m.group(1)) + + +unicodeEscape4 = re.compile(r"\\u([0-9a-fA-F]{4})") +unicodeEscape8 = re.compile(r"\\U([0-9a-fA-F]{8})") + + +N3CommentCharacter = "#" # For unix script # ! compatibility + +# Parse string to sink +# +# Regular expressions: +eol = re.compile(r"[ \t]*(#[^\n]*)?\r?\n") # end of line, poss. w/comment +eof = re.compile(r"[ \t]*(#[^\n]*)?$") # end of file, poss. w/comment +ws = re.compile(r"[ \t]*") # Whitespace not including NL +signed_integer = re.compile(r"[-+]?[0-9]+") # integer +integer_syntax = re.compile(r"[-+]?[0-9]+") +decimal_syntax = re.compile(r"[-+]?[0-9]*\.[0-9]+") +exponent_syntax = re.compile( + r"[-+]?(?:[0-9]+\.[0-9]*|\.[0-9]+|[0-9]+)(?:e|E)[-+]?[0-9]+" +) +digitstring = re.compile(r"[0-9]+") # Unsigned integer +interesting = re.compile(r"""[\\\r\n\"\']""") +langcode = re.compile(r"[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*") + + +class sfloat(str): # noqa: N801 + """don't normalize raw XSD.double string representation""" + + +class SinkParser: + def __init__( + self, + store: RDFSink, + openFormula: Optional[Formula] = None, + thisDoc: str = "", + baseURI: Optional[str] = None, + genPrefix: str = "", + why: Optional[Callable[[], None]] = None, + turtle: bool = False, + ): + """note: namespace names should *not* end in # ; + the # will get added during qname processing""" + + self._bindings = {} + if thisDoc != "": + assert ":" in thisDoc, "Document URI not absolute: <%s>" % thisDoc + self._bindings[""] = thisDoc + "#" # default + + self._store = store + if genPrefix: + # TODO FIXME: there is no function named setGenPrefix + store.setGenPrefix(genPrefix) # type: ignore[attr-defined] # pass it on + + self._thisDoc = thisDoc + self.lines = 0 # for error handling + self.startOfLine = 0 # For calculating character number + self._genPrefix = genPrefix + self.keywords = ["a", "this", "bind", "has", "is", "of", "true", "false"] + self.keywordsSet = 0 # Then only can others be considered qnames + self._anonymousNodes: Dict[str, BNode] = {} + # Dict of anon nodes already declared ln: Term + self._variables: Dict[str, Variable] = {} + self._parentVariables: Dict[str, Variable] = {} + self._reason = why # Why the parser was asked to parse this + + self.turtle = turtle # raise exception when encountering N3 extensions + # Turtle allows single or double quotes around strings, whereas N3 + # only allows double quotes. + self.string_delimiters = ('"', "'") if turtle else ('"',) + + self._reason2: Optional[Callable[..., None]] = None # Why these triples + # was: diag.tracking + if tracking: + # type error: "BecauseOfData" does not return a value + self._reason2 = BecauseOfData( # type: ignore[func-returns-value] + store.newSymbol(thisDoc), because=self._reason + ) + + self._baseURI: Optional[str] + if baseURI: + self._baseURI = baseURI + else: + if thisDoc: + self._baseURI = thisDoc + else: + self._baseURI = None + + assert not self._baseURI or ":" in self._baseURI + + if not self._genPrefix: + if self._thisDoc: + self._genPrefix = self._thisDoc + "#_g" + else: + self._genPrefix = uniqueURI() + + self._formula: Optional[Formula] + if openFormula is None and not turtle: + if self._thisDoc: + # TODO FIXME: store.newFormula does not take any arguments + self._formula = store.newFormula(thisDoc + "#_formula") # type: ignore[call-arg] + else: + self._formula = store.newFormula() + else: + self._formula = openFormula + + self._context: Optional[Formula] = self._formula + self._parentContext: Optional[Formula] = None + + def here(self, i: int) -> str: + """String generated from position in file + + This is for repeatability when referring people to bnodes in a document. + This has diagnostic uses less formally, as it should point one to which + bnode the arbitrary identifier actually is. It gives the + line and character number of the '[' charcacter or path character + which introduced the blank node. The first blank node is boringly + _L1C1. It used to be used only for tracking, but for tests in general + it makes the canonical ordering of bnodes repeatable.""" + + return "%s_L%iC%i" % (self._genPrefix, self.lines, i - self.startOfLine + 1) + + def formula(self) -> Optional[Formula]: + return self._formula + + def loadStream(self, stream: Union[IO[str], IO[bytes]]) -> Optional[Formula]: + return self.loadBuf(stream.read()) # Not ideal + + def loadBuf(self, buf: Union[str, bytes]) -> Optional[Formula]: + """Parses a buffer and returns its top level formula""" + self.startDoc() + + self.feed(buf) + return self.endDoc() # self._formula + + def feed(self, octets: Union[str, bytes]) -> None: + """Feed an octet stream to the parser + + if BadSyntax is raised, the string + passed in the exception object is the + remainder after any statements have been parsed. + So if there is more data to feed to the + parser, it should be straightforward to recover.""" + + if not isinstance(octets, str): + s = octets.decode("utf-8") + # NB already decoded, so \ufeff + if len(s) > 0 and s[0] == codecs.BOM_UTF8.decode("utf-8"): + s = s[1:] + else: + s = octets + + i = 0 + while i >= 0: + j = self.skipSpace(s, i) + if j < 0: + return + + i = self.directiveOrStatement(s, j) + if i < 0: + # print("# next char: %s" % s[j]) + self.BadSyntax(s, j, "expected directive or statement") + + def directiveOrStatement(self, argstr: str, h: int) -> int: + i = self.skipSpace(argstr, h) + if i < 0: + return i # EOF + + if self.turtle: + j = self.sparqlDirective(argstr, i) + if j >= 0: + return j + + j = self.directive(argstr, i) + if j >= 0: + return self.checkDot(argstr, j) + + j = self.statement(argstr, i) + if j >= 0: + return self.checkDot(argstr, j) + + return j + + # @@I18N + # _namechars = string.lowercase + string.uppercase + string.digits + '_-' + + def tok(self, tok: str, argstr: str, i: int, colon: bool = False) -> int: + """Check for keyword. Space must have been stripped on entry and + we must not be at end of file. + + if colon, then keyword followed by colon is ok + (`@prefix:` is ok, rdf:type shortcut a must be followed by ws) + """ + + assert tok[0] not in _notNameChars # not for punctuation + if argstr[i] == "@": + i += 1 + else: + if tok not in self.keywords: + return -1 # No, this has neither keywords declaration nor "@" + + i_plus_len_tok = i + len(tok) + if ( + argstr[i:i_plus_len_tok] == tok + and (argstr[i_plus_len_tok] in _notKeywordsChars) + or (colon and argstr[i_plus_len_tok] == ":") + ): + return i_plus_len_tok + else: + return -1 + + def sparqlTok(self, tok: str, argstr: str, i: int) -> int: + """Check for SPARQL keyword. Space must have been stripped on entry + and we must not be at end of file. + Case insensitive and not preceded by @ + """ + + assert tok[0] not in _notNameChars # not for punctuation + + len_tok = len(tok) + if argstr[i : i + len_tok].lower() == tok.lower() and ( + argstr[i + len_tok] in _notQNameChars + ): + i += len_tok + return i + else: + return -1 + + def directive(self, argstr: str, i: int) -> int: + j = self.skipSpace(argstr, i) + if j < 0: + return j # eof + res: typing.List[str] = [] + + j = self.tok("bind", argstr, i) # implied "#". Obsolete. + if j > 0: + self.BadSyntax(argstr, i, "keyword bind is obsolete: use @prefix") + + j = self.tok("keywords", argstr, i) + if j > 0: + if self.turtle: + self.BadSyntax(argstr, i, "Found 'keywords' when in Turtle mode.") + + i = self.commaSeparatedList(argstr, j, res, self.bareWord) + if i < 0: + self.BadSyntax( + argstr, i, "'@keywords' needs comma separated list of words" + ) + self.setKeywords(res[:]) + return i + + j = self.tok("forAll", argstr, i) + if j > 0: + if self.turtle: + self.BadSyntax(argstr, i, "Found 'forAll' when in Turtle mode.") + + i = self.commaSeparatedList(argstr, j, res, self.uri_ref2) + if i < 0: + self.BadSyntax(argstr, i, "Bad variable list after @forAll") + for x in res: + # self._context.declareUniversal(x) + if x not in self._variables or x in self._parentVariables: + # type error: Item "None" of "Optional[Formula]" has no attribute "newUniversal" + self._variables[x] = self._context.newUniversal(x) # type: ignore[union-attr] + return i + + j = self.tok("forSome", argstr, i) + if j > 0: + if self.turtle: + self.BadSyntax(argstr, i, "Found 'forSome' when in Turtle mode.") + + i = self.commaSeparatedList(argstr, j, res, self.uri_ref2) + if i < 0: + self.BadSyntax(argstr, i, "Bad variable list after @forSome") + for x in res: + # type error: Item "None" of "Optional[Formula]" has no attribute "declareExistential" + self._context.declareExistential(x) # type: ignore[union-attr] + return i + + j = self.tok("prefix", argstr, i, colon=True) # no implied "#" + if j >= 0: + t: typing.List[Union[Identifier, Tuple[str, str]]] = [] + i = self.qname(argstr, j, t) + if i < 0: + self.BadSyntax(argstr, j, "expected qname after @prefix") + j = self.uri_ref2(argstr, i, t) + if j < 0: + self.BadSyntax(argstr, i, "expected after @prefix _qname_") + ns: str = self.uriOf(t[1]) + + if self._baseURI: + ns = join(self._baseURI, ns) + elif ":" not in ns: + self.BadSyntax( + argstr, + j, + f"With no base URI, cannot use relative URI in @prefix <{ns}>", + ) + assert ":" in ns # must be absolute + self._bindings[t[0][0]] = ns + self.bind(t[0][0], hexify(ns)) + return j + + j = self.tok("base", argstr, i) # Added 2007/7/7 + if j >= 0: + t = [] + i = self.uri_ref2(argstr, j, t) + if i < 0: + self.BadSyntax(argstr, j, "expected after @base ") + ns = self.uriOf(t[0]) + + if self._baseURI: + ns = join(self._baseURI, ns) + else: + self.BadSyntax( + argstr, + j, + "With no previous base URI, cannot use " + + "relative URI in @base <" + + ns + + ">", + ) + assert ":" in ns # must be absolute + self._baseURI = ns + return i + + return -1 # Not a directive, could be something else. + + def sparqlDirective(self, argstr: str, i: int) -> int: + """ + turtle and trig support BASE/PREFIX without @ and without + terminating . + """ + + j = self.skipSpace(argstr, i) + if j < 0: + return j # eof + + j = self.sparqlTok("PREFIX", argstr, i) + if j >= 0: + t: typing.List[Any] = [] + i = self.qname(argstr, j, t) + if i < 0: + self.BadSyntax(argstr, j, "expected qname after @prefix") + j = self.uri_ref2(argstr, i, t) + if j < 0: + self.BadSyntax(argstr, i, "expected after @prefix _qname_") + ns = self.uriOf(t[1]) + + if self._baseURI: + ns = join(self._baseURI, ns) + elif ":" not in ns: + self.BadSyntax( + argstr, + j, + "With no base URI, cannot use " + + "relative URI in @prefix <" + + ns + + ">", + ) + assert ":" in ns # must be absolute + self._bindings[t[0][0]] = ns + self.bind(t[0][0], hexify(ns)) + return j + + j = self.sparqlTok("BASE", argstr, i) + if j >= 0: + t = [] + i = self.uri_ref2(argstr, j, t) + if i < 0: + self.BadSyntax(argstr, j, "expected after @base ") + ns = self.uriOf(t[0]) + + if self._baseURI: + ns = join(self._baseURI, ns) + else: + self.BadSyntax( + argstr, + j, + "With no previous base URI, cannot use " + + "relative URI in @base <" + + ns + + ">", + ) + assert ":" in ns # must be absolute + self._baseURI = ns + return i + + return -1 # Not a directive, could be something else. + + def bind(self, qn: str, uri: bytes) -> None: + assert isinstance(uri, bytes), "Any unicode must be %x-encoded already" + if qn == "": + self._store.setDefaultNamespace(uri) + else: + self._store.bind(qn, uri) + + def setKeywords(self, k: Optional[typing.List[str]]) -> None: + """Takes a list of strings""" + if k is None: + self.keywordsSet = 0 + else: + self.keywords = k + self.keywordsSet = 1 + + def startDoc(self) -> None: + # was: self._store.startDoc() + self._store.startDoc(self._formula) + + def endDoc(self) -> Optional[Formula]: + """Signal end of document and stop parsing. returns formula""" + self._store.endDoc(self._formula) # don't canonicalize yet + return self._formula + + def makeStatement(self, quadruple) -> None: + # $$$$$$$$$$$$$$$$$$$$$ + # print "# Parser output: ", `quadruple` + self._store.makeStatement(quadruple, why=self._reason2) + + def statement(self, argstr: str, i: int) -> int: + r: typing.List[Any] = [] + i = self.object(argstr, i, r) # Allow literal for subject - extends RDF + if i < 0: + return i + + j = self.property_list(argstr, i, r[0]) + + if j < 0: + self.BadSyntax(argstr, i, "expected propertylist") + return j + + def subject(self, argstr: str, i: int, res: MutableSequence[Any]) -> int: + return self.item(argstr, i, res) + + def verb(self, argstr: str, i: int, res: MutableSequence[Any]) -> int: + """has _prop_ + is _prop_ of + a + = + _prop_ + >- prop -> + <- prop -< + _operator_""" + + j = self.skipSpace(argstr, i) + if j < 0: + return j # eof + + r: typing.List[Any] = [] + + j = self.tok("has", argstr, i) + if j >= 0: + if self.turtle: + self.BadSyntax(argstr, i, "Found 'has' keyword in Turtle mode") + + i = self.prop(argstr, j, r) + if i < 0: + self.BadSyntax(argstr, j, "expected property after 'has'") + res.append(("->", r[0])) + return i + + j = self.tok("is", argstr, i) + if j >= 0: + if self.turtle: + self.BadSyntax(argstr, i, "Found 'is' keyword in Turtle mode") + + i = self.prop(argstr, j, r) + if i < 0: + self.BadSyntax(argstr, j, "expected after 'is'") + j = self.skipSpace(argstr, i) + if j < 0: + self.BadSyntax( + argstr, i, "End of file found, expected property after 'is'" + ) + i = j + j = self.tok("of", argstr, i) + if j < 0: + self.BadSyntax(argstr, i, "expected 'of' after 'is' ") + res.append(("<-", r[0])) + return j + + j = self.tok("a", argstr, i) + if j >= 0: + res.append(("->", RDF_type)) + return j + + if argstr[i : i + 2] == "<=": + if self.turtle: + self.BadSyntax(argstr, i, "Found '<=' in Turtle mode. ") + + res.append(("<-", self._store.newSymbol(Logic_NS + "implies"))) + return i + 2 + + if argstr[i] == "=": + if self.turtle: + self.BadSyntax(argstr, i, "Found '=' in Turtle mode") + if argstr[i + 1] == ">": + res.append(("->", self._store.newSymbol(Logic_NS + "implies"))) + return i + 2 + res.append(("->", DAML_sameAs)) + return i + 1 + + if argstr[i : i + 2] == ":=": + if self.turtle: + self.BadSyntax(argstr, i, "Found ':=' in Turtle mode") + + # patch file relates two formulae, uses this @@ really? + res.append(("->", Logic_NS + "becomes")) + return i + 2 + + j = self.prop(argstr, i, r) + if j >= 0: + res.append(("->", r[0])) + return j + + if argstr[i : i + 2] == ">-" or argstr[i : i + 2] == "<-": + self.BadSyntax(argstr, j, ">- ... -> syntax is obsolete.") + + return -1 + + def prop(self, argstr: str, i: int, res: MutableSequence[Any]) -> int: + return self.item(argstr, i, res) + + def item(self, argstr: str, i, res: MutableSequence[Any]) -> int: + return self.path(argstr, i, res) + + def blankNode(self, uri: Optional[str] = None) -> BNode: + return self._store.newBlankNode(self._context, uri, why=self._reason2) + + def path(self, argstr: str, i: int, res: MutableSequence[Any]) -> int: + """Parse the path production.""" + j = self.nodeOrLiteral(argstr, i, res) + if j < 0: + return j # nope + + while argstr[j] in {"!", "^"}: # no spaces, must follow exactly (?) + ch = argstr[j] + subj = res.pop() + obj = self.blankNode(uri=self.here(j)) + j = self.node(argstr, j + 1, res) + if j < 0: + self.BadSyntax(argstr, j, "EOF found in middle of path syntax") + pred = res.pop() + if ch == "^": # Reverse traverse + self.makeStatement((self._context, pred, obj, subj)) + else: + self.makeStatement((self._context, pred, subj, obj)) + res.append(obj) + return j + + def anonymousNode(self, ln: str) -> BNode: + """Remember or generate a term for one of these _: anonymous nodes""" + term = self._anonymousNodes.get(ln, None) + if term is not None: + return term + term = self._store.newBlankNode(self._context, why=self._reason2) + self._anonymousNodes[ln] = term + return term + + def node( + self, + argstr: str, + i: int, + res: MutableSequence[Any], + subjectAlready: Optional[Node] = None, + ) -> int: + """Parse the production. + Space is now skipped once at the beginning + instead of in multiple calls to self.skipSpace(). + """ + subj: Optional[Node] = subjectAlready + + j = self.skipSpace(argstr, i) + if j < 0: + return j # eof + i = j + ch = argstr[i] # Quick 1-character checks first: + + if ch == "[": + bnodeID = self.here(i) + j = self.skipSpace(argstr, i + 1) + if j < 0: + self.BadSyntax(argstr, i, "EOF after '['") + # Hack for "is" binding name to anon node + if argstr[j] == "=": + if self.turtle: + self.BadSyntax( + argstr, j, "Found '[=' or '[ =' when in turtle mode." + ) + i = j + 1 + objs: typing.List[Node] = [] + j = self.objectList(argstr, i, objs) + if j >= 0: + subj = objs[0] + if len(objs) > 1: + for obj in objs: + self.makeStatement((self._context, DAML_sameAs, subj, obj)) + j = self.skipSpace(argstr, j) + if j < 0: + self.BadSyntax( + argstr, i, "EOF when objectList expected after [ = " + ) + if argstr[j] == ";": + j += 1 + else: + self.BadSyntax(argstr, i, "objectList expected after [= ") + + if subj is None: + subj = self.blankNode(uri=bnodeID) + + i = self.property_list(argstr, j, subj) + if i < 0: + self.BadSyntax(argstr, j, "property_list expected") + + j = self.skipSpace(argstr, i) + if j < 0: + self.BadSyntax( + argstr, i, "EOF when ']' expected after [ " + ) + if argstr[j] != "]": + self.BadSyntax(argstr, j, "']' expected") + res.append(subj) + return j + 1 + + if not self.turtle and ch == "{": + # if self.turtle: + # self.BadSyntax(argstr, i, + # "found '{' while in Turtle mode, Formulas not supported!") + ch2 = argstr[i + 1] + if ch2 == "$": + # a set + i += 1 + j = i + 1 + List = [] + first_run = True + while 1: + i = self.skipSpace(argstr, j) + if i < 0: + self.BadSyntax(argstr, i, "needed '$}', found end.") + if argstr[i : i + 2] == "$}": + j = i + 2 + break + + if not first_run: + if argstr[i] == ",": + i += 1 + else: + self.BadSyntax(argstr, i, "expected: ','") + else: + first_run = False + + item: typing.List[Any] = [] + j = self.item(argstr, i, item) # @@@@@ should be path, was object + if j < 0: + self.BadSyntax(argstr, i, "expected item in set or '$}'") + List.append(self._store.intern(item[0])) + res.append(self._store.newSet(List, self._context)) + return j + else: + # parse a formula + j = i + 1 + oldParentContext = self._parentContext + self._parentContext = self._context + parentAnonymousNodes = self._anonymousNodes + grandParentVariables = self._parentVariables + self._parentVariables = self._variables + self._anonymousNodes = {} + self._variables = self._variables.copy() + reason2 = self._reason2 + self._reason2 = becauseSubexpression + if subj is None: + # type error: Incompatible types in assignment (expression has type "Formula", variable has type "Optional[Node]") + subj = self._store.newFormula() # type: ignore[assignment] + # type error: Incompatible types in assignment (expression has type "Optional[Node]", variable has type "Optional[Formula]") + self._context = subj # type: ignore[assignment] + + while 1: + i = self.skipSpace(argstr, j) + if i < 0: + self.BadSyntax(argstr, i, "needed '}', found end.") + + if argstr[i] == "}": + j = i + 1 + break + + j = self.directiveOrStatement(argstr, i) + if j < 0: + self.BadSyntax(argstr, i, "expected statement or '}'") + + self._anonymousNodes = parentAnonymousNodes + self._variables = self._parentVariables + self._parentVariables = grandParentVariables + self._context = self._parentContext + self._reason2 = reason2 + self._parentContext = oldParentContext + # type error: Item "Node" of "Optional[Node]" has no attribute "close" + res.append( + subj.close() # type: ignore[union-attr] + ) # No use until closed + return j + + if ch == "(": + thing_type: Callable[ + [typing.List[Any], Optional[Formula]], Union[Set[Any], IdentifiedNode] + ] + thing_type = self._store.newList + ch2 = argstr[i + 1] + if ch2 == "$": + thing_type = self._store.newSet + i += 1 + j = i + 1 + + List = [] + while 1: + i = self.skipSpace(argstr, j) + if i < 0: + self.BadSyntax(argstr, i, "needed ')', found end.") + if argstr[i] == ")": + j = i + 1 + break + + item = [] + j = self.item(argstr, i, item) # @@@@@ should be path, was object + if j < 0: + self.BadSyntax(argstr, i, "expected item in list or ')'") + List.append(self._store.intern(item[0])) + res.append(thing_type(List, self._context)) + return j + + j = self.tok("this", argstr, i) # This context + if j >= 0: + self.BadSyntax( + argstr, + i, + "Keyword 'this' was ancient N3. Now use " + + "@forSome and @forAll keywords.", + ) + + # booleans + j = self.tok("true", argstr, i) + if j >= 0: + res.append(True) + return j + j = self.tok("false", argstr, i) + if j >= 0: + res.append(False) + return j + + if subj is None: # If this can be a named node, then check for a name. + j = self.uri_ref2(argstr, i, res) + if j >= 0: + return j + + return -1 + + def property_list(self, argstr: str, i: int, subj: Node) -> int: + """Parse property list + Leaves the terminating punctuation in the buffer + """ + while 1: + while 1: # skip repeat ; + j = self.skipSpace(argstr, i) + if j < 0: + self.BadSyntax( + argstr, i, "EOF found when expected verb in property list" + ) + if argstr[j] != ";": + break + i = j + 1 + + if argstr[j : j + 2] == ":-": + if self.turtle: + self.BadSyntax(argstr, j, "Found in ':-' in Turtle mode") + i = j + 2 + res: typing.List[Any] = [] + j = self.node(argstr, i, res, subj) + if j < 0: + self.BadSyntax(argstr, i, "bad {} or () or [] node after :- ") + i = j + continue + i = j + v: typing.List[Any] = [] + j = self.verb(argstr, i, v) + if j <= 0: + return i # void but valid + + objs: typing.List[Any] = [] + i = self.objectList(argstr, j, objs) + if i < 0: + self.BadSyntax(argstr, j, "objectList expected") + for obj in objs: + dira, sym = v[0] + if dira == "->": + self.makeStatement((self._context, sym, subj, obj)) + else: + self.makeStatement((self._context, sym, obj, subj)) + + j = self.skipSpace(argstr, i) + if j < 0: + self.BadSyntax(argstr, j, "EOF found in list of objects") + if argstr[i] != ";": + return i + i += 1 # skip semicolon and continue + + def commaSeparatedList( + self, + argstr: str, + j: int, + res: MutableSequence[Any], + what: Callable[[str, int, MutableSequence[Any]], int], + ) -> int: + """return value: -1 bad syntax; >1 new position in argstr + res has things found appended + """ + i = self.skipSpace(argstr, j) + if i < 0: + self.BadSyntax(argstr, i, "EOF found expecting comma sep list") + if argstr[i] == ".": + return j # empty list is OK + i = what(argstr, i, res) + if i < 0: + return -1 + + while 1: + j = self.skipSpace(argstr, i) + if j < 0: + return j # eof + ch = argstr[j] + if ch != ",": + if ch != ".": + return -1 + return j # Found but not swallowed "." + i = what(argstr, j + 1, res) + if i < 0: + self.BadSyntax(argstr, i, "bad list content") + + def objectList(self, argstr: str, i: int, res: MutableSequence[Any]) -> int: + i = self.object(argstr, i, res) + if i < 0: + return -1 + while 1: + j = self.skipSpace(argstr, i) + if j < 0: + self.BadSyntax(argstr, j, "EOF found after object") + if argstr[j] != ",": + return j # Found something else! + i = self.object(argstr, j + 1, res) + if i < 0: + return i + + def checkDot(self, argstr: str, i: int) -> int: + j = self.skipSpace(argstr, i) + if j < 0: + return j # eof + ch = argstr[j] + if ch == ".": + return j + 1 # skip + if ch == "}": + return j # don't skip it + if ch == "]": + return j + self.BadSyntax(argstr, j, "expected '.' or '}' or ']' at end of statement") + + def uri_ref2(self, argstr: str, i: int, res: MutableSequence[Any]) -> int: + """Generate uri from n3 representation. + + Note that the RDF convention of directly concatenating + NS and local name is now used though I prefer inserting a '#' + to make the namesapces look more like what XML folks expect. + """ + qn: typing.List[Any] = [] + j = self.qname(argstr, i, qn) + if j >= 0: + pfx, ln = qn[0] + if pfx is None: + assert 0, "not used?" + ns = self._baseURI + ADDED_HASH # type: ignore[unreachable] + else: + try: + ns = self._bindings[pfx] + except KeyError: + if pfx == "_": # Magic prefix 2001/05/30, can be changed + res.append(self.anonymousNode(ln)) + return j + if not self.turtle and pfx == "": + ns = join(self._baseURI or "", "#") + else: + self.BadSyntax(argstr, i, 'Prefix "%s:" not bound' % (pfx)) + symb = self._store.newSymbol(ns + ln) + res.append(self._variables.get(symb, symb)) + return j + + i = self.skipSpace(argstr, i) + if i < 0: + return -1 + + if argstr[i] == "?": + v: typing.List[Any] = [] + j = self.variable(argstr, i, v) + if j > 0: # Forget variables as a class, only in context. + res.append(v[0]) + return j + return -1 + + elif argstr[i] == "<": + st = i + 1 + i = argstr.find(">", st) + if i >= 0: + uref = argstr[st:i] # the join should dealt with "": + + # expand unicode escapes + uref = unicodeEscape8.sub(unicodeExpand, uref) + uref = unicodeEscape4.sub(unicodeExpand, uref) + + if self._baseURI: + uref = join(self._baseURI, uref) # was: uripath.join + else: + assert ( + ":" in uref + ), "With no base URI, cannot deal with relative URIs" + if argstr[i - 1] == "#" and not uref[-1:] == "#": + uref += "#" # She meant it! Weirdness in urlparse? + symb = self._store.newSymbol(uref) + res.append(self._variables.get(symb, symb)) + return i + 1 + self.BadSyntax(argstr, j, "unterminated URI reference") + + elif self.keywordsSet: + v = [] + j = self.bareWord(argstr, i, v) + if j < 0: + return -1 # Forget variables as a class, only in context. + if v[0] in self.keywords: + self.BadSyntax(argstr, i, 'Keyword "%s" not allowed here.' % v[0]) + res.append(self._store.newSymbol(self._bindings[""] + v[0])) + return j + else: + return -1 + + def skipSpace(self, argstr: str, i: int) -> int: + """Skip white space, newlines and comments. + return -1 if EOF, else position of first non-ws character""" + + # Most common case is a non-commented line starting with few spaces and tabs. + try: + while True: + ch = argstr[i] + if ch in {" ", "\t"}: + i += 1 + continue + elif ch not in {"#", "\r", "\n"}: + return i + break + except IndexError: + return -1 + + while 1: + m = eol.match(argstr, i) + if m is None: + break + self.lines += 1 + self.startOfLine = i = m.end() # Point to first character unmatched + m = ws.match(argstr, i) + if m is not None: + i = m.end() + m = eof.match(argstr, i) + return i if m is None else -1 + + def variable(self, argstr: str, i: int, res) -> int: + """?abc -> variable(:abc)""" + + j = self.skipSpace(argstr, i) + if j < 0: + return -1 + + if argstr[j] != "?": + return -1 + j += 1 + i = j + if argstr[j] in numberChars: + self.BadSyntax(argstr, j, "Variable name can't start with '%s'" % argstr[j]) + len_argstr = len(argstr) + while i < len_argstr and argstr[i] not in _notKeywordsChars: + i += 1 + if self._parentContext is None: + varURI = self._store.newSymbol(self._baseURI + "#" + argstr[j:i]) # type: ignore[operator] + if varURI not in self._variables: + # type error: Item "None" of "Optional[Formula]" has no attribute "newUniversal" + self._variables[varURI] = self._context.newUniversal( # type: ignore[union-attr] + varURI, why=self._reason2 + ) + res.append(self._variables[varURI]) + return i + # @@ was: + # self.BadSyntax(argstr, j, + # "Can't use ?xxx syntax for variable in outermost level: %s" + # % argstr[j-1:i]) + varURI = self._store.newSymbol(self._baseURI + "#" + argstr[j:i]) # type: ignore[operator] + if varURI not in self._parentVariables: + self._parentVariables[varURI] = self._parentContext.newUniversal( + varURI, why=self._reason2 + ) + res.append(self._parentVariables[varURI]) + return i + + def bareWord(self, argstr: str, i: int, res: MutableSequence[Any]) -> int: + """abc -> :abc""" + j = self.skipSpace(argstr, i) + if j < 0: + return -1 + + if argstr[j] in numberChars or argstr[j] in _notKeywordsChars: + return -1 + i = j + len_argstr = len(argstr) + while i < len_argstr and argstr[i] not in _notKeywordsChars: + i += 1 + res.append(argstr[j:i]) + return i + + def qname( + self, + argstr: str, + i: int, + res: MutableSequence[Union[Identifier, Tuple[str, str]]], + ) -> int: + """ + xyz:def -> ('xyz', 'def') + If not in keywords and keywordsSet: def -> ('', 'def') + :def -> ('', 'def') + """ + + i = self.skipSpace(argstr, i) + if i < 0: + return -1 + + c = argstr[i] + if c in numberCharsPlus: + return -1 + len_argstr = len(argstr) + if c not in _notNameChars: + j = i + i += 1 + + try: + while argstr[i] not in _notNameChars: + i += 1 + except IndexError: + pass # Very rare. + + if argstr[i - 1] == ".": # qname cannot end with "." + i -= 1 + if i == j: + return -1 + ln = argstr[j:i] + + else: # First character is non-alpha + ln = "" # Was: None - TBL (why? useful?) + + if i < len_argstr and argstr[i] == ":": + pfx = ln + # bnodes names have different rules + if pfx == "_": + allowedChars = _notNameChars + else: + allowedChars = _notQNameChars + + i += 1 + lastslash = False + start = i + ln = "" + while i < len_argstr: + c = argstr[i] + if c == "\\" and not lastslash: # Very rare. + lastslash = True + if start < i: + ln += argstr[start:i] + start = i + 1 + elif c not in allowedChars or lastslash: # Most common case is "a-zA-Z" + if lastslash: + if c not in escapeChars: + raise BadSyntax( + self._thisDoc, + self.lines, + argstr, + i, + "illegal escape " + c, + ) + elif c == "%": # Very rare. + if ( + argstr[i + 1] not in hexChars + or argstr[i + 2] not in hexChars + ): + raise BadSyntax( + self._thisDoc, + self.lines, + argstr, + i, + "illegal hex escape " + c, + ) + lastslash = False + else: + break + i += 1 + + if lastslash: + raise BadSyntax( + self._thisDoc, self.lines, argstr, i, "qname cannot end with \\" + ) + + if argstr[i - 1] == ".": + # localname cannot end in . + if len(ln) == 0 and start == i: + return -1 + i -= 1 + + if start < i: + ln += argstr[start:i] + + res.append((pfx, ln)) + return i + + else: # delimiter was not ":" + if ln and self.keywordsSet and ln not in self.keywords: + res.append(("", ln)) + return i + return -1 + + def object( + self, + argstr: str, + i: int, + res: MutableSequence[Any], + ) -> int: + j = self.subject(argstr, i, res) + if j >= 0: + return j + else: + j = self.skipSpace(argstr, i) + if j < 0: + return -1 + else: + i = j + + ch = argstr[i] + if ch in self.string_delimiters: + ch_three = ch * 3 + if argstr[i : i + 3] == ch_three: + delim = ch_three + i += 3 + else: + delim = ch + i += 1 + + j, s = self.strconst(argstr, i, delim) + + res.append(self._store.newLiteral(s)) # type: ignore[call-arg] # TODO FIXME + return j + else: + return -1 + + def nodeOrLiteral(self, argstr: str, i: int, res: MutableSequence[Any]) -> int: + j = self.node(argstr, i, res) + startline = self.lines # Remember where for error messages + if j >= 0: + return j + else: + j = self.skipSpace(argstr, i) + if j < 0: + return -1 + else: + i = j + + ch = argstr[i] + if ch in numberCharsPlus: + m = exponent_syntax.match(argstr, i) + if m: + j = m.end() + res.append(sfloat(argstr[i:j])) + return j + + m = decimal_syntax.match(argstr, i) + if m: + j = m.end() + res.append(Decimal(argstr[i:j])) + return j + + m = integer_syntax.match(argstr, i) + if m: + j = m.end() + res.append(long_type(argstr[i:j])) + return j + + # return -1 ## or fall through? + + ch_three = ch * 3 + if ch in self.string_delimiters: + if argstr[i : i + 3] == ch_three: + delim = ch_three + i += 3 + else: + delim = ch + i += 1 + + dt = None + j, s = self.strconst(argstr, i, delim) + lang = None + if argstr[j] == "@": # Language? + m = langcode.match(argstr, j + 1) + if m is None: + raise BadSyntax( + self._thisDoc, + startline, + argstr, + i, + "Bad language code syntax on string " + "literal, after @", + ) + i = m.end() + lang = argstr[j + 1 : i] + j = i + if argstr[j : j + 2] == "^^": + res2: typing.List[Any] = [] + j = self.uri_ref2(argstr, j + 2, res2) # Read datatype URI + dt = res2[0] + res.append(self._store.newLiteral(s, dt, lang)) + return j + else: + return -1 + + def uriOf(self, sym: Union[Identifier, Tuple[str, str]]) -> str: + if isinstance(sym, tuple): + return sym[1] # old system for --pipe + # return sym.uriref() # cwm api + return sym + + def strconst(self, argstr: str, i: int, delim: str) -> Tuple[int, str]: + """parse an N3 string constant delimited by delim. + return index, val + """ + delim1 = delim[0] + delim2, delim3, delim4, delim5 = delim1 * 2, delim1 * 3, delim1 * 4, delim1 * 5 + + j = i + ustr = "" # Empty unicode string + startline = self.lines # Remember where for error messages + len_argstr = len(argstr) + while j < len_argstr: + if argstr[j] == delim1: + if delim == delim1: # done when delim is " or ' + i = j + 1 + return i, ustr + if ( + delim == delim3 + ): # done when delim is """ or ''' and, respectively ... + if argstr[j : j + 5] == delim5: # ... we have "" or '' before + i = j + 5 + ustr += delim2 + return i, ustr + if argstr[j : j + 4] == delim4: # ... we have " or ' before + i = j + 4 + ustr += delim1 + return i, ustr + if argstr[j : j + 3] == delim3: # current " or ' is part of delim + i = j + 3 + return i, ustr + + # we are inside of the string and current char is " or ' + j += 1 + ustr += delim1 + continue + + m = interesting.search(argstr, j) # was argstr[j:]. + # Note for pos param to work, MUST be compiled ... re bug? + assert m, "Quote expected in string at ^ in %s^%s" % ( + argstr[j - 20 : j], + argstr[j : j + 20], + ) # at least need a quote + + i = m.start() + try: + ustr += argstr[j:i] + except UnicodeError: + err = "" + for c in argstr[j:i]: + err = err + (" %02x" % ord(c)) + streason = sys.exc_info()[1].__str__() + raise BadSyntax( + self._thisDoc, + startline, + argstr, + j, + "Unicode error appending characters" + + " %s to string, because\n\t%s" % (err, streason), + ) + + # print "@@@ i = ",i, " j=",j, "m.end=", m.end() + + ch = argstr[i] + if ch == delim1: + j = i + continue + elif ch in {'"', "'"} and ch != delim1: + ustr += ch + j = i + 1 + continue + elif ch in {"\r", "\n"}: + if delim == delim1: + raise BadSyntax( + self._thisDoc, + startline, + argstr, + i, + "newline found in string literal", + ) + self.lines += 1 + ustr += ch + j = i + 1 + self.startOfLine = j + + elif ch == "\\": + j = i + 1 + ch = argstr[j] # Will be empty if string ends + if not ch: + raise BadSyntax( + self._thisDoc, + startline, + argstr, + i, + "unterminated string literal (2)", + ) + k = "abfrtvn\\\"'".find(ch) + if k >= 0: + uch = "\a\b\f\r\t\v\n\\\"'"[k] + ustr += uch + j += 1 + elif ch == "u": + j, ch = self.uEscape(argstr, j + 1, startline) + ustr += ch + elif ch == "U": + j, ch = self.UEscape(argstr, j + 1, startline) + ustr += ch + else: + self.BadSyntax(argstr, i, "bad escape") + + self.BadSyntax(argstr, i, "unterminated string literal") + + def _unicodeEscape( + self, + argstr: str, + i: int, + startline: int, + reg: Pattern[str], + n: int, + prefix: str, + ) -> Tuple[int, str]: + if len(argstr) < i + n: + raise BadSyntax( + self._thisDoc, startline, argstr, i, "unterminated string literal(3)" + ) + try: + return i + n, reg.sub(unicodeExpand, "\\" + prefix + argstr[i : i + n]) + except Exception: + raise BadSyntax( + self._thisDoc, + startline, + argstr, + i, + "bad string literal hex escape: " + argstr[i : i + n], + ) + + def uEscape(self, argstr: str, i: int, startline: int) -> Tuple[int, str]: + return self._unicodeEscape(argstr, i, startline, unicodeEscape4, 4, "u") + + def UEscape(self, argstr: str, i: int, startline: int) -> Tuple[int, str]: + return self._unicodeEscape(argstr, i, startline, unicodeEscape8, 8, "U") + + def BadSyntax(self, argstr: str, i: int, msg: str) -> NoReturn: + raise BadSyntax(self._thisDoc, self.lines, argstr, i, msg) + + +# If we are going to do operators then they should generate +# [ is operator:plus of ( \1 \2 ) ] + + +class BadSyntax(SyntaxError): # noqa: N818 + def __init__(self, uri: str, lines: int, argstr: str, i: int, why: str): + self._str = argstr.encode("utf-8") # Better go back to strings for errors + self._i = i + self._why = why + self.lines = lines + self._uri = uri + + def __str__(self) -> str: + argstr = self._str + i = self._i + st = 0 + if i > 60: + pre = "..." + st = i - 60 + else: + pre = "" + if len(argstr) - i > 60: + post = "..." + else: + post = "" + + # type error: On Python 3 formatting "b'abc'" with "%s" produces "b'abc'", not "abc"; use "%r" if this is desired behavior + return 'at line %i of <%s>:\nBad syntax (%s) at ^ in:\n"%s%s^%s%s"' % ( + self.lines + 1, # type: ignore[str-bytes-safe] + self._uri, + self._why, + pre, + argstr[st:i], + argstr[i : i + 60], + post, + ) + + @property + def message(self) -> str: + return str(self) + + +############################################################################### +class Formula: + number = 0 + + def __init__(self, parent: Graph): + self.uuid = uuid4().hex + self.counter = 0 + Formula.number += 1 + self.number = Formula.number + self.existentials: Dict[str, BNode] = {} + self.universals: Dict[str, BNode] = {} + + self.quotedgraph = QuotedGraph(store=parent.store, identifier=self.id()) + + def __str__(self) -> str: + return "_:Formula%s" % self.number + + def id(self) -> BNode: + return BNode("_:Formula%s" % self.number) + + def newBlankNode( + self, uri: Optional[str] = None, why: Optional[Any] = None + ) -> BNode: + if uri is None: + self.counter += 1 + bn = BNode("f%sb%s" % (self.uuid, self.counter)) + else: + bn = BNode(uri.split("#").pop().replace("_", "b")) + return bn + + def newUniversal(self, uri: str, why: Optional[Any] = None) -> Variable: + return Variable(uri.split("#").pop()) + + def declareExistential(self, x: str) -> None: + self.existentials[x] = self.newBlankNode() + + def close(self) -> QuotedGraph: + return self.quotedgraph + + +r_hibyte = re.compile(r"([\x80-\xff])") + + +class RDFSink: + def __init__(self, graph: Graph): + self.rootFormula: Optional[Formula] = None + self.uuid = uuid4().hex + self.counter = 0 + self.graph = graph + + def newFormula(self) -> Formula: + fa = getattr(self.graph.store, "formula_aware", False) + if not fa: + raise ParserError( + "Cannot create formula parser with non-formula-aware store." + ) + f = Formula(self.graph) + return f + + def newGraph(self, identifier: Identifier) -> Graph: + return Graph(self.graph.store, identifier) + + def newSymbol(self, *args: str) -> URIRef: + return URIRef(args[0]) + + def newBlankNode( + self, + arg: Optional[Union[Formula, Graph, Any]] = None, + uri: Optional[str] = None, + why: Optional[Callable[[], None]] = None, + ) -> BNode: + if isinstance(arg, Formula): + return arg.newBlankNode(uri) + elif isinstance(arg, Graph) or arg is None: + self.counter += 1 + bn = BNode("n%sb%s" % (self.uuid, self.counter)) + else: + bn = BNode(str(arg[0]).split("#").pop().replace("_", "b")) + return bn + + def newLiteral(self, s: str, dt: Optional[URIRef], lang: Optional[str]) -> Literal: + if dt: + return Literal(s, datatype=dt) + else: + return Literal(s, lang=lang) + + def newList(self, n: typing.List[Any], f: Optional[Formula]) -> IdentifiedNode: + nil = self.newSymbol("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil") + if not n: + return nil + + first = self.newSymbol("http://www.w3.org/1999/02/22-rdf-syntax-ns#first") + rest = self.newSymbol("http://www.w3.org/1999/02/22-rdf-syntax-ns#rest") + af = a = self.newBlankNode(f) + + for ne in n[:-1]: + self.makeStatement((f, first, a, ne)) + an = self.newBlankNode(f) + self.makeStatement((f, rest, a, an)) + a = an + self.makeStatement((f, first, a, n[-1])) + self.makeStatement((f, rest, a, nil)) + return af + + def newSet(self, *args: _AnyT) -> Set[_AnyT]: + return set(args) + + def setDefaultNamespace(self, *args: bytes) -> str: + return ":".join(repr(n) for n in args) + + def makeStatement( + self, + quadruple: Tuple[Optional[Union[Formula, Graph]], Node, Node, Node], + why: Optional[Any] = None, + ) -> None: + f, p, s, o = quadruple + + if hasattr(p, "formula"): + raise ParserError("Formula used as predicate") + + # type error: Argument 1 to "normalise" of "RDFSink" has incompatible type "Union[Formula, Graph, None]"; expected "Optional[Formula]" + s = self.normalise(f, s) # type: ignore[arg-type] + p = self.normalise(f, p) # type: ignore[arg-type] + o = self.normalise(f, o) # type: ignore[arg-type] + + if f == self.rootFormula: + # print s, p, o, '.' + self.graph.add((s, p, o)) + elif isinstance(f, Formula): + f.quotedgraph.add((s, p, o)) + else: + # type error: Item "None" of "Optional[Graph]" has no attribute "add" + f.add((s, p, o)) # type: ignore[union-attr] + + # return str(quadruple) + + def normalise( + self, + f: Optional[Formula], + n: Union[Tuple[int, str], bool, int, Decimal, sfloat, _AnyT], + ) -> Union[URIRef, Literal, BNode, _AnyT]: + if isinstance(n, tuple): + return URIRef(str(n[1])) + + if isinstance(n, bool): + s = Literal(str(n).lower(), datatype=BOOLEAN_DATATYPE) + return s + + if isinstance(n, int) or isinstance(n, long_type): + s = Literal(str(n), datatype=INTEGER_DATATYPE) + return s + + if isinstance(n, Decimal): + value = str(n) + if value == "-0": + value = "0" + s = Literal(value, datatype=DECIMAL_DATATYPE) + return s + + if isinstance(n, sfloat): + s = Literal(str(n), datatype=DOUBLE_DATATYPE) + return s + + if isinstance(f, Formula): + if n in f.existentials: + if TYPE_CHECKING: + assert isinstance(n, URIRef) + return f.existentials[n] + + # if isinstance(n, Var): + # if f.universals.has_key(n): + # return f.universals[n] + # f.universals[n] = f.newBlankNode() + # return f.universals[n] + # type error: Incompatible return value type (got "Union[int, _AnyT]", expected "Union[URIRef, Literal, BNode, _AnyT]") [return-value] + return n + + def intern(self, something: _AnyT) -> _AnyT: + return something + + def bind(self, pfx, uri) -> None: + pass # print pfx, ':', uri + + def startDoc(self, formula: Optional[Formula]) -> None: + self.rootFormula = formula + + def endDoc(self, formula: Optional[Formula]) -> None: + pass + + +################################################### +# +# Utilities +# + + +def hexify(ustr: str) -> bytes: + """Use URL encoding to return an ASCII string + corresponding to the given UTF8 string + + ```python + >>> hexify("http://example/a b") + b'http://example/a%20b' + + ``` + """ + # s1=ustr.encode('utf-8') + s = "" + for ch in ustr: # .encode('utf-8'): + if ord(ch) > 126 or ord(ch) < 33: + ch = "%%%02X" % ord(ch) + else: + ch = "%c" % ord(ch) + s = s + ch + return s.encode("latin-1") + + +class TurtleParser(Parser): + """An RDFLib parser for Turtle + + See http://www.w3.org/TR/turtle/ + """ + + def __init__(self): + pass + + def parse( + self, + source: InputSource, + graph: Graph, + encoding: Optional[str] = "utf-8", + turtle: bool = True, + ) -> None: + if encoding not in [None, "utf-8"]: + raise ParserError( + "N3/Turtle files are always utf-8 encoded, I was passed: %s" % encoding + ) + + sink = RDFSink(graph) + + baseURI = graph.absolutize(source.getPublicId() or source.getSystemId() or "") + p = SinkParser(sink, baseURI=baseURI, turtle=turtle) + # N3 parser prefers str stream + stream = source.getCharacterStream() + if not stream: + stream = source.getByteStream() + p.loadStream(stream) + + for prefix, namespace in p._bindings.items(): + graph.bind(prefix, namespace) + + +class N3Parser(TurtleParser): + """An RDFLib parser for Notation3 + + See http://www.w3.org/DesignIssues/Notation3.html + """ + + def __init__(self): + pass + + # type error: Signature of "parse" incompatible with supertype "TurtleParser" + def parse( # type: ignore[override] + self, source: InputSource, graph: Graph, encoding: Optional[str] = "utf-8" + ) -> None: + # we're currently being handed a Graph, not a ConjunctiveGraph + # context-aware is this implied by formula_aware + ca = getattr(graph.store, "context_aware", False) + fa = getattr(graph.store, "formula_aware", False) + if not ca: + raise ParserError("Cannot parse N3 into non-context-aware store.") + elif not fa: + raise ParserError("Cannot parse N3 into non-formula-aware store.") + + conj_graph = Dataset(store=graph.store) + conj_graph.default_context = graph # TODO: CG __init__ should have a + # default_context arg + # TODO: update N3Processor so that it can use conj_graph as the sink + conj_graph.namespace_manager = graph.namespace_manager + + TurtleParser.parse(self, source, conj_graph, encoding, turtle=False) diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/nquads.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/nquads.py new file mode 100644 index 0000000000000000000000000000000000000000..75dfd366c09309cde8709c08d57e5a9355a7cdfc --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/nquads.py @@ -0,0 +1,142 @@ +""" +This is a rdflib plugin for parsing NQuad files into Conjunctive +graphs that can be used and queried. The store that backs the graph +*must* be able to handle contexts. + +```python +>>> from rdflib import ConjunctiveGraph, URIRef, Namespace +>>> g = ConjunctiveGraph() +>>> data = open("test/data/nquads.rdflib/example.nquads", "rb") +>>> g.parse(data, format="nquads") # doctest:+ELLIPSIS +)> +>>> assert len(g.store) == 449 +>>> # There should be 16 separate contexts +>>> assert len([x for x in g.store.contexts()]) == 16 +>>> # is the name of entity E10009 "Arco Publications"? +>>> # (in graph http://bibliographica.org/entity/E10009) +>>> # Looking for: +>>> # +>>> # +>>> # "Arco Publications" +>>> # +>>> s = URIRef("http://bibliographica.org/entity/E10009") +>>> FOAF = Namespace("http://xmlns.com/foaf/0.1/") +>>> assert(g.value(s, FOAF.name).eq("Arco Publications")) + +``` +""" + +from __future__ import annotations + +from codecs import getreader +from typing import Any, MutableMapping, Optional + +from rdflib.exceptions import ParserError as ParseError +from rdflib.graph import ConjunctiveGraph, Dataset, Graph +from rdflib.parser import InputSource + +# Build up from the NTriples parser: +from rdflib.plugins.parsers.ntriples import W3CNTriplesParser, r_tail, r_wspace +from rdflib.term import BNode + +__all__ = ["NQuadsParser"] + +_BNodeContextType = MutableMapping[str, BNode] + + +class NQuadsParser(W3CNTriplesParser): + + # type error: Signature of "parse" incompatible with supertype "W3CNTriplesParser" + def parse( # type: ignore[override] + self, + inputsource: InputSource, + sink: Graph, + bnode_context: Optional[_BNodeContextType] = None, + skolemize: bool = False, + **kwargs: Any, + ): + """Parse inputsource as an N-Quads file. + + Args: + inputsource: The source of N-Quads-formatted data. + sink: The graph where parsed quads will be stored. + bnode_context: Optional dictionary mapping blank node identifiers to + [`BNode`][rdflib.term.BNode] instances. + See `.W3CNTriplesParser.parse` for more details. + skolemize: Whether to skolemize blank nodes. + + Returns: + The Dataset containing the parsed quads. + + Raises: + AssertionError: If the sink store is not context-aware. + ParseError: If the input is not a file-like object or contains invalid lines. + """ + assert ( + sink.store.context_aware + ), "NQuadsParser must be given a context-aware store." + # Set default_union to True to mimic ConjunctiveGraph behavior + ds = Dataset(store=sink.store, default_union=True) + ds_default = ds.default_context # the DEFAULT_DATASET_GRAPH_ID + new_default_context = None + if isinstance(sink, (Dataset, ConjunctiveGraph)): + new_default_context = sink.default_context + elif sink.identifier is not None: + if sink.identifier == ds_default.identifier: + new_default_context = sink + else: + new_default_context = ds.get_context(sink.identifier) + + if new_default_context is not None: + ds.default_context = new_default_context + ds.remove_graph(ds_default) # remove the original unused default graph + # type error: Incompatible types in assignment (expression has type "ConjunctiveGraph", base class "W3CNTriplesParser" defined the type as "Union[DummySink, NTGraphSink]") + self.sink: Dataset = ds # type: ignore[assignment] + self.skolemize = skolemize + + source = inputsource.getCharacterStream() + if not source: + source = inputsource.getByteStream() + source = getreader("utf-8")(source) + + if not hasattr(source, "read"): + raise ParseError("Item to parse must be a file-like object.") + + self.file = source + self.buffer = "" + while True: + self.line = __line = self.readline() + if self.line is None: + break + try: + self.parseline(bnode_context) + except ParseError as msg: + raise ParseError("Invalid line (%s):\n%r" % (msg, __line)) + + return self.sink + + def parseline(self, bnode_context: Optional[_BNodeContextType] = None) -> None: + self.eat(r_wspace) + if (not self.line) or self.line.startswith("#"): + return # The line is empty or a comment + + subject = self.subject(bnode_context) + self.eat(r_wspace) + + predicate = self.predicate() + self.eat(r_wspace) + + obj = self.object(bnode_context) + self.eat(r_wspace) + + context = self.uriref() or self.nodeid(bnode_context) + self.eat(r_tail) + + if self.line: + raise ParseError("Trailing garbage") + # Must have a context aware store - add on a normal Graph + # discards anything where the ctx != graph.identifier + if context: + self.sink.get_context(context).add((subject, predicate, obj)) + else: + self.sink.default_context.add((subject, predicate, obj)) diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/ntriples.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/ntriples.py new file mode 100644 index 0000000000000000000000000000000000000000..b330256492944a45fac7a50bfa6a8f69eec6ad1f --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/ntriples.py @@ -0,0 +1,389 @@ +""" +N-Triples Parser +License: GPL 2, W3C, BSD, or MIT +Author: Sean B. Palmer, inamidst.com +""" + +from __future__ import annotations + +import codecs +import re +from io import BytesIO, StringIO, TextIOBase +from typing import ( + IO, + TYPE_CHECKING, + Any, + Match, + MutableMapping, + Optional, + Pattern, + TextIO, + Union, +) + +from rdflib.compat import _string_escape_map, decodeUnicodeEscape +from rdflib.exceptions import ParserError as ParseError +from rdflib.parser import InputSource, Parser +from rdflib.term import BNode as bNode +from rdflib.term import Literal, URIRef +from rdflib.term import URIRef as URI # noqa: N814 + +if TYPE_CHECKING: + import typing_extensions as te + + from rdflib.graph import Graph, _ObjectType, _PredicateType, _SubjectType + +__all__ = [ + "unquote", + "uriquote", + "W3CNTriplesParser", + "NTGraphSink", + "NTParser", + "DummySink", +] + +uriref = r'<([^:]+:[^\s"<>]*)>' +literal = r'"([^"\\]*(?:\\.[^"\\]*)*)"' +litinfo = r"(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)|\^\^" + uriref + r")?" + +r_line = re.compile(r"([^\r\n]*)(?:\r\n|\r|\n)") +r_wspace = re.compile(r"[ \t]*") +r_wspaces = re.compile(r"[ \t]+") +r_tail = re.compile(r"[ \t]*\.[ \t]*(#.*)?") +r_uriref = re.compile(uriref) +r_nodeid = re.compile(r"_:([A-Za-z0-9_:]([-A-Za-z0-9_:\.]*[-A-Za-z0-9_:])?)") +r_literal = re.compile(literal + litinfo) + +bufsiz = 2048 +validate = False + + +class DummySink: + def __init__(self): + self.length = 0 + + def triple(self, s, p, o): + self.length += 1 + print(s, p, o) + + +r_safe = re.compile(r"([\x20\x21\x23-\x5B\x5D-\x7E]+)") +r_quot = re.compile(r"""\\([tbnrf"'\\])""") +r_uniquot = re.compile(r"\\u([0-9A-Fa-f]{4})|\\U([0-9A-Fa-f]{8})") + + +def unquote(s: str) -> str: + """Unquote an N-Triples string.""" + if not validate: + if isinstance(s, str): # nquads + s = decodeUnicodeEscape(s) + else: + s = s.decode("unicode-escape") # type: ignore[unreachable] + + return s + else: + result = [] + while s: + m = r_safe.match(s) + if m: + s = s[m.end() :] + result.append(m.group(1)) + continue + + m = r_quot.match(s) + if m: + s = s[2:] + result.append(_string_escape_map[m.group(1)]) + continue + + m = r_uniquot.match(s) + if m: + s = s[m.end() :] + u, U = m.groups() # noqa: N806 + codepoint = int(u or U, 16) + if codepoint > 0x10FFFF: + raise ParseError("Disallowed codepoint: %08X" % codepoint) + result.append(chr(codepoint)) + elif s.startswith("\\"): + raise ParseError("Illegal escape at: %s..." % s[:10]) + else: + raise ParseError("Illegal literal character: %r" % s[0]) + return "".join(result) + + +r_hibyte = re.compile(r"([\x80-\xFF])") + + +def uriquote(uri: str) -> str: + if not validate: + return uri + else: + return r_hibyte.sub(lambda m: "%%%02X" % ord(m.group(1)), uri) + + +_BNodeContextType = MutableMapping[str, bNode] + + +class W3CNTriplesParser: + """An N-Triples Parser. + + This is a legacy-style Triples parser for NTriples provided by W3C + + Example: + ```python + p = W3CNTriplesParser(sink=MySink()) + sink = p.parse(f) # file; use parsestring for a string + ``` + + To define a context in which blank node identifiers refer to the same blank node + across instances of NTriplesParser, pass the same dict as `bnode_context` to each + instance. By default, a new blank node context is created for each instance of + `W3CNTriplesParser`. + """ + + __slots__ = ("_bnode_ids", "sink", "buffer", "file", "line", "skolemize") + + def __init__( + self, + sink: Optional[Union[DummySink, NTGraphSink]] = None, + bnode_context: Optional[_BNodeContextType] = None, + ): + self.skolemize = False + + if bnode_context is not None: + self._bnode_ids = bnode_context + else: + self._bnode_ids = {} + + self.sink: Union[DummySink, NTGraphSink] + if sink is not None: + self.sink = sink + else: + self.sink = DummySink() + + self.buffer: Optional[str] = None + self.file: Optional[Union[TextIO, codecs.StreamReader]] = None + self.line: Optional[str] = "" + + def parse( + self, + f: Union[TextIO, IO[bytes], codecs.StreamReader], + bnode_context: Optional[_BNodeContextType] = None, + skolemize: bool = False, + ) -> Union[DummySink, NTGraphSink]: + """Parse f as an N-Triples file. + + Args: + f: The N-Triples source + bnode_context: A dict mapping blank node identifiers (e.g., `a` in `_:a`) + to [`BNode`][rdflib.term.BNode] instances. An empty dict can be + passed in to define a distinct context for a given call to + `parse`. + skolemize: Whether to skolemize blank nodes + + Returns: + The sink containing the parsed triples + """ + + if not hasattr(f, "read"): + raise ParseError("Item to parse must be a file-like object.") + + if not hasattr(f, "encoding") and not hasattr(f, "charbuffer"): + # someone still using a bytestream here? + f = codecs.getreader("utf-8")(f) + + self.skolemize = skolemize + self.file = f # type: ignore[assignment] + self.buffer = "" + while True: + self.line = self.readline() + if self.line is None: + break + try: + self.parseline(bnode_context=bnode_context) + except ParseError: + raise ParseError("Invalid line: {}".format(self.line)) + return self.sink + + def parsestring(self, s: Union[bytes, bytearray, str], **kwargs) -> None: + """Parse s as an N-Triples string.""" + if not isinstance(s, (str, bytes, bytearray)): + raise ParseError("Item to parse must be a string instance.") + f: Union[codecs.StreamReader, StringIO] + if isinstance(s, (bytes, bytearray)): + f = codecs.getreader("utf-8")(BytesIO(s)) + else: + f = StringIO(s) + self.parse(f, **kwargs) + + def readline(self) -> Optional[str]: + """Read an N-Triples line from buffered input.""" + # N-Triples lines end in either CRLF, CR, or LF + # Therefore, we can't just use f.readline() + if not self.buffer: + # type error: Item "None" of "Union[TextIO, StreamReader, None]" has no attribute "read" + buffer = self.file.read(bufsiz) # type: ignore[union-attr] + if not buffer: + return None + self.buffer = buffer + + while True: + m = r_line.match(self.buffer) + if m: # the more likely prospect + self.buffer = self.buffer[m.end() :] + return m.group(1) + else: + # type error: Item "None" of "Union[TextIO, StreamReader, None]" has no attribute "read" + buffer = self.file.read(bufsiz) # type: ignore[union-attr] + if not buffer and not self.buffer.isspace(): + # Last line does not need to be terminated with a newline + buffer += "\n" + elif not buffer: + return None + self.buffer += buffer + + def parseline(self, bnode_context: Optional[_BNodeContextType] = None) -> None: + self.eat(r_wspace) + if (not self.line) or self.line.startswith("#"): + return # The line is empty or a comment + + subject = self.subject(bnode_context) + self.eat(r_wspaces) + + predicate = self.predicate() + self.eat(r_wspaces) + + object_ = self.object(bnode_context) + self.eat(r_tail) + + if self.line: + raise ParseError("Trailing garbage: {}".format(self.line)) + self.sink.triple(subject, predicate, object_) + + def peek(self, token: str) -> bool: + return self.line.startswith(token) # type: ignore[union-attr] + + def eat(self, pattern: Pattern[str]) -> Match[str]: + m = pattern.match(self.line) # type: ignore[arg-type] + if not m: # @@ Why can't we get the original pattern? + # print(dir(pattern)) + # print repr(self.line), type(self.line) + raise ParseError("Failed to eat %s at %s" % (pattern.pattern, self.line)) + self.line = self.line[m.end() :] # type: ignore[index] + return m + + def subject(self, bnode_context=None) -> Union[bNode, URIRef]: + # @@ Consider using dictionary cases + subj = self.uriref() or self.nodeid(bnode_context) + if not subj: + raise ParseError("Subject must be uriref or nodeID") + return subj + + def predicate(self) -> Union[bNode, URIRef]: + pred = self.uriref() + if not pred: + raise ParseError("Predicate must be uriref") + return pred + + def object( + self, bnode_context: Optional[_BNodeContextType] = None + ) -> Union[URI, bNode, Literal]: + objt = self.uriref() or self.nodeid(bnode_context) or self.literal() + if objt is False: + raise ParseError("Unrecognised object type") + return objt + + def uriref(self) -> Union[te.Literal[False], URI]: + if self.peek("<"): + uri = self.eat(r_uriref).group(1) + uri = unquote(uri) + uri = uriquote(uri) + return URI(uri) + return False + + def nodeid( + self, bnode_context: Optional[_BNodeContextType] = None + ) -> Union[te.Literal[False], bNode, URI]: + if self.peek("_"): + if self.skolemize: + bnode_id = self.eat(r_nodeid).group(1) + return bNode(bnode_id).skolemize() + + else: + # Fix for https://github.com/RDFLib/rdflib/issues/204 + if bnode_context is None: + bnode_context = self._bnode_ids + bnode_id = self.eat(r_nodeid).group(1) + new_id = bnode_context.get(bnode_id, None) + if new_id is not None: + # Re-map to id specific to this doc + return bNode(new_id) + else: + # Replace with freshly-generated document-specific BNode id + bnode = bNode() + # Store the mapping + bnode_context[bnode_id] = bnode + return bnode + return False + + def literal(self) -> Union[te.Literal[False], Literal]: + if self.peek('"'): + lit, lang, dtype = self.eat(r_literal).groups() + if lang: + lang = lang + else: + lang = None + if dtype: + dtype = unquote(dtype) + dtype = uriquote(dtype) + dtype = URI(dtype) + else: + dtype = None + if lang and dtype: + raise ParseError("Can't have both a language and a datatype") + lit = unquote(lit) + return Literal(lit, lang, dtype) + return False + + +class NTGraphSink: + __slots__ = ("g",) + + def __init__(self, graph: Graph): + self.g = graph + + def triple(self, s: _SubjectType, p: _PredicateType, o: _ObjectType) -> None: + self.g.add((s, p, o)) + + +class NTParser(Parser): + """Parser for the N-Triples format, often stored with the .nt extension. + + See http://www.w3.org/TR/rdf-testcases/#ntriples + """ + + __slots__ = () + + @classmethod + def parse(cls, source: InputSource, sink: Graph, **kwargs: Any) -> None: + """Parse the NT format. + + Args: + source: The source of NT-formatted data + sink: Where to send parsed triples + **kwargs: Additional arguments to pass to `W3CNTriplesParser.parse` + """ + f: Union[TextIO, IO[bytes], codecs.StreamReader] + f = source.getCharacterStream() + if not f: + b = source.getByteStream() + # TextIOBase includes: StringIO and TextIOWrapper + if isinstance(b, TextIOBase): + # f is not really a ByteStream, but a CharacterStream + f = b # type: ignore[assignment] + else: + # since N-Triples 1.1 files can and should be utf-8 encoded + f = codecs.getreader("utf-8")(b) + parser = W3CNTriplesParser(NTGraphSink(sink)) + parser.parse(f, **kwargs) + f.close() diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/patch.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/patch.py new file mode 100644 index 0000000000000000000000000000000000000000..4489c733d16652c849c987d89d84364bbe0d32eb --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/patch.py @@ -0,0 +1,179 @@ +from __future__ import annotations + +from codecs import getreader +from enum import Enum +from typing import TYPE_CHECKING, Any, MutableMapping, Optional, Union + +from rdflib.exceptions import ParserError as ParseError +from rdflib.graph import Dataset +from rdflib.parser import InputSource +from rdflib.plugins.parsers.nquads import NQuadsParser + +# Build up from the NTriples parser: +from rdflib.plugins.parsers.ntriples import r_nodeid, r_tail, r_uriref, r_wspace +from rdflib.term import BNode, URIRef + +if TYPE_CHECKING: + import typing_extensions as te + +__all__ = ["RDFPatchParser", "Operation"] + +_BNodeContextType = MutableMapping[str, BNode] + + +class Operation(Enum): + """Enum of RDF Patch operations. + + Operations: + - `AddTripleOrQuad` (A): Adds a triple or quad. + - `DeleteTripleOrQuad` (D): Deletes a triple or quad. + - `AddPrefix` (PA): Adds a prefix. + - `DeletePrefix` (PD): Deletes a prefix. + - `TransactionStart` (TX): Starts a transaction. + - `TransactionCommit` (TC): Commits a transaction. + - `TransactionAbort` (TA): Aborts a transaction. + - `Header` (H): Specifies a header. + """ + + AddTripleOrQuad = "A" + DeleteTripleOrQuad = "D" + AddPrefix = "PA" + DeletePrefix = "PD" + TransactionStart = "TX" + TransactionCommit = "TC" + TransactionAbort = "TA" + Header = "H" + + +class RDFPatchParser(NQuadsParser): + def parse( # type: ignore[override] + self, + inputsource: InputSource, + sink: Dataset, + bnode_context: Optional[_BNodeContextType] = None, + skolemize: bool = False, + **kwargs: Any, + ) -> Dataset: + """Parse inputsource as an RDF Patch file. + + Args: + inputsource: the source of RDF Patch formatted data + sink: where to send parsed data + bnode_context: a dict mapping blank node identifiers to [`BNode`][rdflib.term.BNode] + instances. See `.W3CNTriplesParser.parse` + """ + assert sink.store.context_aware, ( + "RDFPatchParser must be given" " a context aware store." + ) + # type error: Incompatible types in assignment (expression has type "ConjunctiveGraph", base class "W3CNTriplesParser" defined the type as "Union[DummySink, NTGraphSink]") + self.sink: Dataset = Dataset(store=sink.store) + self.skolemize = skolemize + + source = inputsource.getCharacterStream() + if not source: + source = inputsource.getByteStream() + source = getreader("utf-8")(source) + + if not hasattr(source, "read"): + raise ParseError("Item to parse must be a file-like object.") + + self.file = source + self.buffer = "" + while True: + self.line = __line = self.readline() + if self.line is None: + break + try: + self.parsepatch(bnode_context) + except ParseError as msg: + raise ParseError("Invalid line (%s):\n%r" % (msg, __line)) + return self.sink + + def parsepatch(self, bnode_context: Optional[_BNodeContextType] = None) -> None: + self.eat(r_wspace) + # From spec: "No comments should be included (comments start # and run to end + # of line)." + if (not self.line) or self.line.startswith("#"): + return # The line is empty or a comment + + # if header, transaction, skip + operation = self.operation() + self.eat(r_wspace) + + if operation in [Operation.AddTripleOrQuad, Operation.DeleteTripleOrQuad]: + self.add_or_remove_triple_or_quad(operation, bnode_context) + elif operation == Operation.AddPrefix: + self.add_prefix() + elif operation == Operation.DeletePrefix: + self.delete_prefix() + + def add_or_remove_triple_or_quad( + self, operation, bnode_context: Optional[_BNodeContextType] = None + ) -> None: + self.eat(r_wspace) + if (not self.line) or self.line.startswith("#"): + return # The line is empty or a comment + + subject = self.labeled_bnode() or self.subject(bnode_context) + self.eat(r_wspace) + + predicate = self.predicate() + self.eat(r_wspace) + + obj = self.labeled_bnode() or self.object(bnode_context) + self.eat(r_wspace) + + context = self.labeled_bnode() or self.uriref() or self.nodeid(bnode_context) + self.eat(r_tail) + + if self.line: + raise ParseError("Trailing garbage") + # Must have a context aware store - add on a normal Graph + # discards anything where the ctx != graph.identifier + if operation == Operation.AddTripleOrQuad: + if context: + self.sink.get_context(context).add((subject, predicate, obj)) + else: + self.sink.default_context.add((subject, predicate, obj)) + elif operation == Operation.DeleteTripleOrQuad: + if context: + self.sink.get_context(context).remove((subject, predicate, obj)) + else: + self.sink.default_context.remove((subject, predicate, obj)) + + def add_prefix(self): + # Extract prefix and URI from the line + prefix, ns, _ = self.line.replace('"', "").replace("'", "").split(" ") # type: ignore[union-attr] + ns_stripped = ns.strip("<>") + self.sink.bind(prefix, ns_stripped) + + def delete_prefix(self): + prefix, _, _ = self.line.replace('"', "").replace("'", "").split(" ") # type: ignore[union-attr] + self.sink.namespace_manager.bind(prefix, None, replace=True) + + def operation(self) -> Operation: + for op in Operation: + if self.line.startswith(op.value): # type: ignore[union-attr] + self.eat_op(op.value) + return op + raise ValueError( + f'Invalid or no Operation found in line: "{self.line}". Valid Operations ' + f"codes are {', '.join([op.value for op in Operation])}" + ) + + def eat_op(self, op: str) -> None: + self.line = self.line.lstrip(op) # type: ignore[union-attr] + + def nodeid( + self, bnode_context: Optional[_BNodeContextType] = None + ) -> Union[te.Literal[False], BNode, URIRef]: + if self.peek("_"): + return BNode(self.eat(r_nodeid).group(1)) + return False + + def labeled_bnode(self): + if self.peek("<_"): + plain_uri = self.eat(r_uriref).group(1) + bnode_id = r_nodeid.match(plain_uri).group(1) # type: ignore[union-attr] + return BNode(bnode_id) + return False diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/rdfxml.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/rdfxml.py new file mode 100644 index 0000000000000000000000000000000000000000..9ec39d04e319ba660eec45c9712d677f8f545c31 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/rdfxml.py @@ -0,0 +1,656 @@ +""" +An RDF/XML parser for RDFLib +""" + +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Dict, List, NoReturn, Optional, Tuple +from urllib.parse import urldefrag, urljoin +from xml.sax import handler, make_parser, xmlreader +from xml.sax.handler import ErrorHandler +from xml.sax.saxutils import escape, quoteattr + +from rdflib.exceptions import Error, ParserError +from rdflib.graph import Graph +from rdflib.namespace import RDF, is_ncname +from rdflib.parser import InputSource, Parser +from rdflib.plugins.parsers.RDFVOC import RDFVOC +from rdflib.term import BNode, Identifier, Literal, URIRef + +if TYPE_CHECKING: + # from xml.sax.expatreader import ExpatLocator + from xml.sax.xmlreader import AttributesImpl, Locator + + from rdflib.graph import _ObjectType, _SubjectType, _TripleType + +__all__ = ["create_parser", "BagID", "ElementHandler", "RDFXMLHandler", "RDFXMLParser"] + +RDFNS = RDFVOC + +# http://www.w3.org/TR/rdf-syntax-grammar/#eventterm-attribute-URI +# A mapping from unqualified terms to their qualified version. +UNQUALIFIED = { + "about": RDFVOC.about, + "ID": RDFVOC.ID, + "type": RDFVOC.type, + "resource": RDFVOC.resource, + "parseType": RDFVOC.parseType, +} + +# http://www.w3.org/TR/rdf-syntax-grammar/#coreSyntaxTerms +CORE_SYNTAX_TERMS = [ + RDFVOC.RDF, + RDFVOC.ID, + RDFVOC.about, + RDFVOC.parseType, + RDFVOC.resource, + RDFVOC.nodeID, + RDFVOC.datatype, +] + +# http://www.w3.org/TR/rdf-syntax-grammar/#syntaxTerms +SYNTAX_TERMS = CORE_SYNTAX_TERMS + [RDFVOC.Description, RDFVOC.li] + +# http://www.w3.org/TR/rdf-syntax-grammar/#oldTerms +OLD_TERMS = [ + URIRef("http://www.w3.org/1999/02/22-rdf-syntax-ns#aboutEach"), + URIRef("http://www.w3.org/1999/02/22-rdf-syntax-ns#aboutEachPrefix"), + URIRef("http://www.w3.org/1999/02/22-rdf-syntax-ns#bagID"), +] + +NODE_ELEMENT_EXCEPTIONS = ( + CORE_SYNTAX_TERMS + + [ + RDFVOC.li, + ] + + OLD_TERMS +) +NODE_ELEMENT_ATTRIBUTES = [RDFVOC.ID, RDFVOC.nodeID, RDFVOC.about] + +PROPERTY_ELEMENT_EXCEPTIONS = ( + CORE_SYNTAX_TERMS + + [ + RDFVOC.Description, + ] + + OLD_TERMS +) +PROPERTY_ATTRIBUTE_EXCEPTIONS = ( + CORE_SYNTAX_TERMS + [RDFVOC.Description, RDFVOC.li] + OLD_TERMS +) +PROPERTY_ELEMENT_ATTRIBUTES = [RDFVOC.ID, RDFVOC.resource, RDFVOC.nodeID] + +XMLNS = "http://www.w3.org/XML/1998/namespace" +BASE = (XMLNS, "base") +LANG = (XMLNS, "lang") + + +class BagID(URIRef): + __slots__ = ["li"] + + def __init__(self, val): + # type error: Too many arguments for "__init__" of "object" + super(URIRef, self).__init__(val) # type: ignore[call-arg] + self.li = 0 + + def next_li(self): + self.li += 1 + # type error: Type expected within [...] + return RDFNS["_%s" % self.li] # type: ignore[misc] + + +class ElementHandler: + __slots__ = [ + "start", + "char", + "end", + "li", + "id", + "base", + "subject", + "predicate", + "object", + "list", + "language", + "datatype", + "declared", + "data", + ] + + def __init__(self): + self.start = None + self.char = None + self.end = None + self.li = 0 + self.id = None + self.base = None + self.subject = None + self.object = None + self.list = None + self.language = None + self.datatype = None + self.declared = None + self.data = None + + def next_li(self): + self.li += 1 + return RDFVOC["_%s" % self.li] + + +class RDFXMLHandler(handler.ContentHandler): + def __init__(self, store: Graph): + self.store = store + self.preserve_bnode_ids = False + self.reset() + + def reset(self) -> None: + document_element = ElementHandler() + document_element.start = self.document_element_start + document_element.end = lambda name, qname: None + self.stack: List[Optional[ElementHandler]] = [ + None, + document_element, + ] + self.ids: Dict[str, int] = {} # remember IDs we have already seen + self.bnode: Dict[str, Identifier] = {} + self._ns_contexts: List[Dict[str, Optional[str]]] = [ + {} + ] # contains uri -> prefix dicts + self._current_context: Dict[str, Optional[str]] = self._ns_contexts[-1] + + # ContentHandler methods + + def setDocumentLocator(self, locator: Locator): + self.locator = locator + + def startDocument(self) -> None: + pass + + def startPrefixMapping(self, prefix: Optional[str], namespace: str) -> None: + self._ns_contexts.append(self._current_context.copy()) + self._current_context[namespace] = prefix + self.store.bind(prefix, namespace or "", override=False) + + def endPrefixMapping(self, prefix: Optional[str]) -> None: + self._current_context = self._ns_contexts[-1] + del self._ns_contexts[-1] + + def startElementNS( + self, name: Tuple[Optional[str], str], qname, attrs: AttributesImpl + ) -> None: + stack = self.stack + stack.append(ElementHandler()) + current = self.current + parent = self.parent + # type error: No overlaod for "get" of "AttributesImpl" mactches tuple (str, str) + base = attrs.get(BASE, None) # type: ignore[call-overload, unused-ignore] + if base is not None: + base, frag = urldefrag(base) + if parent and parent.base: + base = urljoin(parent.base, base) + else: + systemId = self.locator.getPublicId() or self.locator.getSystemId() + if systemId: + base = urljoin(systemId, base) + else: + if parent: + base = parent.base + if base is None: + systemId = self.locator.getPublicId() or self.locator.getSystemId() + if systemId: + base, frag = urldefrag(systemId) + current.base = base + # type error: No overlaod for "get" of "AttributesImpl" mactches tuple (str, str) + language = attrs.get(LANG, None) # type: ignore[call-overload, unused-ignore] + if language is None: + if parent: + language = parent.language + current.language = language + current.start(name, qname, attrs) + + def endElementNS(self, name: Tuple[Optional[str], str], qname) -> None: + self.current.end(name, qname) + self.stack.pop() + + def characters(self, content: str) -> None: + char = self.current.char + if char: + char(content) + + def ignorableWhitespace(self, content) -> None: + pass + + def processingInstruction(self, target, data) -> None: + pass + + def add_reified(self, sid: Identifier, spo: _TripleType): + s, p, o = spo + self.store.add((sid, RDF.type, RDF.Statement)) + self.store.add((sid, RDF.subject, s)) + self.store.add((sid, RDF.predicate, p)) + self.store.add((sid, RDF.object, o)) + + def error(self, message: str) -> NoReturn: + locator = self.locator + info = "%s:%s:%s: " % ( + locator.getSystemId(), + locator.getLineNumber(), + locator.getColumnNumber(), + ) + raise ParserError(info + message) + + def get_current(self) -> Optional[ElementHandler]: + return self.stack[-2] + + # Create a read only property called current so that self.current + # give the current element handler. + current = property(get_current) + + def get_next(self) -> Optional[ElementHandler]: + return self.stack[-1] + + # Create a read only property that gives the element handler to be + # used for the next element. + next = property(get_next) + + def get_parent(self) -> Optional[ElementHandler]: + return self.stack[-3] + + # Create a read only property that gives the current parent + # element handler + parent = property(get_parent) + + def absolutize(self, uri: str) -> URIRef: + # type error: Argument "allow_fragments" to "urljoin" has incompatible type "int"; expected "bool" + result = urljoin(self.current.base, uri, allow_fragments=1) # type: ignore[arg-type] + if uri and uri[-1] == "#" and result[-1] != "#": + result = "%s#" % result + return URIRef(result) + + def convert( + self, name: Tuple[Optional[str], str], qname, attrs: AttributesImpl + ) -> Tuple[URIRef, Dict[URIRef, str]]: + if name[0] is None: + # type error: Incompatible types in assignment (expression has type "URIRef", variable has type "Tuple[Optional[str], str]") + name = URIRef(name[1]) # type: ignore[assignment] + else: + # type error: Incompatible types in assignment (expression has type "URIRef", variable has type "Tuple[Optional[str], str]") + # type error: Argument 1 to "join" of "str" has incompatible type "Tuple[Optional[str], str]"; expected "Iterable[str]" + name = URIRef("".join(name)) # type: ignore[assignment, arg-type] + atts = {} + for n, v in attrs.items(): + # mypy error: mypy thinks n[0]==None is unreachable + if n[0] is None: + att = n[1] # type: ignore[unreachable, unused-ignore] + else: + att = "".join(n) + if att.startswith(XMLNS) or att[0:3].lower() == "xml": + pass + elif att in UNQUALIFIED: + # if not RDFNS[att] in atts: + # type error: Variable "att" is not valid as a type + atts[RDFNS[att]] = v # type: ignore[misc, valid-type] + else: + atts[URIRef(att)] = v + # type error: Incompatible return value type (got "Tuple[Tuple[Optional[str], str], Dict[Any, Any]]", expected "Tuple[URIRef, Dict[URIRef, str]]") + return name, atts # type: ignore[return-value] + + def document_element_start( + self, name: Tuple[str, str], qname, attrs: AttributesImpl + ) -> None: + if name[0] and URIRef("".join(name)) == RDFVOC.RDF: + # Cheap hack so 2to3 doesn't turn it into __next__ + next = getattr(self, "next") + next.start = self.node_element_start + next.end = self.node_element_end + else: + self.node_element_start(name, qname, attrs) + # self.current.end = self.node_element_end + # TODO... set end to something that sets start such that + # another element will cause error + + def node_element_start( + self, name: Tuple[str, str], qname, attrs: AttributesImpl + ) -> None: + # type error: Incompatible types in assignment (expression has type "URIRef", variable has type "Tuple[str, str]") + name, atts = self.convert(name, qname, attrs) # type: ignore[assignment] + current = self.current + absolutize = self.absolutize + + # Cheap hack so 2to3 doesn't turn it into __next__ + next = getattr(self, "next") + next.start = self.property_element_start + next.end = self.property_element_end + + if name in NODE_ELEMENT_EXCEPTIONS: + # type error: Not all arguments converted during string formatting + self.error("Invalid node element URI: %s" % name) # type: ignore[str-format] + subject: _SubjectType + if RDFVOC.ID in atts: + if RDFVOC.about in atts or RDFVOC.nodeID in atts: + self.error("Can have at most one of rdf:ID, rdf:about, and rdf:nodeID") + + id = atts[RDFVOC.ID] + if not is_ncname(id): + self.error("rdf:ID value is not a valid NCName: %s" % id) + subject = absolutize("#%s" % id) + if subject in self.ids: + self.error("two elements cannot use the same ID: '%s'" % subject) + self.ids[subject] = 1 # IDs can only appear once within a document + elif RDFVOC.nodeID in atts: + if RDFVOC.ID in atts or RDFVOC.about in atts: + self.error("Can have at most one of rdf:ID, rdf:about, and rdf:nodeID") + nodeID = atts[RDFVOC.nodeID] + if not is_ncname(nodeID): + self.error("rdf:nodeID value is not a valid NCName: %s" % nodeID) + if self.preserve_bnode_ids is False: + if nodeID in self.bnode: + subject = self.bnode[nodeID] + else: + subject = BNode() + self.bnode[nodeID] = subject + else: + subject = BNode(nodeID) + elif RDFVOC.about in atts: + if RDFVOC.ID in atts or RDFVOC.nodeID in atts: + self.error("Can have at most one of rdf:ID, rdf:about, and rdf:nodeID") + subject = absolutize(atts[RDFVOC.about]) + else: + subject = BNode() + + if name != RDFVOC.Description: # S1 + # error: Argument 1 has incompatible type "Tuple[str, str]"; expected "str" + self.store.add((subject, RDF.type, absolutize(name))) # type: ignore[arg-type] + + object: _ObjectType + language = current.language + for att in atts: + if not att.startswith(str(RDFNS)): + predicate = absolutize(att) + try: + object = Literal(atts[att], language) + except Error as e: + # type error: Argument 1 to "error" of "RDFXMLHandler" has incompatible type "Optional[str]"; expected "str" + self.error(e.msg) # type: ignore[arg-type] + elif att == RDF.type: # S2 + predicate = RDF.type + object = absolutize(atts[RDF.type]) + elif att in NODE_ELEMENT_ATTRIBUTES: + continue + elif att in PROPERTY_ATTRIBUTE_EXCEPTIONS: # S3 + self.error("Invalid property attribute URI: %s" % att) + # type error: Statement is unreachable + continue # type: ignore[unreachable] # for when error does not throw an exception + else: + predicate = absolutize(att) + try: + object = Literal(atts[att], language) + except Error as e: + # type error: Argument 1 to "error" of "RDFXMLHandler" has incompatible type "Optional[str]"; expected "str" + self.error(e.msg) # type: ignore[arg-type] + self.store.add((subject, predicate, object)) + + current.subject = subject + + def node_element_end(self, name: Tuple[str, str], qname) -> None: + # repeat node-elements are only allowed + # at at top-level + + if self.parent.object and self.current != self.stack[2]: + self.error( + "Repeat node-elements inside property elements: %s" % "".join(name) + ) + + self.parent.object = self.current.subject + + def property_element_start( + self, name: Tuple[str, str], qname, attrs: AttributesImpl + ) -> None: + # type error: Incompatible types in assignment (expression has type "URIRef", variable has type "Tuple[str, str]") + name, atts = self.convert(name, qname, attrs) # type: ignore[assignment] + current = self.current + absolutize = self.absolutize + + # Cheap hack so 2to3 doesn't turn it into __next__ + next = getattr(self, "next") + object: Optional[_ObjectType] = None + current.data = None + current.list = None + + # type error: "Tuple[str, str]" has no attribute "startswith" + if not name.startswith(str(RDFNS)): # type: ignore[attr-defined] + # type error: Argument 1 has incompatible type "Tuple[str, str]"; expected "str" + current.predicate = absolutize(name) # type: ignore[arg-type] + elif name == RDFVOC.li: + current.predicate = current.next_li() + elif name in PROPERTY_ELEMENT_EXCEPTIONS: + # type error: Not all arguments converted during string formatting + self.error("Invalid property element URI: %s" % name) # type: ignore[str-format] + else: + # type error: Argument 1 has incompatible type "Tuple[str, str]"; expected "str" + current.predicate = absolutize(name) # type: ignore[arg-type] + + id = atts.get(RDFVOC.ID, None) + if id is not None: + if not is_ncname(id): + self.error("rdf:ID value is not a value NCName: %s" % id) + current.id = absolutize("#%s" % id) + else: + current.id = None + + resource = atts.get(RDFVOC.resource, None) + nodeID = atts.get(RDFVOC.nodeID, None) + parse_type = atts.get(RDFVOC.parseType, None) + if resource is not None and nodeID is not None: + self.error("Property element cannot have both rdf:nodeID and rdf:resource") + if resource is not None: + object = absolutize(resource) + next.start = self.node_element_start + next.end = self.node_element_end + elif nodeID is not None: + if not is_ncname(nodeID): + self.error("rdf:nodeID value is not a valid NCName: %s" % nodeID) + if self.preserve_bnode_ids is False: + if nodeID in self.bnode: + object = self.bnode[nodeID] + else: + subject = BNode() + self.bnode[nodeID] = subject + object = subject + else: + object = subject = BNode(nodeID) + next.start = self.node_element_start + next.end = self.node_element_end + else: + if parse_type is not None: + for att in atts: + if att != RDFVOC.parseType and att != RDFVOC.ID: + self.error("Property attr '%s' now allowed here" % att) + if parse_type == "Resource": + current.subject = object = BNode() + current.char = self.property_element_char + next.start = self.property_element_start + next.end = self.property_element_end + elif parse_type == "Collection": + current.char = None + object = current.list = RDF.nil # BNode() + # self.parent.subject + next.start = self.node_element_start + next.end = self.list_node_element_end + else: # if parse_type=="Literal": + # All other values are treated as Literal + # See: http://www.w3.org/TR/rdf-syntax-grammar/ + # parseTypeOtherPropertyElt + object = Literal("", datatype=RDFVOC.XMLLiteral) + current.char = self.literal_element_char + current.declared = {XMLNS: "xml"} + next.start = self.literal_element_start + next.char = self.literal_element_char + next.end = self.literal_element_end + current.object = object + return + else: + object = None + current.char = self.property_element_char + next.start = self.node_element_start + next.end = self.node_element_end + + datatype = current.datatype = atts.get(RDFVOC.datatype, None) + language = current.language + if datatype is not None: + # TODO: check that there are no atts other than datatype and id + datatype = absolutize(datatype) + else: + for att in atts: + if not att.startswith(str(RDFNS)): + predicate = absolutize(att) + elif att in PROPERTY_ELEMENT_ATTRIBUTES: + continue + elif att in PROPERTY_ATTRIBUTE_EXCEPTIONS: + self.error("""Invalid property attribute URI: %s""" % att) + else: + predicate = absolutize(att) + o: _ObjectType + if att == RDF.type: + o = URIRef(atts[att]) + else: + if datatype is not None: + # type error: Statement is unreachable + language = None # type: ignore[unreachable] + o = Literal(atts[att], language, datatype) + + if object is None: + object = BNode() + self.store.add((object, predicate, o)) + if object is None: + current.data = "" + current.object = None + else: + current.data = None + current.object = object + + def property_element_char(self, data: str) -> None: + current = self.current + if current.data is not None: + current.data += data + + def property_element_end(self, name: Tuple[str, str], qname) -> None: + current = self.current + if current.data is not None and current.object is None: + literalLang = current.language + if current.datatype is not None: + literalLang = None + current.object = Literal(current.data, literalLang, current.datatype) + current.data = None + if self.next.end == self.list_node_element_end: + if current.object != RDF.nil: + self.store.add((current.list, RDF.rest, RDF.nil)) + if current.object is not None: + self.store.add((self.parent.subject, current.predicate, current.object)) + if current.id is not None: + self.add_reified( + current.id, (self.parent.subject, current.predicate, current.object) + ) + current.subject = None + + def list_node_element_end(self, name: Tuple[str, str], qname) -> None: + current = self.current + if self.parent.list == RDF.nil: + list = BNode() + # Removed between 20030123 and 20030905 + # self.store.add((list, RDF.type, LIST)) + self.parent.list = list + self.store.add((self.parent.list, RDF.first, current.subject)) + self.parent.object = list + self.parent.char = None + else: + list = BNode() + # Removed between 20030123 and 20030905 + # self.store.add((list, RDF.type, LIST)) + self.store.add((self.parent.list, RDF.rest, list)) + self.store.add((list, RDF.first, current.subject)) + self.parent.list = list + + def literal_element_start( + self, name: Tuple[str, str], qname, attrs: AttributesImpl + ) -> None: + current = self.current + self.next.start = self.literal_element_start + self.next.char = self.literal_element_char + self.next.end = self.literal_element_end + current.declared = self.parent.declared.copy() + if name[0]: + prefix = self._current_context[name[0]] + if prefix: + current.object = "<%s:%s" % (prefix, name[1]) + else: + current.object = "<%s" % name[1] + if not name[0] in current.declared: # noqa: E713 + current.declared[name[0]] = prefix + if prefix: + current.object += ' xmlns:%s="%s"' % (prefix, name[0]) + else: + current.object += ' xmlns="%s"' % name[0] + else: + current.object = "<%s" % name[1] + # type error: Incompatible types in assignment (expression has type "str", variable has type "Tuple[str, str]") + for name, value in attrs.items(): # type: ignore[assignment, unused-ignore] + if name[0]: + if not name[0] in current.declared: # noqa: E713 + current.declared[name[0]] = self._current_context[name[0]] + name = current.declared[name[0]] + ":" + name[1] + else: + # type error: Incompatible types in assignment (expression has type "str", variable has type "Tuple[str, str]") + name = name[1] # type: ignore[assignment] + current.object += " %s=%s" % (name, quoteattr(value)) + current.object += ">" + + def literal_element_char(self, data: str) -> None: + self.current.object += escape(data) + + def literal_element_end(self, name: Tuple[str, str], qname) -> None: + if name[0]: + prefix = self._current_context[name[0]] + if prefix: + end = "" % (prefix, name[1]) + else: + end = "" % name[1] + else: + end = "" % name[1] + self.parent.object += self.current.object + end + + +def create_parser(target: InputSource, store: Graph) -> xmlreader.XMLReader: + parser = make_parser() + try: + # Workaround for bug in expatreader.py. Needed when + # expatreader is trying to guess a prefix. + parser.start_namespace_decl("xml", "http://www.w3.org/XML/1998/namespace") # type: ignore[attr-defined] + except AttributeError: + pass # Not present in Jython (at least) + parser.setFeature(handler.feature_namespaces, 1) + rdfxml = RDFXMLHandler(store) + # type error: Argument 1 to "setDocumentLocator" of "RDFXMLHandler" has incompatible type "InputSource"; expected "Locator" + rdfxml.setDocumentLocator(target) # type: ignore[arg-type] + # rdfxml.setDocumentLocator(_Locator(self.url, self.parser)) + parser.setContentHandler(rdfxml) + parser.setErrorHandler(ErrorHandler()) + return parser + + +class RDFXMLParser(Parser): + """An RDF/XML parser.""" + + def __init__(self): + pass + + def parse(self, source: InputSource, sink: Graph, **args: Any) -> None: + self._parser = create_parser(source, sink) + content_handler = self._parser.getContentHandler() + preserve_bnode_ids = args.get("preserve_bnode_ids", None) + if preserve_bnode_ids is not None: + # type error: ContentHandler has no attribute "preserve_bnode_ids" + content_handler.preserve_bnode_ids = preserve_bnode_ids # type: ignore[attr-defined, unused-ignore] + # # We're only using it once now + # content_handler.reset() + # self._parser.reset() + self._parser.parse(source) diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/trig.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/trig.py new file mode 100644 index 0000000000000000000000000000000000000000..9ed6e8bbcfb090565b53622d9845d6757f3dbcd3 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/trig.py @@ -0,0 +1,177 @@ +from __future__ import annotations + +from typing import Any, MutableSequence + +from rdflib.graph import ConjunctiveGraph, Graph +from rdflib.parser import InputSource, Parser + +from .notation3 import RDFSink, SinkParser + + +def becauseSubGraph(*args, **kwargs): # noqa: N802 + pass + + +class TrigSinkParser(SinkParser): + def directiveOrStatement(self, argstr: str, h: int) -> int: # noqa: N802 + # import pdb; pdb.set_trace() + + i = self.skipSpace(argstr, h) + if i < 0: + return i # EOF + + j = self.graph(argstr, i) + if j >= 0: + return j + + j = self.sparqlDirective(argstr, i) + if j >= 0: + return j + + j = self.directive(argstr, i) + if j >= 0: + return self.checkDot(argstr, j) + + j = self.statement(argstr, i) + if j >= 0: + return self.checkDot(argstr, j) + + return j + + def labelOrSubject( # noqa: N802 + self, argstr: str, i: int, res: MutableSequence[Any] + ) -> int: + j = self.skipSpace(argstr, i) + if j < 0: + return j # eof + i = j + + j = self.uri_ref2(argstr, i, res) + if j >= 0: + return j + + if argstr[i] == "[": + j = self.skipSpace(argstr, i + 1) + if j < 0: + self.BadSyntax(argstr, i, "Expected ] got EOF") + if argstr[j] == "]": + res.append(self.blankNode()) + return j + 1 + return -1 + + def graph(self, argstr: str, i: int) -> int: + """ + Parse trig graph, i.e. + + = { .. triples .. } + + return -1 if it doesn't look like a graph-decl + raise Exception if it looks like a graph, but isn't. + """ + + need_graphid = False + # import pdb; pdb.set_trace() + j = self.sparqlTok("GRAPH", argstr, i) # optional GRAPH keyword + if j >= 0: + i = j + need_graphid = True + + r: MutableSequence[Any] = [] + j = self.labelOrSubject(argstr, i, r) + if j >= 0: + graph = r[0] + i = j + elif need_graphid: + self.BadSyntax(argstr, i, "GRAPH keyword must be followed by graph name") + else: + graph = self._store.graph.identifier # hack + + j = self.skipSpace(argstr, i) + if j < 0: + self.BadSyntax(argstr, i, "EOF found when expected graph") + + if argstr[j : j + 1] == "=": # optional = for legacy support + i = self.skipSpace(argstr, j + 1) + if i < 0: + self.BadSyntax(argstr, i, "EOF found when expecting '{'") + else: + i = j + + if argstr[i : i + 1] != "{": + return -1 # the node wasn't part of a graph + + j = i + 1 + + if self._context is not None: + self.BadSyntax(argstr, i, "Nested graphs are not allowed") + + oldParentContext = self._parentContext # noqa: N806 + self._parentContext = self._context + reason2 = self._reason2 + self._reason2 = becauseSubGraph + # type error: Incompatible types in assignment (expression has type "Graph", variable has type "Optional[Formula]") + self._context = self._store.newGraph(graph) # type: ignore[assignment] + + while 1: + i = self.skipSpace(argstr, j) + if i < 0: + self.BadSyntax(argstr, i, "needed '}', found end.") + + if argstr[i : i + 1] == "}": + j = i + 1 + break + + j = self.directiveOrStatement(argstr, i) + if j < 0: + self.BadSyntax(argstr, i, "expected statement or '}'") + + self._context = self._parentContext + self._reason2 = reason2 + self._parentContext = oldParentContext + # res.append(subj.close()) # No use until closed + return j + + +class TrigParser(Parser): + """ + An RDFLib parser for TriG + + """ + + def __init__(self): + pass + + def parse(self, source: InputSource, graph: Graph, encoding: str = "utf-8") -> None: + if encoding not in [None, "utf-8"]: + raise Exception( + # type error: Unsupported left operand type for % ("Tuple[str, str]") + ("TriG files are always utf-8 encoded, ", "I was passed: %s") # type: ignore[operator] + % encoding + ) + + # we're currently being handed a Graph, not a ConjunctiveGraph + assert graph.store.context_aware, "TriG Parser needs a context-aware store!" + + conj_graph = ConjunctiveGraph(store=graph.store, identifier=graph.identifier) + conj_graph.default_context = graph # TODO: CG __init__ should have a + # default_context arg + # TODO: update N3Processor so that it can use conj_graph as the sink + conj_graph.namespace_manager = graph.namespace_manager + + sink = RDFSink(conj_graph) + + baseURI = conj_graph.absolutize( # noqa: N806 + source.getPublicId() or source.getSystemId() or "" + ) + p = TrigSinkParser(sink, baseURI=baseURI, turtle=True) + + stream = source.getCharacterStream() # try to get str stream first + if not stream: + # fallback to get the bytes stream + stream = source.getByteStream() + p.loadStream(stream) + + for prefix, namespace in p._bindings.items(): + conj_graph.bind(prefix, namespace) + + # return ??? diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/trix.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/trix.py new file mode 100644 index 0000000000000000000000000000000000000000..833e185681ffc9ee4f62fd4c9f9d3d6c171337f7 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/parsers/trix.py @@ -0,0 +1,296 @@ +""" +A TriX parser for RDFLib +""" + +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Dict, List, NoReturn, Optional, Tuple +from xml.sax import handler, make_parser +from xml.sax.handler import ErrorHandler + +from rdflib.exceptions import ParserError +from rdflib.graph import Graph +from rdflib.namespace import Namespace +from rdflib.parser import InputSource, Parser +from rdflib.store import Store +from rdflib.term import BNode, Identifier, Literal, URIRef + +if TYPE_CHECKING: + # from xml.sax.expatreader import ExpatLocator + from xml.sax.xmlreader import AttributesImpl, Locator, XMLReader + +__all__ = ["create_parser", "TriXHandler", "TriXParser"] + + +TRIXNS = Namespace("http://www.w3.org/2004/03/trix/trix-1/") +XMLNS = Namespace("http://www.w3.org/XML/1998/namespace") + + +class TriXHandler(handler.ContentHandler): + """An Sax Handler for TriX. See http://sw.nokia.com/trix/""" + + lang: Optional[str] + datatype: Optional[str] + + def __init__(self, store: Store): + self.store = store + self.preserve_bnode_ids = False + self.reset() + + def reset(self) -> None: + self.bnode: Dict[str, BNode] = {} + self.graph: Optional[Graph] = None + self.triple: Optional[List[Identifier]] = None + self.state = 0 + self.lang = None + self.datatype = None + + # ContentHandler methods + + def setDocumentLocator(self, locator: Locator): + self.locator = locator + + def startDocument(self) -> None: + pass + + def startPrefixMapping(self, prefix: Optional[str], namespace: str) -> None: + pass + + def endPrefixMapping(self, prefix: Optional[str]) -> None: + pass + + def startElementNS( + self, name: Tuple[Optional[str], str], qname, attrs: AttributesImpl + ) -> None: + if name[0] != str(TRIXNS): + self.error( + "Only elements in the TriX namespace are allowed. %s!=%s" + % (name[0], TRIXNS) + ) + + if name[1].lower() == "trix": + if self.state == 0: + self.state = 1 + else: + self.error("Unexpected TriX element") + + elif name[1] == "graph": + if self.state == 1: + self.state = 2 + else: + self.error("Unexpected graph element") + + elif name[1] == "uri": + if self.state == 2: + # the context uri + self.state = 3 + elif self.state == 4: + # part of a triple + pass + else: + self.error("Unexpected uri element") + + elif name[1] == "triple": + if self.state == 2: + if self.graph is None: + # anonymous graph, create one with random bnode id + self.graph = Graph(store=self.store) + # start of a triple + self.triple = [] + self.state = 4 + else: + self.error("Unexpected triple element") + + elif name[1] == "typedLiteral": + if self.state == 4: + # part of triple + self.lang = None + self.datatype = None + + try: + self.lang = attrs.getValue((str(XMLNS), "lang")) # type: ignore[arg-type, unused-ignore] + except Exception: + # language not required - ignore + pass + try: + self.datatype = attrs.getValueByQName("datatype") # type: ignore[arg-type, unused-ignore] + except KeyError: + self.error("No required attribute 'datatype'") + else: + self.error("Unexpected typedLiteral element") + + elif name[1] == "plainLiteral": + if self.state == 4: + # part of triple + self.lang = None + self.datatype = None + try: + # type error: Argument 1 to "getValue" of "AttributesImpl" has incompatible type "Tuple[str, str]"; expected "str" + self.lang = attrs.getValue((str(XMLNS), "lang")) # type: ignore[arg-type, unused-ignore] + except Exception: + # language not required - ignore + pass + + else: + self.error("Unexpected plainLiteral element") + + elif name[1] == "id": + if self.state == 2: + # the context uri + self.state = 3 + + elif self.state == 4: + # part of triple + pass + else: + self.error("Unexpected id element") + + else: + self.error("Unknown element %s in TriX namespace" % name[1]) + + self.chars = "" + + def endElementNS(self, name: Tuple[Optional[str], str], qname) -> None: + if TYPE_CHECKING: + assert self.triple is not None + if name[0] != str(TRIXNS): + self.error( + "Only elements in the TriX namespace are allowed. %s!=%s" + % (name[0], TRIXNS) + ) + + if name[1] == "uri": + if self.state == 3: + self.graph = Graph( + store=self.store, identifier=URIRef(self.chars.strip()) + ) + self.state = 2 + elif self.state == 4: + self.triple += [URIRef(self.chars.strip())] + else: + self.error( + "Illegal internal self.state - This should never " + + "happen if the SAX parser ensures XML syntax correctness" + ) + + elif name[1] == "id": + if self.state == 3: + self.graph = Graph( + self.store, identifier=self.get_bnode(self.chars.strip()) + ) + self.state = 2 + elif self.state == 4: + self.triple += [self.get_bnode(self.chars.strip())] + else: + self.error( + "Illegal internal self.state - This should never " + + "happen if the SAX parser ensures XML syntax correctness" + ) + + elif name[1] == "plainLiteral" or name[1] == "typedLiteral": + if self.state == 4: + self.triple += [ + Literal(self.chars, lang=self.lang, datatype=self.datatype) + ] + else: + self.error( + "This should never happen if the SAX parser " + + "ensures XML syntax correctness" + ) + + elif name[1] == "triple": + if self.state == 4: + if len(self.triple) != 3: + self.error( + "Triple has wrong length, got %d elements: %s" + % (len(self.triple), self.triple) + ) + # type error: Item "None" of "Optional[Graph]" has no attribute "add" + # type error: Argument 1 to "add" of "Graph" has incompatible type "List[Identifier]"; expected "Tuple[Node, Node, Node]" + self.graph.add(self.triple) # type: ignore[union-attr, arg-type] + # self.store.store.add(self.triple,context=self.graph) + # self.store.addN([self.triple+[self.graph]]) + self.state = 2 + else: + self.error( + "This should never happen if the SAX parser " + + "ensures XML syntax correctness" + ) + + elif name[1] == "graph": + self.graph = None + self.state = 1 + + elif name[1].lower() == "trix": + self.state = 0 + + else: + self.error("Unexpected close element") + + def get_bnode(self, label: str) -> BNode: + if self.preserve_bnode_ids: + bn = BNode(label) + else: + if label in self.bnode: + bn = self.bnode[label] + else: + bn = BNode(label) + self.bnode[label] = bn + return bn + + def characters(self, content: str) -> None: + self.chars += content + + def ignorableWhitespace(self, content) -> None: + pass + + def processingInstruction(self, target, data) -> None: + pass + + def error(self, message: str) -> NoReturn: + locator = self.locator + info = "%s:%s:%s: " % ( + locator.getSystemId(), + locator.getLineNumber(), + locator.getColumnNumber(), + ) + raise ParserError(info + message) + + +def create_parser(store: Store) -> XMLReader: + parser = make_parser() + try: + # Workaround for bug in expatreader.py. Needed when + # expatreader is trying to guess a prefix. + # type error: "XMLReader" has no attribute "start_namespace_decl" + parser.start_namespace_decl("xml", "http://www.w3.org/XML/1998/namespace") # type: ignore[attr-defined] + except AttributeError: + pass # Not present in Jython (at least) + parser.setFeature(handler.feature_namespaces, 1) + trix = TriXHandler(store) + parser.setContentHandler(trix) + parser.setErrorHandler(ErrorHandler()) + return parser + + +class TriXParser(Parser): + """A parser for TriX. See http://sw.nokia.com/trix/""" + + def __init__(self): + pass + + def parse(self, source: InputSource, sink: Graph, **args: Any) -> None: + assert ( + sink.store.context_aware + ), "TriXParser must be given a context aware store." + + self._parser = create_parser(sink.store) + content_handler = self._parser.getContentHandler() + preserve_bnode_ids = args.get("preserve_bnode_ids", None) + if preserve_bnode_ids is not None: + # type error: ContentHandler has no attribute "preserve_bnode_ids" + content_handler.preserve_bnode_ids = preserve_bnode_ids # type: ignore[attr-defined, unused-ignore] + # We're only using it once now + # content_handler.reset() + # self._parser.reset() + self._parser.parse(source) diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__init__.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..608b18de1f7745ec091689e19ac6dc09ff0b8017 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__init__.py @@ -0,0 +1,8 @@ +"""Module for builtin RDF Serializer. + +All builtin [RDF serializer][rdflib.serializer.Serializer] available +in [RDFLib Graphs method `serialize`][rdflib.graph.Graph.serialize] are listed here. + +Registration of builtin and external plugins +is described in [`rdflib.plugin`][rdflib.plugin]. +""" diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/__init__.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d62137c1d100390be43b60757a9548e7805c6b88 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/__init__.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/hext.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/hext.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e913b31b5a7138d3416e57b14df39225602e9316 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/hext.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/jsonld.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/jsonld.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..55ae85a6618be17231ca5e7b72e66d1e41dc3d32 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/jsonld.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/longturtle.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/longturtle.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d4b0fefec1ce3f62c8996a2be3f76e1cddebd6ba Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/longturtle.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/n3.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/n3.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..14c560fa92ed83d74c9e61b830696bb68f9e4063 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/n3.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/nquads.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/nquads.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..468a5c13d17933584d074a7273b0250e7fd981c3 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/nquads.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/nt.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/nt.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ff375ceb414e9a3616d884495da7f0e79be29be0 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/nt.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/patch.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/patch.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5b878518edd9ec2079e14dd6075f23bb3f006025 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/patch.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/rdfxml.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/rdfxml.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..17afe916002eb5cfc2eebb09e40369c817d1a6fd Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/rdfxml.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/trig.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/trig.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4ef9fd20f13ccf462a345c60a1d4e5a52822c0f2 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/trig.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/trix.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/trix.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c804bbe0c6bf70a3593bef0944dfe26fb8edba09 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/trix.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/turtle.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/turtle.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8641312f89c6cb98240f76aff6ac18b529a461f4 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/turtle.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/xmlwriter.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/xmlwriter.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ee27d9732ea80394c9b3dee5c7ed552c6e92c0b7 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/__pycache__/xmlwriter.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/hext.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/hext.py new file mode 100644 index 0000000000000000000000000000000000000000..898308a0924fb7e5c10c2ce382af304b5979060f --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/hext.py @@ -0,0 +1,207 @@ +""" +HextuplesSerializer RDF graph serializer for RDFLib. +See for details about the format. +""" + +from __future__ import annotations + +import json +import warnings +from typing import IO, Any, Callable, List, Optional, Type, Union, cast + +from rdflib.graph import DATASET_DEFAULT_GRAPH_ID, ConjunctiveGraph, Dataset, Graph +from rdflib.namespace import RDF, XSD +from rdflib.serializer import Serializer +from rdflib.term import BNode, IdentifiedNode, Literal, URIRef + +try: + import orjson + + _HAS_ORJSON = True +except ImportError: + orjson = None # type: ignore[assignment, unused-ignore] + _HAS_ORJSON = False + +__all__ = ["HextuplesSerializer"] + + +class HextuplesSerializer(Serializer): + """ + Serializes RDF graphs to NTriples format. + """ + + contexts: List[Union[Graph, IdentifiedNode]] + dumps: Callable + + def __new__(cls, store: Union[Graph, Dataset, ConjunctiveGraph]): + if _HAS_ORJSON: + cls.str_local_id: Union[str, Any] = orjson.Fragment(b'"localId"') + cls.str_global_id: Union[str, Any] = orjson.Fragment(b'"globalId"') + cls.empty: Union[str, Any] = orjson.Fragment(b'""') + cls.lang_str: Union[str, Any] = orjson.Fragment( + b'"' + RDF.langString.encode("utf-8") + b'"' + ) + cls.xsd_string: Union[str, Any] = orjson.Fragment( + b'"' + XSD.string.encode("utf-8") + b'"' + ) + else: + cls.str_local_id = "localId" + cls.str_global_id = "globalId" + cls.empty = "" + cls.lang_str = f"{RDF.langString}" + cls.xsd_string = f"{XSD.string}" + return super(cls, cls).__new__(cls) + + def __init__(self, store: Union[Graph, Dataset, ConjunctiveGraph]): + self.default_context: Optional[Union[Graph, IdentifiedNode]] + self.graph_type: Union[Type[Graph], Type[Dataset], Type[ConjunctiveGraph]] + if isinstance(store, (Dataset, ConjunctiveGraph)): + self.graph_type = ( + Dataset if isinstance(store, Dataset) else ConjunctiveGraph + ) + self.contexts = list(store.contexts()) + if store.default_context: + self.default_context = store.default_context + self.contexts.append(store.default_context) + else: + self.default_context = None + else: + self.graph_type = Graph + self.contexts = [store] + self.default_context = None + + Serializer.__init__(self, store) + + def serialize( + self, + stream: IO[bytes], + base: Optional[str] = None, + encoding: Optional[str] = "utf-8", + **kwargs: Any, + ) -> None: + if base is not None: + warnings.warn( + "base has no meaning for Hextuples serialization. " + "I will ignore this value" + ) + + if encoding not in [None, "utf-8"]: + warnings.warn( + f"Hextuples files are always utf-8 encoded. " + f"I was passed: {encoding}, " + "but I'm still going to use utf-8 anyway!" + ) + + if self.store.formula_aware is True: + raise Exception( + "Hextuple serialization can't (yet) handle formula-aware stores" + ) + context: Union[Graph, IdentifiedNode] + context_str: Union[bytes, str] + for context in self.contexts: + for triple in context: + # Generate context string just once, because it doesn't change + # for every triple in this context + context_str = cast( + Union[str, bytes], + ( + self.empty + if self.graph_type is Graph + else ( + orjson.Fragment('"' + self._context_str(context) + '"') + if _HAS_ORJSON + else self._context_str(context) + ) + ), + ) + hl = self._hex_line(triple, context_str) + if hl is not None: + stream.write(hl if _HAS_ORJSON else hl.encode()) + + def _hex_line(self, triple, context_str: Union[bytes, str]): + if isinstance( + triple[0], (URIRef, BNode) + ): # exclude QuotedGraph and other objects + # value + value = ( + triple[2] + if isinstance(triple[2], Literal) + else self._iri_or_bn(triple[2]) + ) + + # datatype + if isinstance(triple[2], URIRef): + # datatype = "http://www.w3.org/1999/02/22-rdf-syntax-ns#namedNode" + datatype = self.str_global_id + elif isinstance(triple[2], BNode): + # datatype = "http://www.w3.org/1999/02/22-rdf-syntax-ns#blankNode" + datatype = self.str_local_id + elif isinstance(triple[2], Literal): + if triple[2].datatype is not None: + datatype = f"{triple[2].datatype}" + else: + if triple[2].language is not None: # language + datatype = self.lang_str + else: + datatype = self.xsd_string + else: + return None # can't handle non URI, BN or Literal Object (QuotedGraph) + + # language + if isinstance(triple[2], Literal): + if triple[2].language is not None: + language = f"{triple[2].language}" + else: + language = self.empty + else: + language = self.empty + line_list = [ + self._iri_or_bn(triple[0]), + triple[1], + value, + datatype, + language, + context_str, + ] + outline: Union[str, bytes] + if _HAS_ORJSON: + outline = orjson.dumps(line_list, option=orjson.OPT_APPEND_NEWLINE) + else: + outline = json.dumps(line_list) + "\n" + return outline + else: # do not return anything for non-IRIs or BNs, e.g. QuotedGraph, Subjects + return None + + def _iri_or_bn(self, i_): + if isinstance(i_, URIRef): + return f"{i_}" + elif isinstance(i_, BNode): + return f"{i_.n3()}" + else: + return None + + def _context_str(self, context: Union[Graph, IdentifiedNode]) -> str: + context_identifier: IdentifiedNode = ( + context.identifier if isinstance(context, Graph) else context + ) + if context_identifier == DATASET_DEFAULT_GRAPH_ID: + return "" + if self.default_context is not None: + if ( + isinstance(self.default_context, IdentifiedNode) + and context_identifier == self.default_context + ): + return "" + elif ( + isinstance(self.default_context, Graph) + and context_identifier == self.default_context.identifier + ): + return "" + if self.graph_type is Graph: + # Only emit a context name when serializing a Dataset or ConjunctiveGraph + return "" + return ( + f"{context_identifier}" + if isinstance(context_identifier, URIRef) + else context_identifier.n3() + ) diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/jsonld.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/jsonld.py new file mode 100644 index 0000000000000000000000000000000000000000..14001d8a857a3d9a74742d1f639718f17c0403c3 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/jsonld.py @@ -0,0 +1,434 @@ +""" +This serialiser will output an RDF Graph as a JSON-LD formatted document. See http://json-ld.org/ + +Example: + ```python + >>> from rdflib import Graph + >>> testrdf = ''' + ... @prefix dc: . + ... + ... dc:title "Someone's Homepage"@en . + ... ''' + + >>> g = Graph().parse(data=testrdf, format='n3') + + >>> print(g.serialize(format='json-ld', indent=2)) + [ + { + "@id": "http://example.org/about", + "http://purl.org/dc/terms/title": [ + { + "@language": "en", + "@value": "Someone's Homepage" + } + ] + } + ] + + ``` +""" + +# From: https://github.com/RDFLib/rdflib-jsonld/blob/feature/json-ld-1.1/rdflib_jsonld/serializer.py + +# NOTE: This code writes the entire JSON object into memory before serialising, +# but we should consider streaming the output to deal with arbitrarily large +# graphs. + +from __future__ import annotations + +import warnings +from typing import IO, Any, Dict, List, Optional + +from rdflib.graph import DATASET_DEFAULT_GRAPH_ID, Graph, _ObjectType +from rdflib.namespace import RDF, XSD +from rdflib.serializer import Serializer +from rdflib.term import BNode, IdentifiedNode, Identifier, Literal, URIRef + +from ..shared.jsonld.context import UNDEF, Context +from ..shared.jsonld.keys import CONTEXT, GRAPH, ID, LANG, LIST, SET, VOCAB +from ..shared.jsonld.util import _HAS_ORJSON, json, orjson + +__all__ = ["JsonLDSerializer", "from_rdf"] + + +PLAIN_LITERAL_TYPES = {XSD.boolean, XSD.integer, XSD.double, XSD.string} + + +class JsonLDSerializer(Serializer): + """JSON-LD RDF graph serializer.""" + + def __init__(self, store: Graph): + super(JsonLDSerializer, self).__init__(store) + + def serialize( + self, + stream: IO[bytes], + base: Optional[str] = None, + encoding: Optional[str] = None, + **kwargs: Any, + ) -> None: + # TODO: docstring w. args and return value + encoding = encoding or "utf-8" + if encoding not in ("utf-8", "utf-16"): + warnings.warn( + "JSON should be encoded as unicode. " f"Given encoding was: {encoding}" + ) + + context_data = kwargs.get("context") + use_native_types = (kwargs.get("use_native_types", False),) + use_rdf_type = kwargs.get("use_rdf_type", False) + auto_compact = kwargs.get("auto_compact", False) + + indent = kwargs.get("indent", 2) + separators = kwargs.get("separators", (",", ": ")) + sort_keys = kwargs.get("sort_keys", True) + ensure_ascii = kwargs.get("ensure_ascii", False) + + obj = from_rdf( + self.store, + context_data, + base, + use_native_types, + use_rdf_type, + auto_compact=auto_compact, + ) + if _HAS_ORJSON: + option: int = orjson.OPT_NON_STR_KEYS + if indent is not None: + option |= orjson.OPT_INDENT_2 + if sort_keys: + option |= orjson.OPT_SORT_KEYS + if ensure_ascii: + warnings.warn("Cannot use ensure_ascii with orjson") + data_bytes = orjson.dumps(obj, option=option) + stream.write(data_bytes) + else: + data = json.dumps( + obj, + indent=indent, + separators=separators, + sort_keys=sort_keys, + ensure_ascii=ensure_ascii, + ) + stream.write(data.encode(encoding, "replace")) + + +def from_rdf( + graph, + context_data=None, + base=None, + use_native_types=False, + use_rdf_type=False, + auto_compact=False, + startnode=None, + index=False, +): + # TODO: docstring w. args and return value + # TODO: support for index and startnode + + if not context_data and auto_compact: + context_data = dict( + (pfx, str(ns)) + for (pfx, ns) in graph.namespaces() + if pfx and str(ns) != "http://www.w3.org/XML/1998/namespace" + ) + + if isinstance(context_data, Context): + context = context_data + context_data = context.to_dict() + else: + context = Context(context_data, base=base) + + converter = Converter(context, use_native_types, use_rdf_type) + result = converter.convert(graph) + + if converter.context.active: + if isinstance(result, list): + result = {context.get_key(GRAPH): result} + result[CONTEXT] = context_data + + return result + + +class Converter: + def __init__(self, context: Context, use_native_types: bool, use_rdf_type: bool): + self.context = context + self.use_native_types = context.active or use_native_types + self.use_rdf_type = use_rdf_type + + def convert(self, graph: Graph): + # TODO: bug in rdflib dataset parsing (nquads et al): + # plain triples end up in separate unnamed graphs (rdflib issue #436) + if graph.context_aware: + # type error: "Graph" has no attribute "contexts" + all_contexts = list(graph.contexts()) # type: ignore[attr-defined] + has_dataset_default_id = any( + c.identifier == DATASET_DEFAULT_GRAPH_ID for c in all_contexts + ) + if ( + has_dataset_default_id + # # type error: "Graph" has no attribute "contexts" + and graph.default_context.identifier == DATASET_DEFAULT_GRAPH_ID # type: ignore[attr-defined] + ): + default_graph = graph.default_context # type: ignore[attr-defined] + else: + default_graph = Graph() + graphs = [default_graph] + default_graph_id = default_graph.identifier + + for g in all_contexts: + if g in graphs: + continue + if isinstance(g.identifier, URIRef): + graphs.append(g) + else: + default_graph += g + else: + graphs = [graph] + default_graph_id = graph.identifier + + context = self.context + + objs: List[Any] = [] + for g in graphs: + obj = {} + graphname = None + + if isinstance(g.identifier, URIRef): + if g.identifier != default_graph_id: + graphname = context.shrink_iri(g.identifier) + obj[context.id_key] = graphname + + nodes = self.from_graph(g) + + if not graphname and len(nodes) == 1: + obj.update(nodes[0]) + else: + if not nodes: + continue + obj[context.graph_key] = nodes + + if objs and objs[0].get(context.get_key(ID)) == graphname: + objs[0].update(obj) + else: + objs.append(obj) + + if len(graphs) == 1 and len(objs) == 1 and not self.context.active: + default = objs[0] + items = default.get(context.graph_key) + if len(default) == 1 and items: + objs = items + elif len(objs) == 1 and self.context.active: + objs = objs[0] + + return objs + + def from_graph(self, graph: Graph): + nodemap: Dict[Any, Any] = {} + + for s in set(graph.subjects()): + ## only iri:s and unreferenced (rest will be promoted to top if needed) + if isinstance(s, URIRef) or ( + isinstance(s, BNode) and not any(graph.subjects(None, s)) + ): + self.process_subject(graph, s, nodemap) + + return list(nodemap.values()) + + def process_subject(self, graph: Graph, s: IdentifiedNode, nodemap): + if isinstance(s, URIRef): + node_id = self.context.shrink_iri(s) + elif isinstance(s, BNode): + node_id = s.n3() + else: + # This does not seem right, this probably should be an error. + node_id = None + + # used_as_object = any(graph.subjects(None, s)) + if node_id in nodemap: + return None + + node = {} + node[self.context.id_key] = node_id + nodemap[node_id] = node + + for p, o in graph.predicate_objects(s): + # type error: Argument 3 to "add_to_node" of "Converter" has incompatible type "Node"; expected "IdentifiedNode" + # type error: Argument 4 to "add_to_node" of "Converter" has incompatible type "Node"; expected "Identifier" + self.add_to_node(graph, s, p, o, node, nodemap) # type: ignore[arg-type] + + return node + + def add_to_node( + self, + graph: Graph, + s: IdentifiedNode, + p: IdentifiedNode, + o: Identifier, + s_node: Dict[str, Any], + nodemap, + ): + context = self.context + + if isinstance(o, Literal): + datatype = str(o.datatype) if o.datatype else None + language = o.language + term = context.find_term(str(p), datatype, language=language) + else: + containers = [LIST, None] if graph.value(o, RDF.first) else [None] + for container in containers: + for coercion in (ID, VOCAB, UNDEF): + # type error: Argument 2 to "find_term" of "Context" has incompatible type "object"; expected "Union[str, Defined, None]" + # type error: Argument 3 to "find_term" of "Context" has incompatible type "Optional[str]"; expected "Union[Defined, str]" + term = context.find_term(str(p), coercion, container) # type: ignore[arg-type] + if term: + break + if term: + break + + node = None + use_set = not context.active + + if term: + p_key = term.name + + if term.type: + node = self.type_coerce(o, term.type) + # type error: "Identifier" has no attribute "language" + elif term.language and o.language == term.language: # type: ignore[attr-defined] + node = str(o) + # type error: Right operand of "and" is never evaluated + elif context.language and (term.language is None and o.language is None): # type: ignore[unreachable] + node = str(o) # type: ignore[unreachable] + + if LIST in term.container: + node = [ + self.type_coerce(v, term.type) + or self.to_raw_value(graph, s, v, nodemap) + for v in self.to_collection(graph, o) + ] + elif LANG in term.container and language: + value = s_node.setdefault(p_key, {}) + values = value.get(language) + node = str(o) + if values or SET in term.container: + if not isinstance(values, list): + value[language] = values = [values] + values.append(node) + else: + value[language] = node + return + elif SET in term.container: + use_set = True + + else: + p_key = context.to_symbol(p) + # TODO: for coercing curies - quite clumsy; unify to_symbol and find_term? + key_term = context.terms.get(p_key) + if key_term and (key_term.type or key_term.container): + p_key = p + if not term and p == RDF.type and not self.use_rdf_type: + if isinstance(o, URIRef): + node = context.to_symbol(o) + p_key = context.type_key + + if node is None: + node = self.to_raw_value(graph, s, o, nodemap) + + value = s_node.get(p_key) + if value: + if not isinstance(value, list): + value = [value] + value.append(node) + elif use_set: + value = [node] + else: + value = node + s_node[p_key] = value + + def type_coerce(self, o: Identifier, coerce_type: str): + if coerce_type == ID: + if isinstance(o, URIRef): + return self.context.shrink_iri(o) + elif isinstance(o, BNode): + return o.n3() + else: + return o + elif coerce_type == VOCAB and isinstance(o, URIRef): + return self.context.to_symbol(o) + elif isinstance(o, Literal) and str(o.datatype) == coerce_type: + return o + else: + return None + + def to_raw_value( + self, graph: Graph, s: IdentifiedNode, o: Identifier, nodemap: Dict[str, Any] + ): + context = self.context + coll = self.to_collection(graph, o) + if coll is not None: + coll = [ + self.to_raw_value(graph, s, lo, nodemap) + for lo in self.to_collection(graph, o) + ] + return {context.list_key: coll} + elif isinstance(o, BNode): + embed = ( + False # TODO: self.context.active or using startnode and only one ref + ) + onode = self.process_subject(graph, o, nodemap) + if onode: + if embed and not any(s2 for s2 in graph.subjects(None, o) if s2 != s): + return onode + else: + nodemap[onode[context.id_key]] = onode + return {context.id_key: o.n3()} + elif isinstance(o, URIRef): + # TODO: embed if o != startnode (else reverse) + return {context.id_key: context.shrink_iri(o)} + elif isinstance(o, Literal): + # TODO: if compact + native = self.use_native_types and o.datatype in PLAIN_LITERAL_TYPES + if native: + v = o.toPython() + else: + v = str(o) + if o.datatype: + if native and self.context.active: + return v + return { + context.type_key: context.to_symbol(o.datatype), + context.value_key: v, + } + elif o.language and o.language != context.language: + return {context.lang_key: o.language, context.value_key: v} + # type error: Right operand of "and" is never evaluated + elif not context.active or context.language and not o.language: # type: ignore[unreachable] + return {context.value_key: v} + else: + return v + + def to_collection(self, graph: Graph, l_: Identifier): + if l_ != RDF.nil and not graph.value(l_, RDF.first): + return None + list_nodes: List[Optional[_ObjectType]] = [] + chain = set([l_]) + while l_: + if l_ == RDF.nil: + return list_nodes + if isinstance(l_, URIRef): + return None + first, rest = None, None + for p, o in graph.predicate_objects(l_): + if not first and p == RDF.first: + first = o + elif not rest and p == RDF.rest: + rest = o + elif p != RDF.type or o != RDF.List: + return None + list_nodes.append(first) + # type error: Incompatible types in assignment (expression has type "Optional[Node]", variable has type "Identifier") + l_ = rest # type: ignore[assignment] + if l_ in chain: + return None + chain.add(l_) diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/longturtle.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/longturtle.py new file mode 100644 index 0000000000000000000000000000000000000000..d35485c911ae41d14ca137a9e4c2771d1a7ed90f --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/longturtle.py @@ -0,0 +1,377 @@ +""" +LongTurtle RDF graph serializer for RDFLib. +See http://www.w3.org/TeamSubmission/turtle/ for syntax specification. + +This variant, longturtle as opposed to just turtle, makes some small format changes +to turtle - the original turtle serializer. It: + +* uses PREFIX instead of @prefix +* uses BASE instead of @base +* adds a new line at RDF.type, or 'a' +* adds a newline and an indent for all triples with more than one object (object list) +* adds a new line and ';' for the last triple in a set with '.' + on the start of the next line +* uses default encoding (encode()) is used instead of "latin-1" + +- Nicholas Car, 2023 +""" + +from __future__ import annotations + +import warnings +from typing import IO, Any, Optional + +from rdflib.compare import to_canonical_graph +from rdflib.exceptions import Error +from rdflib.graph import Graph, _TripleType +from rdflib.namespace import RDF +from rdflib.term import BNode, Literal, URIRef + +from .turtle import RecursiveSerializer + +__all__ = ["LongTurtleSerializer"] + +SUBJECT = 0 +VERB = 1 +OBJECT = 2 + +_GEN_QNAME_FOR_DT = False +_SPACIOUS_OUTPUT = False + + +class LongTurtleSerializer(RecursiveSerializer): + """LongTurtle, a Turtle serialization format. + + When the optional parameter `canon` is set to `True`, the graph is canonicalized + before serialization. This normalizes blank node identifiers and allows for + deterministic serialization of the graph. Useful when consistent outputs are required. + """ + + short_name = "longturtle" + indentString = " " + + def __init__(self, store): + self._ns_rewrite = {} + self._canon = False + super(LongTurtleSerializer, self).__init__(store) + self.keywords = {RDF.type: "a"} + self.reset() + self.stream = None + self._spacious: bool = _SPACIOUS_OUTPUT + + def addNamespace(self, prefix, namespace): + # Turtle does not support prefixes that start with _ + # if they occur in the graph, rewrite to p_blah + # this is more complicated since we need to make sure p_blah + # does not already exist. And we register namespaces as we go, i.e. + # we may first see a triple with prefix _9 - rewrite it to p_9 + # and then later find a triple with a "real" p_9 prefix + + # so we need to keep track of ns rewrites we made so far. + + if (prefix > "" and prefix[0] == "_") or self.namespaces.get( + prefix, namespace + ) != namespace: + if prefix not in self._ns_rewrite: + p = "p" + prefix + while p in self.namespaces: + p = "p" + p + self._ns_rewrite[prefix] = p + + prefix = self._ns_rewrite.get(prefix, prefix) + + super(LongTurtleSerializer, self).addNamespace(prefix, namespace) + return prefix + + def canonize(self): + """Apply canonicalization to the store. + + This normalizes blank node identifiers and allows for deterministic + serialization of the graph. + """ + if not self._canon: + return + + namespace_manager = self.store.namespace_manager + store = to_canonical_graph(self.store) + content = store.serialize(format="application/n-triples") + lines = content.split("\n") + lines.sort() + graph = Graph() + graph.parse( + data="\n".join(lines), format="application/n-triples", skolemize=True + ) + graph = graph.de_skolemize() + graph.namespace_manager = namespace_manager + self.store = graph + + def reset(self): + super(LongTurtleSerializer, self).reset() + self._shortNames = {} + self._started = False + self._ns_rewrite = {} + self.canonize() + + def serialize( + self, + stream: IO[bytes], + base: Optional[str] = None, + encoding: Optional[str] = None, + spacious: Optional[bool] = None, + **kwargs: Any, + ) -> None: + self._canon = kwargs.get("canon", False) + self.reset() + self.stream = stream + # if base is given here, use, if not and a base is set for the graph use that + if base is not None: + self.base = base + elif self.store.base is not None: + self.base = self.store.base + + if spacious is not None: + self._spacious = spacious + + self.preprocess() + subjects_list = self.orderSubjects() + + self.startDocument() + + firstTime = True + for subject in subjects_list: + if self.isDone(subject): + continue + if firstTime: + firstTime = False + if self.statement(subject) and not firstTime: + self.write("\n") + + self.endDocument() + + self.base = None + + def preprocessTriple(self, triple: _TripleType) -> None: + super(LongTurtleSerializer, self).preprocessTriple(triple) + for i, node in enumerate(triple): + if i == VERB: + if node in self.keywords: + # predicate is a keyword + continue + if ( + self.base is not None + and isinstance(node, URIRef) + and node.startswith(self.base) + and "#" not in node.replace(self.base, "") + and "/" not in node.replace(self.base, "") + ): + # predicate corresponds to base namespace + continue + # Don't use generated prefixes for subjects and objects + self.get_pname(node, gen_prefix=(i == VERB)) + if isinstance(node, Literal) and node.datatype: + self.get_pname(node.datatype, gen_prefix=_GEN_QNAME_FOR_DT) + p = triple[1] + if isinstance(p, BNode): # hmm - when is P ever a bnode? + self._references[p] += 1 + + def get_pname(self, uri, gen_prefix=True): + if not isinstance(uri, URIRef): + return None + + try: + parts = self.store.compute_qname(uri, generate=gen_prefix) + except Exception: + # is the uri a namespace in itself? + pfx = self.store.store.prefix(uri) + + if pfx is not None: + parts = (pfx, uri, "") + else: + # nothing worked + return None + + prefix, namespace, local = parts + + # To understand treatment of % character refer to Productions for terminal PLX at + # https://www.w3.org/TR/turtle/#grammar-production-PLX + # Only % NOT followed by two hex chars requires manual backslash escaping + local = local.replace(r"(", r"\(").replace(r")", r"\)") + local = self.LOCALNAME_PECRENT_CHARACTER_REQUIRING_ESCAPE_REGEX.sub( + "\\%", local + ) + + # PName cannot end with . + if local.endswith("."): + return None + + prefix = self.addNamespace(prefix, namespace) + + return "%s:%s" % (prefix, local) + + def getQName(self, uri, gen_prefix=True): + warnings.warn( + "LongTurtleSerializer.getQName is deprecated, use LongTurtleSerializer.get_pname instead.", + DeprecationWarning, + stacklevel=2, + ) + return self.get_pname(uri, gen_prefix) + + def startDocument(self): + self._started = True + ns_list = sorted(self.namespaces.items()) + + if self.base: + self.write(self.indent() + "BASE <%s>\n" % self.base) + for prefix, uri in ns_list: + self.write(self.indent() + "PREFIX %s: <%s>\n" % (prefix, uri)) + if ns_list and self._spacious: + self.write("\n") + + def endDocument(self): + if self._spacious: + self.write("\n") + + def statement(self, subject): + self.subjectDone(subject) + return self.s_squared(subject) or self.s_default(subject) + + def s_default(self, subject): + self.write("\n" + self.indent()) + self.path(subject, SUBJECT) + self.write("\n" + self.indent()) + self.predicateList(subject) + self.write("\n.") + return True + + def s_squared(self, subject): + if (self._references[subject] > 0) or not isinstance(subject, BNode): + return False + self.write("\n" + self.indent() + "[]") + self.predicateList(subject, newline=False) + self.write("\n.") + return True + + def path(self, node, position, newline=False): + if not ( + self.p_squared(node, position) or self.p_default(node, position, newline) + ): + raise Error("Cannot serialize node '%s'" % (node,)) + + def p_default(self, node, position, newline=False): + if position != SUBJECT and not newline: + self.write(" ") + self.write(self.label(node, position)) + return True + + def label(self, node, position): + if node == RDF.nil: + return "()" + if position is VERB and node in self.keywords: + return self.keywords[node] + if isinstance(node, Literal): + return node._literal_n3( + use_plain=True, + qname_callback=lambda dt: self.get_pname(dt, _GEN_QNAME_FOR_DT), + ) + else: + node = self.relativize(node) + + return self.get_pname(node, position == VERB) or node.n3() + + def p_squared( + self, + node, + position, + ): + if ( + not isinstance(node, BNode) + or node in self._serialized + or self._references[node] > 1 + or position == SUBJECT + ): + return False + + if self.isValidList(node): + # this is a list + self.depth += 2 + self.write(" (\n") + self.depth -= 2 + self.doList(node) + self.write("\n" + self.indent() + ")") + else: + # this is a Blank Node + self.subjectDone(node) + self.write("\n" + self.indent(1) + "[\n") + self.depth += 1 + self.predicateList(node) + self.depth -= 1 + self.write("\n" + self.indent(1) + "]") + + return True + + def isValidList(self, l_): + """ + Checks if l is a valid RDF list, i.e. no nodes have other properties. + """ + try: + if self.store.value(l_, RDF.first) is None: + return False + except Exception: + return False + while l_: + if l_ != RDF.nil and len(list(self.store.predicate_objects(l_))) != 2: + return False + l_ = self.store.value(l_, RDF.rest) + return True + + def doList(self, l_): + i = 0 + while l_: + item = self.store.value(l_, RDF.first) + if item is not None: + if i == 0: + self.write(self.indent(1)) + else: + self.write("\n" + self.indent(1)) + self.path(item, OBJECT, newline=True) + self.subjectDone(l_) + l_ = self.store.value(l_, RDF.rest) + i += 1 + + def predicateList(self, subject, newline=False): + properties = self.buildPredicateHash(subject) + propList = self.sortProperties(properties) + if len(propList) == 0: + return + self.write(self.indent(1)) + self.verb(propList[0], newline=True) + self.objectList(properties[propList[0]]) + for predicate in propList[1:]: + self.write(" ;\n" + self.indent(1)) + self.verb(predicate, newline=True) + self.objectList(properties[predicate]) + self.write(" ;") + + def verb(self, node, newline=False): + self.path(node, VERB, newline) + + def objectList(self, objects): + count = len(objects) + if count == 0: + return + depthmod = (count == 1) and 0 or 1 + self.depth += depthmod + first_nl = False + if count > 1: + if not isinstance(objects[0], BNode): + self.write("\n" + self.indent(1)) + else: + self.write(" ") + first_nl = True + self.path(objects[0], OBJECT, newline=first_nl) + for obj in objects[1:]: + self.write(" ,") + if not isinstance(obj, BNode): + self.write("\n" + self.indent(1)) + self.path(obj, OBJECT, newline=True) + self.depth -= depthmod diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/n3.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/n3.py new file mode 100644 index 0000000000000000000000000000000000000000..dc45869cc8490ac15f0374117d4570c7e9d20587 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/n3.py @@ -0,0 +1,103 @@ +""" +Notation 3 (N3) RDF graph serializer for RDFLib. +""" + +import warnings + +from rdflib.graph import Graph +from rdflib.namespace import OWL, Namespace +from rdflib.plugins.serializers.turtle import OBJECT, SUBJECT, TurtleSerializer + +__all__ = ["N3Serializer"] + +SWAP_LOG = Namespace("http://www.w3.org/2000/10/swap/log#") + + +class N3Serializer(TurtleSerializer): + """Notation 3 (N3) RDF graph serializer.""" + + short_name = "n3" + + def __init__(self, store: Graph, parent=None): + super(N3Serializer, self).__init__(store) + self.keywords.update({OWL.sameAs: "=", SWAP_LOG.implies: "=>"}) + self.parent = parent + + def reset(self): + super(N3Serializer, self).reset() + self._stores = {} + + def endDocument(self): # noqa: N802 + if not self.parent: + super(N3Serializer, self).endDocument() + + def indent(self, modifier=0): + indent = super(N3Serializer, self).indent(modifier) + if self.parent is not None: + indent += self.parent.indent() # modifier) + return indent + + def preprocessTriple(self, triple): # noqa: N802 + super(N3Serializer, self).preprocessTriple(triple) + if isinstance(triple[0], Graph): + for t in triple[0]: + self.preprocessTriple(t) + if isinstance(triple[1], Graph): + for t in triple[1]: + self.preprocessTriple(t) + if isinstance(triple[2], Graph): + for t in triple[2]: + self.preprocessTriple(t) + + def get_pname(self, uri, gen_prefix=True): + qname = None + if self.parent is not None: + qname = self.parent.get_pname(uri, gen_prefix) + if qname is None: + qname = super(N3Serializer, self).get_pname(uri, gen_prefix) + return qname + + def getQName(self, uri, gen_prefix=True): # noqa: N802 + warnings.warn( + "N3Serializer.getQName is deprecated, use N3Serializer.get_pname instead.", + DeprecationWarning, + stacklevel=2, + ) + return self.get_pname(uri, gen_prefix) + + def statement(self, subject): + self.subjectDone(subject) + properties = self.buildPredicateHash(subject) + if len(properties) == 0: + return False + return self.s_clause(subject) or super(N3Serializer, self).statement(subject) + + def path(self, node, position, newline=False): + if not self.p_clause(node, position): + super(N3Serializer, self).path(node, position, newline) + + def s_clause(self, subject): + if isinstance(subject, Graph): + self.write("\n" + self.indent()) + self.p_clause(subject, SUBJECT) + self.predicateList(subject) + self.write(" .") + return True + else: + return False + + def p_clause(self, node, position): + if isinstance(node, Graph): + self.subjectDone(node) + if position is OBJECT: + self.write(" ") + self.write("{") + self.depth += 1 + serializer = N3Serializer(node, parent=self) + # type error: Argument 1 to "serialize" of "TurtleSerializer" has incompatible type "Optional[IO[bytes]]"; expected "IO[bytes]" + serializer.serialize(self.stream) # type: ignore[arg-type] + self.depth -= 1 + self.write(self.indent() + "}") + return True + else: + return False diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/nquads.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/nquads.py new file mode 100644 index 0000000000000000000000000000000000000000..c7c68f66ead0625e7d65b9cc95ae9906537e74fc --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/nquads.py @@ -0,0 +1,64 @@ +from __future__ import annotations + +import warnings +from typing import IO, Any, Optional + +from rdflib.graph import DATASET_DEFAULT_GRAPH_ID, ConjunctiveGraph, Graph +from rdflib.plugins.serializers.nt import _quoteLiteral +from rdflib.serializer import Serializer +from rdflib.term import Literal + +__all__ = ["NQuadsSerializer"] + + +class NQuadsSerializer(Serializer): + """NQuads RDF graph serializer.""" + + def __init__(self, store: Graph): + if not store.context_aware: + raise Exception( + "NQuads serialization only makes " "sense for context-aware stores!" + ) + + super(NQuadsSerializer, self).__init__(store) + self.store: ConjunctiveGraph + + def serialize( + self, + stream: IO[bytes], + base: Optional[str] = None, + encoding: Optional[str] = None, + **kwargs: Any, + ) -> None: + if base is not None: + warnings.warn("NQuadsSerializer does not support base.") + if encoding is not None and encoding.lower() != self.encoding.lower(): + warnings.warn( + "NQuadsSerializer does not use custom encoding. " + f"Given encoding was: {encoding}" + ) + encoding = self.encoding + for context in self.store.contexts(): + for triple in context: + stream.write( + _nq_row(triple, context.identifier).encode(encoding, "replace") + ) + stream.write("\n".encode("latin-1")) + + +def _nq_row(triple, context): + graph_name = context.n3() if context and context != DATASET_DEFAULT_GRAPH_ID else "" + if isinstance(triple[2], Literal): + return "%s %s %s %s .\n" % ( + triple[0].n3(), + triple[1].n3(), + _quoteLiteral(triple[2]), + graph_name, + ) + else: + return "%s %s %s %s .\n" % ( + triple[0].n3(), + triple[1].n3(), + triple[2].n3(), + graph_name, + ) diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/nt.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/nt.py new file mode 100644 index 0000000000000000000000000000000000000000..57fdb0c6069163c6f88ad9a4e5634ccf2a15c13f --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/nt.py @@ -0,0 +1,110 @@ +from __future__ import annotations + +import codecs +import warnings +from typing import IO, TYPE_CHECKING, Any, Optional, Tuple, Union + +from rdflib.graph import Graph +from rdflib.serializer import Serializer +from rdflib.term import Literal + +if TYPE_CHECKING: + from rdflib.graph import _TripleType + +""" +N-Triples RDF graph serializer for RDFLib. +See for details about the +format. +""" + +__all__ = ["NTSerializer"] + + +class NTSerializer(Serializer): + """Serializes RDF graphs to NTriples format.""" + + def __init__(self, store: Graph): + Serializer.__init__(self, store) + + def serialize( + self, + stream: IO[bytes], + base: Optional[str] = None, + encoding: Optional[str] = "utf-8", + **kwargs: Any, + ) -> None: + if base is not None: + warnings.warn("NTSerializer does not support base.") + if encoding != "utf-8": + warnings.warn( + "NTSerializer always uses UTF-8 encoding. " + f"Given encoding was: {encoding}" + ) + + for triple in self.store: + stream.write(_nt_row(triple).encode()) + + +class NT11Serializer(NTSerializer): + """Serializes RDF graphs to RDF 1.1 NTriples format. + + Exactly like nt - only utf8 encoded. + """ + + def __init__(self, store: Graph): + Serializer.__init__(self, store) # default to utf-8 + + +def _nt_row(triple: _TripleType) -> str: + if isinstance(triple[2], Literal): + return "%s %s %s .\n" % ( + triple[0].n3(), + triple[1].n3(), + _quoteLiteral(triple[2]), + ) + else: + return "%s %s %s .\n" % (triple[0].n3(), triple[1].n3(), triple[2].n3()) + + +def _quoteLiteral(l_: Literal) -> str: # noqa: N802 + """A simpler version of term.Literal.n3()""" + + encoded = _quote_encode(l_) + + if l_.language: + if l_.datatype: + raise Exception("Literal has datatype AND language!") + return "%s@%s" % (encoded, l_.language) + elif l_.datatype: + return "%s^^<%s>" % (encoded, l_.datatype) + else: + return "%s" % encoded + + +def _quote_encode(l_: str) -> str: + return '"%s"' % l_.replace("\\", "\\\\").replace("\n", "\\n").replace( + '"', '\\"' + ).replace("\r", "\\r") + + +def _nt_unicode_error_resolver( + err: UnicodeError, +) -> Tuple[Union[str, bytes], int]: + """ + Do unicode char replaces as defined in https://www.w3.org/TR/2004/REC-rdf-testcases-20040210/#ntrip_strings + """ + + def _replace_single(c): + c = ord(c) + fmt = "\\u%04X" if c <= 0xFFFF else "\\U%08X" + return fmt % c + + # type error: "UnicodeError" has no attribute "object" + # type error: "UnicodeError" has no attribute "start" + # type error: "UnicodeError" has no attribute "end" + string = err.object[err.start : err.end] # type: ignore[attr-defined] + # type error: "UnicodeError" has no attribute "end" + return "".join(_replace_single(c) for c in string), err.end # type: ignore[attr-defined] + + +codecs.register_error("_rdflib_nt_escape", _nt_unicode_error_resolver) diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/patch.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/patch.py new file mode 100644 index 0000000000000000000000000000000000000000..c69f9c1b260ab1fd6486dd73d6bd46e5c013d588 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/patch.py @@ -0,0 +1,111 @@ +from __future__ import annotations + +import warnings +from typing import IO, Any, Optional +from uuid import uuid4 + +from rdflib import Dataset +from rdflib.plugins.serializers.nquads import _nq_row +from rdflib.plugins.serializers.nt import _nt_row +from rdflib.serializer import Serializer + +add_remove_methods = {"add": "A", "remove": "D"} + + +class PatchSerializer(Serializer): + """ + Creates an RDF patch file to add and remove triples/quads. + Can either: + - Create an add or delete patch for a single Dataset. + - Create a patch to represent the difference between two Datasets. + """ + + def __init__( + self, + store: Dataset, + ): + self.store: Dataset = store + super().__init__(store) + + def serialize( + self, + stream: IO[bytes], + base: Optional[str] = None, + encoding: Optional[str] = None, + **kwargs: Any, + ) -> None: + """Serialize the store to the given stream. + + Args: + stream: The stream to serialize to. + base: The base URI to use for the serialization. + encoding: The encoding to use for the serialization. + kwargs: Additional keyword arguments. + + Supported keyword arguments: + + - operation: The operation to perform. Either 'add' or 'remove'. + - target: The target Dataset to compare against. + NB: Only one of 'operation' or 'target' should be provided. + - header_id: The header ID to use. + - header_prev: The previous header ID to use. + """ + operation = kwargs.get("operation") + target = kwargs.get("target") + header_id = kwargs.get("header_id") + header_prev = kwargs.get("header_prev") + if not header_id: + header_id = f"uuid:{uuid4()}" + encoding = self.encoding + if base is not None: + warnings.warn("PatchSerializer does not support base.") + if encoding is not None and encoding.lower() != self.encoding.lower(): + warnings.warn( + "PatchSerializer does not use custom encoding. " + f"Given encoding was: {encoding}" + ) + + def write_header(): + stream.write(f"H id <{header_id}> .\n".encode(encoding, "replace")) + if header_prev: + stream.write(f"H prev <{header_prev}>\n".encode(encoding, "replace")) + stream.write("TX .\n".encode(encoding, "replace")) + + def write_triples(contexts, op_code, use_passed_contexts=False): + for context in contexts: + if not use_passed_contexts: + context = self.store.get_context(context.identifier) + for triple in context: + stream.write( + self._patch_row(triple, context.identifier, op_code).encode( + encoding, "replace" + ) + ) + + if operation: + assert operation in add_remove_methods, f"Invalid operation: {operation}" + elif not target: + # No operation specified and no target specified + # Fall back to default operation of "add" to prevent a no-op + operation = "add" + write_header() + if operation: + operation_code = add_remove_methods.get(operation) + write_triples(self.store.contexts(), operation_code) + elif target: + to_add, to_remove = self._diff(target) + write_triples(to_add.contexts(), "A", use_passed_contexts=True) + write_triples(to_remove.contexts(), "D", use_passed_contexts=True) + + stream.write("TC .\n".encode(encoding, "replace")) + + def _diff(self, target): + rows_to_add = target - self.store + rows_to_remove = self.store - target + return rows_to_add, rows_to_remove + + def _patch_row(self, triple, context_id, operation): + if context_id == self.store.default_context.identifier: + return f"{operation} {_nt_row(triple)}" + else: + return f"{operation} {_nq_row(triple, context_id)}" diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/rdfxml.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/rdfxml.py new file mode 100644 index 0000000000000000000000000000000000000000..baeafe8accecaa83f2857d02ae22f8bd1b7314af --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/rdfxml.py @@ -0,0 +1,395 @@ +from __future__ import annotations + +import xml.dom.minidom +from typing import IO, Any, Dict, Generator, Optional, Set, Tuple +from xml.sax.saxutils import escape, quoteattr + +from rdflib.collection import Collection +from rdflib.graph import Graph +from rdflib.namespace import RDF, RDFS, Namespace # , split_uri +from rdflib.plugins.parsers.RDFVOC import RDFVOC +from rdflib.plugins.serializers.xmlwriter import XMLWriter +from rdflib.serializer import Serializer +from rdflib.term import BNode, IdentifiedNode, Identifier, Literal, Node, URIRef +from rdflib.util import first, more_than + +from .xmlwriter import ESCAPE_ENTITIES + +__all__ = ["fix", "XMLSerializer", "PrettyXMLSerializer"] + + +class XMLSerializer(Serializer): + """RDF/XML RDF graph serializer.""" + + def __init__(self, store: Graph): + super(XMLSerializer, self).__init__(store) + + def __bindings(self) -> Generator[Tuple[str, URIRef], None, None]: + store = self.store + nm = store.namespace_manager + bindings: Dict[str, URIRef] = {} + + for predicate in set(store.predicates()): + # type error: Argument 1 to "compute_qname_strict" of "NamespaceManager" has incompatible type "Node"; expected "str" + prefix, namespace, name = nm.compute_qname_strict(predicate) # type: ignore[arg-type] + bindings[prefix] = URIRef(namespace) + + RDFNS = URIRef("http://www.w3.org/1999/02/22-rdf-syntax-ns#") # noqa: N806 + + if "rdf" in bindings: + assert bindings["rdf"] == RDFNS + else: + bindings["rdf"] = RDFNS + + for prefix, namespace in bindings.items(): + yield prefix, namespace + + def serialize( + self, + stream: IO[bytes], + base: Optional[str] = None, + encoding: Optional[str] = None, + **kwargs: Any, + ) -> None: + # if base is given here, use that, if not and a base is set for the graph use that + if base is not None: + self.base = base + elif self.store.base is not None: + self.base = self.store.base + self.__stream = stream + self.__serialized: Dict[Identifier, int] = {} + encoding = self.encoding + self.write = write = lambda uni: stream.write(uni.encode(encoding, "replace")) + + # startDocument + write('\n' % self.encoding) + + # startRDF + write("\n") + + # write out triples by subject + for subject in self.store.subjects(): + # type error: Argument 1 to "subject" of "XMLSerializer" has incompatible type "Node"; expected "Identifier" + self.subject(subject, 1) # type: ignore[arg-type] + + # endRDF + write("\n") + + # Set to None so that the memory can get garbage collected. + # self.__serialized = None + del self.__serialized + + def subject(self, subject: Identifier, depth: int = 1) -> None: + if subject not in self.__serialized: + self.__serialized[subject] = 1 + + if isinstance(subject, (BNode, URIRef)): + write = self.write + indent = " " * depth + element_name = "rdf:Description" + + if isinstance(subject, BNode): + write('%s<%s rdf:nodeID="%s"' % (indent, element_name, subject)) + else: + uri = quoteattr(self.relativize(subject)) + write("%s<%s rdf:about=%s" % (indent, element_name, uri)) + + if (subject, None, None) in self.store: + write(">\n") + + for predicate, object in self.store.predicate_objects(subject): + # type error: Argument 1 to "predicate" of "XMLSerializer" has incompatible type "Node"; expected "Identifier" + # type error: Argument 2 to "predicate" of "XMLSerializer" has incompatible type "Node"; expected "Identifier" + self.predicate(predicate, object, depth + 1) # type: ignore[arg-type] + write("%s\n" % (indent, element_name)) + + else: + write("/>\n") + + def predicate( + self, predicate: Identifier, object: Identifier, depth: int = 1 + ) -> None: + write = self.write + indent = " " * depth + qname = self.store.namespace_manager.qname_strict(predicate) + + if isinstance(object, Literal): + attributes = "" + + if object.language: + attributes += ' xml:lang="%s"' % object.language + + if object.datatype: + attributes += ' rdf:datatype="%s"' % object.datatype + + write( + "%s<%s%s>%s\n" + % (indent, qname, attributes, escape(object, ESCAPE_ENTITIES), qname) + ) + else: + if isinstance(object, BNode): + write('%s<%s rdf:nodeID="%s"/>\n' % (indent, qname, object)) + else: + write( + "%s<%s rdf:resource=%s/>\n" + % (indent, qname, quoteattr(self.relativize(object))) + ) + + +XMLLANG = "http://www.w3.org/XML/1998/namespacelang" +XMLBASE = "http://www.w3.org/XML/1998/namespacebase" +OWL_NS = Namespace("http://www.w3.org/2002/07/owl#") + + +# TODO: +def fix(val: str) -> str: + "strip off _: from nodeIDs... as they are not valid NCNames" + if val.startswith("_:"): + return val[2:] + else: + return val + + +class PrettyXMLSerializer(Serializer): + """Pretty RDF/XML RDF graph serializer.""" + + def __init__(self, store: Graph, max_depth=3): + super(PrettyXMLSerializer, self).__init__(store) + self.forceRDFAbout: Set[URIRef] = set() + + def serialize( + self, + stream: IO[bytes], + base: Optional[str] = None, + encoding: Optional[str] = None, + **kwargs: Any, + ) -> None: + self.__serialized: Dict[Identifier, int] = {} + store = self.store + # if base is given here, use that, if not and a base is set for the graph use that + if base is not None: + self.base = base + elif store.base is not None: + self.base = store.base + self.max_depth = kwargs.get("max_depth", 3) + assert self.max_depth > 0, "max_depth must be greater than 0" + + self.nm = nm = store.namespace_manager + self.writer = writer = XMLWriter(stream, nm, encoding) + namespaces = {} + + possible: Set[Node] = set(store.predicates()).union( + store.objects(None, RDF.type) + ) + + for predicate in possible: + # type error: Argument 1 to "compute_qname_strict" of "NamespaceManager" has incompatible type "Node"; expected "str" + prefix, namespace, local = nm.compute_qname_strict(predicate) # type: ignore[arg-type] + namespaces[prefix] = namespace + + namespaces["rdf"] = "http://www.w3.org/1999/02/22-rdf-syntax-ns#" + + writer.push(RDFVOC.RDF) + + if "xml_base" in kwargs: + writer.attribute(XMLBASE, kwargs["xml_base"]) + elif self.base: + writer.attribute(XMLBASE, self.base) + + writer.namespaces(namespaces.items()) + + subject: IdentifiedNode + # Write out subjects that can not be inline + # type error: Incompatible types in assignment (expression has type "Node", variable has type "IdentifiedNode") + for subject in store.subjects(): # type: ignore[assignment] + if (None, None, subject) in store: + if (subject, None, subject) in store: + self.subject(subject, 1) + else: + self.subject(subject, 1) + + # write out anything that has not yet been reached + # write out BNodes last (to ensure they can be inlined where possible) + bnodes = set() + + # type error: Incompatible types in assignment (expression has type "Node", variable has type "IdentifiedNode") + for subject in store.subjects(): # type: ignore[assignment] + if isinstance(subject, BNode): + bnodes.add(subject) + continue + self.subject(subject, 1) + + # now serialize only those BNodes that have not been serialized yet + for bnode in bnodes: + if bnode not in self.__serialized: + self.subject(subject, 1) + + writer.pop(RDFVOC.RDF) + stream.write("\n".encode("latin-1")) + + # Set to None so that the memory can get garbage collected. + self.__serialized = None # type: ignore[assignment] + + def subject(self, subject: Identifier, depth: int = 1): + store = self.store + writer = self.writer + + if subject in self.forceRDFAbout: + writer.push(RDFVOC.Description) + writer.attribute(RDFVOC.about, self.relativize(subject)) + writer.pop(RDFVOC.Description) + self.forceRDFAbout.remove(subject) # type: ignore[arg-type] + + elif subject not in self.__serialized: + self.__serialized[subject] = 1 + type = first(store.objects(subject, RDF.type)) + + try: + # type error: Argument 1 to "qname" of "NamespaceManager" has incompatible type "Optional[Node]"; expected "str" + self.nm.qname(type) # type: ignore[arg-type] + except Exception: + type = None + + element = type or RDFVOC.Description + # type error: Argument 1 to "push" of "XMLWriter" has incompatible type "Node"; expected "str" + writer.push(element) # type: ignore[arg-type] + + if isinstance(subject, BNode): + + def subj_as_obj_more_than(ceil): + return True + # more_than(store.triples((None, None, subject)), ceil) + + # here we only include BNode labels if they are referenced + # more than once (this reduces the use of redundant BNode + # identifiers) + if subj_as_obj_more_than(1): + writer.attribute(RDFVOC.nodeID, fix(subject)) + + else: + writer.attribute(RDFVOC.about, self.relativize(subject)) + + if (subject, None, None) in store: + for predicate, object in store.predicate_objects(subject): + if not (predicate == RDF.type and object == type): + # type error: Argument 1 to "predicate" of "PrettyXMLSerializer" has incompatible type "Node"; expected "Identifier" + # type error: Argument 2 to "predicate" of "PrettyXMLSerializer" has incompatible type "Node"; expected "Identifier" + self.predicate(predicate, object, depth + 1) # type: ignore[arg-type] + + # type error: Argument 1 to "pop" of "XMLWriter" has incompatible type "Node"; expected "Optional[str]" + writer.pop(element) # type: ignore[arg-type] + + elif subject in self.forceRDFAbout: + # TODO FIXME?: this looks like a duplicate of first condition + writer.push(RDFVOC.Description) + writer.attribute(RDFVOC.about, self.relativize(subject)) + writer.pop(RDFVOC.Description) + self.forceRDFAbout.remove(subject) # type: ignore[arg-type] + + def predicate( + self, predicate: Identifier, object: Identifier, depth: int = 1 + ) -> None: + writer = self.writer + store = self.store + writer.push(predicate) + + if isinstance(object, Literal): + if object.language: + writer.attribute(XMLLANG, object.language) + + if object.datatype == RDF.XMLLiteral and isinstance( + object.value, xml.dom.minidom.Document + ): + writer.attribute(RDFVOC.parseType, "Literal") + writer.text("") + writer.stream.write(object) + else: + if object.datatype: + writer.attribute(RDFVOC.datatype, object.datatype) + writer.text(object) + + elif ( + object in self.__serialized + or not (object, None, None) in store # noqa: E713 + ): + if isinstance(object, BNode): + if more_than(store.triples((None, None, object)), 0): + writer.attribute(RDFVOC.nodeID, fix(object)) + else: + writer.attribute(RDFVOC.resource, self.relativize(object)) + + else: + if first(store.objects(object, RDF.first)): # may not have type + # RDF.List + + self.__serialized[object] = 1 + + # Warn that any assertions on object other than + # RDF.first and RDF.rest are ignored... including RDF.List + import warnings + + warnings.warn( + "Assertions on %s other than RDF.first " % repr(object) + + "and RDF.rest are ignored ... including RDF.List", + UserWarning, + stacklevel=2, + ) + writer.attribute(RDFVOC.parseType, "Collection") + + col = Collection(store, object) + + for item in col: + if isinstance(item, URIRef): + self.forceRDFAbout.add(item) + # type error: Argument 1 to "subject" of "PrettyXMLSerializer" has incompatible type "Node"; expected "Identifier" + self.subject(item) # type: ignore[arg-type] + + if not isinstance(item, URIRef): + # type error: Invalid index type "Node" for "Dict[Identifier, int]"; expected type "Identifier" + self.__serialized[item] = 1 # type: ignore[index] + else: + if first( + store.triples_choices( + # type error: Argument 1 to "triples_choices" of "Graph" has incompatible type "Tuple[Identifier, URIRef, List[URIRef]]"; expected "Union[Tuple[List[Node], Node, Node], Tuple[Node, List[Node], Node], Tuple[Node, Node, List[Node]]]" + (object, RDF.type, [OWL_NS.Class, RDFS.Class]) # type: ignore[arg-type] + ) + ) and isinstance(object, URIRef): + writer.attribute(RDFVOC.resource, self.relativize(object)) + + elif depth <= self.max_depth: + self.subject(object, depth + 1) + + elif isinstance(object, BNode): + if ( + object not in self.__serialized + and (object, None, None) in store + and len(list(store.subjects(object=object))) == 1 + ): + # inline blank nodes if they haven't been serialized yet + # and are only referenced once (regardless of depth) + self.subject(object, depth + 1) + else: + writer.attribute(RDFVOC.nodeID, fix(object)) + + else: + writer.attribute(RDFVOC.resource, self.relativize(object)) + + writer.pop(predicate) diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/trig.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/trig.py new file mode 100644 index 0000000000000000000000000000000000000000..2c3fe2be1651dcf0933ce87250672d523e37f4d2 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/trig.py @@ -0,0 +1,123 @@ +""" +Trig RDF graph serializer for RDFLib. +See for syntax specification. +""" + +from __future__ import annotations + +from typing import IO, TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union + +from rdflib.graph import ConjunctiveGraph, Graph +from rdflib.plugins.serializers.turtle import TurtleSerializer +from rdflib.term import BNode, Node + +if TYPE_CHECKING: + from rdflib.graph import _ContextType, _SubjectType + +__all__ = ["TrigSerializer"] + + +class TrigSerializer(TurtleSerializer): + """TriG RDF graph serializer.""" + + short_name = "trig" + indentString = 4 * " " + + def __init__(self, store: Union[Graph, ConjunctiveGraph]): + self.default_context: Optional[Node] + if store.context_aware: + if TYPE_CHECKING: + assert isinstance(store, ConjunctiveGraph) + self.contexts = list(store.contexts()) + self.default_context = store.default_context.identifier + if store.default_context: + self.contexts.append(store.default_context) + else: + self.contexts = [store] + self.default_context = None + + super(TrigSerializer, self).__init__(store) + + def preprocess(self) -> None: + for context in self.contexts: + # do not write unnecessary prefix (ex: for an empty default graph) + if len(context) == 0: + continue + self.store = context + # Don't generate a new prefix for a graph URI if one already exists + self.get_pname(context.identifier, False) + self._subjects = {} + + for triple in context: + self.preprocessTriple(triple) + + for subject in self._subjects.keys(): + self._references[subject] += 1 + + self._contexts[context] = (self.orderSubjects(), self._subjects) + + def reset(self) -> None: + super(TrigSerializer, self).reset() + self._contexts: Dict[ + _ContextType, + Tuple[List[_SubjectType], Dict[_SubjectType, bool]], + ] = {} + + def serialize( + self, + stream: IO[bytes], + base: Optional[str] = None, + encoding: Optional[str] = None, + spacious: Optional[bool] = None, + **kwargs: Any, + ) -> None: + self.reset() + self.stream = stream + # if base is given here, use that, if not and a base is set for the graph use that + if base is not None: + self.base = base + elif self.store.base is not None: + self.base = self.store.base + + if spacious is not None: + self._spacious = spacious + + self.preprocess() + + self.startDocument() + + firstTime = True + for store, (ordered_subjects, subjects) in self._contexts.items(): + if not ordered_subjects: + continue + + self._serialized = {} + self.store = store + self._subjects = subjects + + if self.default_context and store.identifier == self.default_context: + self.write(self.indent() + "\n{") + else: + iri: Optional[str] + if isinstance(store.identifier, BNode): + iri = store.identifier.n3() + else: + # Show the full graph URI if a prefix for it doesn't already exist + iri = self.get_pname(store.identifier, False) + if iri is None: + iri = store.identifier.n3() + self.write(self.indent() + "\n%s {" % iri) + + self.depth += 1 + for subject in ordered_subjects: + if self.isDone(subject): + continue + if firstTime: + firstTime = False + if self.statement(subject) and not firstTime: + self.write("\n") + self.depth -= 1 + self.write("}\n") + + self.endDocument() + stream.write("\n".encode("latin-1")) diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/trix.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/trix.py new file mode 100644 index 0000000000000000000000000000000000000000..430b7e97f36e2dcf3764eff2600564a6499e718d --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/trix.py @@ -0,0 +1,93 @@ +from __future__ import annotations + +from typing import IO, Any, Optional + +from rdflib.graph import ConjunctiveGraph, Graph +from rdflib.namespace import Namespace +from rdflib.plugins.serializers.xmlwriter import XMLWriter +from rdflib.serializer import Serializer +from rdflib.term import BNode, Literal, URIRef + +__all__ = ["TriXSerializer"] + +# TODO: Move this somewhere central +TRIXNS = Namespace("http://www.w3.org/2004/03/trix/trix-1/") +XMLNS = Namespace("http://www.w3.org/XML/1998/namespace") + + +class TriXSerializer(Serializer): + """TriX RDF graph serializer.""" + + def __init__(self, store: Graph): + super(TriXSerializer, self).__init__(store) + if not store.context_aware: + raise Exception( + "TriX serialization only makes sense for context-aware stores" + ) + + def serialize( + self, + stream: IO[bytes], + base: Optional[str] = None, + encoding: Optional[str] = None, + **kwargs: Any, + ) -> None: + nm = self.store.namespace_manager + + self.writer = XMLWriter(stream, nm, encoding, extra_ns={"": TRIXNS}) + + self.writer.push(TRIXNS["TriX"]) + # if base is given here, use that, if not and a base is set for the graph use that + if base is None and self.store.base is not None: + base = self.store.base + if base is not None: + self.writer.attribute("http://www.w3.org/XML/1998/namespacebase", base) + self.writer.namespaces() + + if isinstance(self.store, ConjunctiveGraph): + for subgraph in self.store.contexts(): + self._writeGraph(subgraph) + elif isinstance(self.store, Graph): + self._writeGraph(self.store) + else: + raise Exception(f"Unknown graph type: {type(self.store)}") + + self.writer.pop() + stream.write("\n".encode("latin-1")) + + def _writeGraph(self, graph): # noqa: N802 + self.writer.push(TRIXNS["graph"]) + if graph.base: + self.writer.attribute( + "http://www.w3.org/XML/1998/namespacebase", graph.base + ) + if isinstance(graph.identifier, URIRef): + self.writer.element(TRIXNS["uri"], content=str(graph.identifier)) + + for triple in graph.triples((None, None, None)): + self._writeTriple(triple) + self.writer.pop() + + def _writeTriple(self, triple): # noqa: N802 + self.writer.push(TRIXNS["triple"]) + for component in triple: + if isinstance(component, URIRef): + self.writer.element(TRIXNS["uri"], content=str(component)) + elif isinstance(component, BNode): + self.writer.element(TRIXNS["id"], content=str(component)) + elif isinstance(component, Literal): + if component.datatype: + self.writer.element( + TRIXNS["typedLiteral"], + content=str(component), + attributes={TRIXNS["datatype"]: str(component.datatype)}, + ) + elif component.language: + self.writer.element( + TRIXNS["plainLiteral"], + content=str(component), + attributes={XMLNS["lang"]: str(component.language)}, + ) + else: + self.writer.element(TRIXNS["plainLiteral"], content=str(component)) + self.writer.pop() diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/turtle.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/turtle.py new file mode 100644 index 0000000000000000000000000000000000000000..5a76992fb957afccd1f2d4b8805f6574f8558e60 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/turtle.py @@ -0,0 +1,508 @@ +""" +Turtle RDF graph serializer for RDFLib. +See for syntax specification. +""" + +from __future__ import annotations + +import re +import warnings +from collections import defaultdict +from typing import ( + IO, + TYPE_CHECKING, + Any, + DefaultDict, + Dict, + List, + Mapping, + Optional, + Sequence, + Tuple, + TypeVar, + Union, +) + +from rdflib.exceptions import Error +from rdflib.graph import Graph +from rdflib.namespace import RDF, RDFS +from rdflib.serializer import Serializer +from rdflib.term import BNode, Literal, Node, URIRef + +_StrT = TypeVar("_StrT", bound=str) + +if TYPE_CHECKING: + from rdflib.graph import _PredicateType, _SubjectType, _TripleType + +__all__ = ["RecursiveSerializer", "TurtleSerializer"] + + +class RecursiveSerializer(Serializer): + """Base class for recursive serializers.""" + + topClasses = [RDFS.Class] + predicateOrder = [RDF.type, RDFS.label] + maxDepth = 10 + indentString = " " + roundtrip_prefixes: Tuple[Any, ...] = () + LOCALNAME_PECRENT_CHARACTER_REQUIRING_ESCAPE_REGEX = re.compile( + r"%(?![0-9A-Fa-f]{2})" + ) + + def __init__(self, store: Graph): + super(RecursiveSerializer, self).__init__(store) + self.stream: Optional[IO[bytes]] = None + self.reset() + + def addNamespace(self, prefix: str, uri: URIRef) -> None: + if prefix in self.namespaces and self.namespaces[prefix] != uri: + raise Exception( + "Trying to override namespace prefix %s => %s, but it's already bound to %s" + % (prefix, uri, self.namespaces[prefix]) + ) + self.namespaces[prefix] = uri + + def checkSubject(self, subject: _SubjectType) -> bool: + """Check to see if the subject should be serialized yet""" + if ( + (self.isDone(subject)) + or (subject not in self._subjects) + or ((subject in self._topLevels) and (self.depth > 1)) + or (isinstance(subject, URIRef) and (self.depth >= self.maxDepth)) + ): + return False + return True + + def isDone(self, subject: _SubjectType) -> bool: + """Return true if subject is serialized""" + return subject in self._serialized + + def orderSubjects(self) -> List[_SubjectType]: + seen: Dict[_SubjectType, bool] = {} + subjects: List[_SubjectType] = [] + + for classURI in self.topClasses: + members = list(self.store.subjects(RDF.type, classURI)) + # type error: All overload variants of "sort" of "list" require at least one argument + members.sort() # type: ignore[call-overload] + + subjects.extend(members) + for member in members: + self._topLevels[member] = True + seen[member] = True + + recursable = [ + (isinstance(subject, BNode), self._references[subject], subject) + for subject in self._subjects + if subject not in seen + ] + + recursable.sort() + subjects.extend([subject for (isbnode, refs, subject) in recursable]) + + return subjects + + def preprocess(self) -> None: + for triple in self.store.triples((None, None, None)): + self.preprocessTriple(triple) + + def preprocessTriple(self, spo: _TripleType) -> None: + s, p, o = spo + self._references[o] += 1 + self._subjects[s] = True + + def reset(self) -> None: + self.depth = 0 + # Typed none because nothing is using it ... + self.lists: Dict[None, None] = {} + self.namespaces: Dict[str, URIRef] = {} + self._references: DefaultDict[Node, int] = defaultdict(int) + self._serialized: Dict[_SubjectType, bool] = {} + self._subjects: Dict[_SubjectType, bool] = {} + self._topLevels: Dict[_SubjectType, bool] = {} + + if self.roundtrip_prefixes: + if hasattr(self.roundtrip_prefixes, "__iter__"): + for prefix, ns in self.store.namespaces(): + if prefix in self.roundtrip_prefixes: + self.addNamespace(prefix, ns) + else: + for prefix, ns in self.store.namespaces(): + self.addNamespace(prefix, ns) + + def buildPredicateHash( + self, subject: _SubjectType + ) -> Mapping[_PredicateType, List[Node]]: + """ + Build a hash key by predicate to a list of objects for the given + subject + """ + properties: Dict[_PredicateType, List[Node]] = {} + for s, p, o in self.store.triples((subject, None, None)): + oList = properties.get(p, []) + oList.append(o) + properties[p] = oList + return properties + + def sortProperties( + self, properties: Mapping[_PredicateType, List[Node]] + ) -> List[_PredicateType]: + """Take a hash from predicate uris to lists of values. + Sort the lists of values. Return a sorted list of properties.""" + # Sort object lists + for prop, objects in properties.items(): + # type error: All overload variants of "sort" of "list" require at least one argument + objects.sort() # type: ignore[call-overload] + + # Make sorted list of properties + propList: List[_PredicateType] = [] + seen: Dict[_PredicateType, bool] = {} + for prop in self.predicateOrder: + if (prop in properties) and (prop not in seen): + propList.append(prop) + seen[prop] = True + props = list(properties.keys()) + # type error: All overload variants of "sort" of "list" require at least one argument + props.sort() # type: ignore[call-overload] + for prop in props: + if prop not in seen: + propList.append(prop) + seen[prop] = True + return propList + + def subjectDone(self, subject: _SubjectType) -> None: + """Mark a subject as done.""" + self._serialized[subject] = True + + def indent(self, modifier: int = 0) -> str: + """Returns indent string multiplied by the depth""" + return (self.depth + modifier) * self.indentString + + def write(self, text: str) -> None: + """Write text in given encoding.""" + # type error: Item "None" of "Optional[IO[bytes]]" has no attribute "write" + self.stream.write(text.encode(self.encoding, "replace")) # type: ignore[union-attr] + + def relativize(self, uri: _StrT) -> Union[_StrT, URIRef]: + base = self.base + if ( + base is not None + and uri.startswith(base) + and "#" not in uri.replace(base, "") + and "/" not in uri.replace(base, "") + ): + # type error: Incompatible types in assignment (expression has type "str", variable has type "Node") + uri = URIRef(uri.replace(base, "", 1)) # type: ignore[assignment] + return uri + + +SUBJECT = 0 +VERB = 1 +OBJECT = 2 + +_GEN_QNAME_FOR_DT = False +_SPACIOUS_OUTPUT = False + + +class TurtleSerializer(RecursiveSerializer): + """Turtle RDF graph serializer.""" + + short_name = "turtle" + indentString = " " + LOCALNAME_PECRENT_CHARACTER_REQUIRING_ESCAPE_REGEX = re.compile( + r"%(?![0-9A-Fa-f]{2})" + ) + + def __init__(self, store: Graph): + self._ns_rewrite: Dict[str, str] = {} + super(TurtleSerializer, self).__init__(store) + self.keywords: Dict[Node, str] = {RDF.type: "a"} + self.reset() + self.stream = None + self._spacious = _SPACIOUS_OUTPUT + + # type error: Return type "str" of "addNamespace" incompatible with return type "None" in supertype "RecursiveSerializer" + def addNamespace(self, prefix: str, namespace: URIRef) -> str: # type: ignore[override] + # Turtle does not support prefix that start with _ + # if they occur in the graph, rewrite to p_blah + # this is more complicated since we need to make sure p_blah + # does not already exist. And we register namespaces as we go, i.e. + # we may first see a triple with prefix _9 - rewrite it to p_9 + # and then later find a triple with a "real" p_9 prefix + + # so we need to keep track of ns rewrites we made so far. + + if (prefix > "" and prefix[0] == "_") or self.namespaces.get( + prefix, namespace + ) != namespace: + if prefix not in self._ns_rewrite: + p = "p" + prefix + while p in self.namespaces: + p = "p" + p + self._ns_rewrite[prefix] = p + + prefix = self._ns_rewrite.get(prefix, prefix) + + super(TurtleSerializer, self).addNamespace(prefix, namespace) + return prefix + + def reset(self) -> None: + super(TurtleSerializer, self).reset() + # typing as Dict[None, None] because nothing seems to be using it + self._shortNames: Dict[None, None] = {} + self._started = False + self._ns_rewrite = {} + + def serialize( + self, + stream: IO[bytes], + base: Optional[str] = None, + encoding: Optional[str] = None, + spacious: Optional[bool] = None, + **kwargs: Any, + ) -> None: + self.reset() + self.stream = stream + # if base is given here, use that, if not and a base is set for the graph use that + if base is not None: + self.base = base + elif self.store.base is not None: + self.base = self.store.base + + if spacious is not None: + self._spacious = spacious + + self.preprocess() + subjects_list = self.orderSubjects() + + self.startDocument() + + firstTime = True + for subject in subjects_list: + if self.isDone(subject): + continue + if firstTime: + firstTime = False + if self.statement(subject) and not firstTime: + self.write("\n") + + self.endDocument() + stream.write("\n".encode("latin-1")) + + self.base = None + + def preprocessTriple(self, triple: _TripleType) -> None: + super(TurtleSerializer, self).preprocessTriple(triple) + for i, node in enumerate(triple): + if i == VERB: + if node in self.keywords: + # predicate is a keyword + continue + if ( + self.base is not None + and isinstance(node, URIRef) + and node.startswith(self.base) + and "#" not in node.replace(self.base, "") + and "/" not in node.replace(self.base, "") + ): + # predicate corresponds to base namespace + continue + # Don't use generated prefixes for subjects and objects + self.get_pname(node, gen_prefix=(i == VERB)) + if isinstance(node, Literal) and node.datatype: + self.get_pname(node.datatype, gen_prefix=_GEN_QNAME_FOR_DT) + p = triple[1] + if isinstance(p, BNode): # hmm - when is P ever a bnode? + self._references[p] += 1 + + # Refer to Productions for terminals PNAME_NS and PNAME_LN https://www.w3.org/TR/turtle/#sec-grammar-grammar + def get_pname(self, uri: Node, gen_prefix: bool = True) -> Optional[str]: + if not isinstance(uri, URIRef): + return None + + parts = None + + try: + parts = self.store.compute_qname(uri, generate=gen_prefix) + except Exception: + # is the uri a namespace in itself? + pfx = self.store.store.prefix(uri) + + if pfx is not None: + parts = (pfx, uri, "") + else: + # nothing worked + return None + + prefix, namespace, local = parts + + # To understand treatment of % character refer to Productions for terminal PLX at + # https://www.w3.org/TR/turtle/#grammar-production-PLX + # Only % NOT followed by two hex chars requires manual backslash escaping + local = local.replace(r"(", r"\(").replace(r")", r"\)") + local = self.LOCALNAME_PECRENT_CHARACTER_REQUIRING_ESCAPE_REGEX.sub( + "\\%", local + ) + + # PName cannot end with . + if local.endswith("."): + return None + + prefix = self.addNamespace(prefix, namespace) + + return "%s:%s" % (prefix, local) + + def getQName(self, uri: Node, gen_prefix: bool = True) -> Optional[str]: + warnings.warn( + "TurtleSerializer.getQName is deprecated, use TurtleSerializer.get_pname instead.", + DeprecationWarning, + stacklevel=2, + ) + return self.get_pname(uri, gen_prefix) + + def startDocument(self) -> None: + self._started = True + ns_list = sorted(self.namespaces.items()) + + if self.base: + self.write(self.indent() + "@base <%s> .\n" % self.base) + for prefix, uri in ns_list: + self.write(self.indent() + "@prefix %s: <%s> .\n" % (prefix, uri)) + if ns_list and self._spacious: + self.write("\n") + + def endDocument(self) -> None: + if self._spacious: + self.write("\n") + + def statement(self, subject: _SubjectType) -> bool: + self.subjectDone(subject) + return self.s_squared(subject) or self.s_default(subject) + + def s_default(self, subject: _SubjectType) -> bool: + self.write("\n" + self.indent()) + self.path(subject, SUBJECT) + self.predicateList(subject) + self.write(" .") + return True + + def s_squared(self, subject: _SubjectType) -> bool: + if (self._references[subject] > 0) or not isinstance(subject, BNode): + return False + self.write("\n" + self.indent() + "[]") + self.predicateList(subject) + self.write(" .") + return True + + def path(self, node: Node, position: int, newline: bool = False) -> None: + if not ( + self.p_squared(node, position, newline) + or self.p_default(node, position, newline) + ): + raise Error("Cannot serialize node '%s'" % (node,)) + + def p_default(self, node: Node, position: int, newline: bool = False) -> bool: + if position != SUBJECT and not newline: + self.write(" ") + self.write(self.label(node, position)) + return True + + def label(self, node: Node, position: int) -> str: + if node == RDF.nil: + return "()" + if position is VERB and node in self.keywords: + return self.keywords[node] + if isinstance(node, Literal): + return node._literal_n3( + use_plain=True, + qname_callback=lambda dt: self.get_pname(dt, _GEN_QNAME_FOR_DT), + ) + else: + node = self.relativize(node) # type: ignore[type-var] + + return self.get_pname(node, position == VERB) or node.n3() + + def p_squared(self, node: Node, position: int, newline: bool = False) -> bool: + if ( + not isinstance(node, BNode) + or node in self._serialized + or self._references[node] > 1 + or position == SUBJECT + ): + return False + + if not newline: + self.write(" ") + + if self.isValidList(node): + # this is a list + self.write("(") + self.depth += 1 # 2 + self.doList(node) + self.depth -= 1 # 2 + self.write(" )") + else: + self.subjectDone(node) + self.depth += 2 + # self.write('[\n' + self.indent()) + self.write("[") + self.depth -= 1 + # self.predicateList(node, newline=True) + self.predicateList(node, newline=False) + # self.write('\n' + self.indent() + ']') + self.write(" ]") + self.depth -= 1 + + return True + + def isValidList(self, l_: Node) -> bool: + """ + Checks if l is a valid RDF list, i.e. no nodes have other properties. + """ + try: + if self.store.value(l_, RDF.first) is None: + return False + except Exception: + return False + while l_: + if l_ != RDF.nil and len(list(self.store.predicate_objects(l_))) != 2: + return False + # type error: Incompatible types in assignment (expression has type "Optional[Node]", variable has type "Node") + l_ = self.store.value(l_, RDF.rest) # type: ignore[assignment] + return True + + def doList(self, l_: Node) -> None: + while l_: + item = self.store.value(l_, RDF.first) + if item is not None: + self.path(item, OBJECT) + self.subjectDone(l_) + # type error: Incompatible types in assignment (expression has type "Optional[Node]", variable has type "Node") + l_ = self.store.value(l_, RDF.rest) # type: ignore[assignment] + + def predicateList(self, subject: Node, newline: bool = False) -> None: + properties = self.buildPredicateHash(subject) + propList = self.sortProperties(properties) + if len(propList) == 0: + return + self.verb(propList[0], newline=newline) + self.objectList(properties[propList[0]]) + for predicate in propList[1:]: + self.write(" ;\n" + self.indent(1)) + self.verb(predicate, newline=True) + self.objectList(properties[predicate]) + + def verb(self, node: Node, newline: bool = False) -> None: + self.path(node, VERB, newline) + + def objectList(self, objects: Sequence[Node]) -> None: + count = len(objects) + if count == 0: + return + depthmod = (count == 1) and 0 or 1 + self.depth += depthmod + self.path(objects[0], OBJECT) + for obj in objects[1:]: + self.write(",\n" + self.indent(1)) + self.path(obj, OBJECT, newline=True) + self.depth -= depthmod diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/xmlwriter.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/xmlwriter.py new file mode 100644 index 0000000000000000000000000000000000000000..78cf0193e5cd53f613a607f0a385e02d1daa8445 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/serializers/xmlwriter.py @@ -0,0 +1,130 @@ +from __future__ import annotations + +import codecs +from typing import IO, TYPE_CHECKING, Dict, Iterable, List, Optional, Tuple +from xml.sax.saxutils import escape, quoteattr + +from rdflib.term import URIRef + +if TYPE_CHECKING: + from rdflib.namespace import Namespace, NamespaceManager + + +__all__ = ["XMLWriter"] + +ESCAPE_ENTITIES = {"\r": " "} + + +class XMLWriter: + """A simple XML writer that writes to a stream.""" + + def __init__( + self, + stream: IO[bytes], + namespace_manager: NamespaceManager, + encoding: Optional[str] = None, + decl: int = 1, + extra_ns: Optional[Dict[str, Namespace]] = None, + ): + encoding = encoding or "utf-8" + encoder, decoder, stream_reader, stream_writer = codecs.lookup(encoding) + # NOTE on type ignores: this is mainly because the variable is being re-used. + # type error: Incompatible types in assignment (expression has type "StreamWriter", variable has type "IO[bytes]") + self.stream = stream = stream_writer(stream) # type: ignore[assignment] + if decl: + # type error: No overload variant of "write" of "IO" matches argument type "str" + stream.write('' % encoding) # type: ignore[call-overload] + self.element_stack: List[str] = [] + self.nm = namespace_manager + self.extra_ns = extra_ns or {} + self.closed = True + + def __get_indent(self) -> str: + return " " * len(self.element_stack) + + indent = property(__get_indent) + + def __close_start_tag(self) -> None: + if not self.closed: # TODO: + self.closed = True + self.stream.write(">") + + def push(self, uri: str) -> None: + self.__close_start_tag() + write = self.stream.write + write("\n") + write(self.indent) + write("<%s" % self.qname(uri)) + self.element_stack.append(uri) + self.closed = False + self.parent = False + + def pop(self, uri: Optional[str] = None) -> None: + top = self.element_stack.pop() + if uri: + assert uri == top + write = self.stream.write + if not self.closed: + self.closed = True + write("/>") + else: + if self.parent: + write("\n") + write(self.indent) + write("" % self.qname(top)) + self.parent = True + + def element( + self, uri: str, content: str, attributes: Dict[URIRef, str] = {} + ) -> None: + """Utility method for adding a complete simple element""" + self.push(uri) + for k, v in attributes.items(): + self.attribute(k, v) + self.text(content) + self.pop() + + def namespaces(self, namespaces: Iterable[Tuple[str, str]] = None) -> None: + if not namespaces: + namespaces = self.nm.namespaces() + + write = self.stream.write + write("\n") + for prefix, namespace in namespaces: + if prefix: + write(' xmlns:%s="%s"\n' % (prefix, namespace)) + # Allow user-provided namespace bindings to prevail + elif prefix not in self.extra_ns: + write(' xmlns="%s"\n' % namespace) + + for prefix, namespace in self.extra_ns.items(): + if prefix: + write(' xmlns:%s="%s"\n' % (prefix, namespace)) + else: + write(' xmlns="%s"\n' % namespace) + + def attribute(self, uri: str, value: str) -> None: + write = self.stream.write + write(" %s=%s" % (self.qname(uri), quoteattr(value))) + + def text(self, text: str) -> None: + self.__close_start_tag() + if "<" in text and ">" in text and "]]>" not in text: + self.stream.write("") + else: + self.stream.write(escape(text, ESCAPE_ENTITIES)) + + def qname(self, uri: str) -> str: + """Compute qname for a uri using our extra namespaces, + or the given namespace manager""" + + for pre, ns in self.extra_ns.items(): + if uri.startswith(ns): + if pre != "": + return ":".join([pre, uri[len(ns) :]]) + else: + return uri[len(ns) :] + + return self.nm.qname_strict(uri) diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/shared/__init__.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/shared/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/shared/__pycache__/__init__.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/shared/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..33ea4b41042bbb23426731792898ad037363f55a Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/shared/__pycache__/__init__.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/shared/jsonld/__init__.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/shared/jsonld/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/shared/jsonld/__pycache__/__init__.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/shared/jsonld/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2a87fb28d37a9bccbc420a3ae4e79b46cfed4173 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/shared/jsonld/__pycache__/__init__.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/shared/jsonld/__pycache__/context.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/shared/jsonld/__pycache__/context.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7faec4b8f299f6b72aaeab1e3d8bc2cadced7574 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/shared/jsonld/__pycache__/context.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/shared/jsonld/__pycache__/errors.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/shared/jsonld/__pycache__/errors.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..067d988dbf029aa491f0c29bff46e6a2c760fc4a Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/shared/jsonld/__pycache__/errors.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/shared/jsonld/__pycache__/keys.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/shared/jsonld/__pycache__/keys.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0ad5729c564a813a2d9e25690afcb0f57306431a Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/shared/jsonld/__pycache__/keys.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/shared/jsonld/__pycache__/util.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/shared/jsonld/__pycache__/util.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bb0459e17feb2132afea0dc5871ecb5ce26ef2d3 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/shared/jsonld/__pycache__/util.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/shared/jsonld/context.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/shared/jsonld/context.py new file mode 100644 index 0000000000000000000000000000000000000000..86af71ade31c15344554dab3f16813864b921933 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/shared/jsonld/context.py @@ -0,0 +1,674 @@ +""" +Implementation of the JSON-LD Context structure. See: http://json-ld.org/ +""" + +# https://github.com/RDFLib/rdflib-jsonld/blob/feature/json-ld-1.1/rdflib_jsonld/context.py +from __future__ import annotations + +from collections import namedtuple +from typing import ( + TYPE_CHECKING, + Any, + Collection, + Dict, + Generator, + List, + Optional, + Set, + Tuple, + Union, +) +from urllib.parse import urljoin, urlsplit + +from rdflib.namespace import RDF + +from .errors import ( + INVALID_CONTEXT_ENTRY, + INVALID_REMOTE_CONTEXT, + RECURSIVE_CONTEXT_INCLUSION, +) +from .keys import ( + BASE, + CONTAINER, + CONTEXT, + GRAPH, + ID, + IMPORT, + INCLUDED, + INDEX, + JSON, + LANG, + LIST, + NEST, + NONE, + PREFIX, + PROPAGATE, + PROTECTED, + REV, + SET, + TYPE, + VALUE, + VERSION, + VOCAB, +) +from .util import norm_url, source_to_json, split_iri + +NODE_KEYS = {GRAPH, ID, INCLUDED, JSON, LIST, NEST, NONE, REV, SET, TYPE, VALUE, LANG} + + +class Defined(int): + pass + + +UNDEF = Defined(0) + +# From +URI_GEN_DELIMS = (":", "/", "?", "#", "[", "]", "@") + +_ContextSourceType = Union[ + List[Union[Dict[str, Any], str, None]], Dict[str, Any], str, None +] + + +class Context: + def __init__( + self, + source: _ContextSourceType = None, + base: Optional[str] = None, + version: Optional[float] = 1.1, + ): + self.version: float = version or 1.1 + self.language = None + self.vocab: Optional[str] = None + self._base: Optional[str] + self.base = base + self.doc_base = base + self.terms: Dict[str, Any] = {} + # _alias maps NODE_KEY to list of aliases + self._alias: Dict[str, List[str]] = {} + self._lookup: Dict[Tuple[str, Any, Union[Defined, str], bool], Term] = {} + self._prefixes: Dict[str, Any] = {} + self.active = False + self.parent: Optional[Context] = None + self.propagate = True + self._context_cache: Dict[str, Any] = {} + if source: + self.load(source) + + @property + def base(self) -> Optional[str]: + return self._base + + @base.setter + def base(self, base: Optional[str]): + if base: + hash_index = base.find("#") + if hash_index > -1: + base = base[0:hash_index] + self._base = ( + self.resolve_iri(base) + if (hasattr(self, "_base") and base is not None) + else base + ) + self._basedomain = "%s://%s" % urlsplit(base)[0:2] if base else None + + def subcontext(self, source: Any, propagate: bool = True) -> Context: + # IMPROVE: to optimize, implement SubContext with parent fallback support + parent = self.parent if self.propagate is False else self + # type error: Item "None" of "Optional[Context]" has no attribute "_subcontext" + return parent._subcontext(source, propagate) # type: ignore[union-attr] + + def _subcontext(self, source: Any, propagate: bool) -> Context: + ctx = Context(version=self.version) + ctx.propagate = propagate + ctx.parent = self + ctx.language = self.language + ctx.vocab = self.vocab + ctx.base = self.base + ctx.doc_base = self.doc_base + ctx._alias = {k: l[:] for k, l in self._alias.items()} # noqa: E741 + ctx.terms = self.terms.copy() + ctx._lookup = self._lookup.copy() + ctx._prefixes = self._prefixes.copy() + ctx._context_cache = self._context_cache + ctx.load(source) + return ctx + + def _clear(self) -> None: + self.language = None + self.vocab = None + self.terms = {} + self._alias = {} + self._lookup = {} + self._prefixes = {} + self.active = False + self.propagate = True + + def get_context_for_term(self, term: Optional[Term]) -> Context: + if term and term.context is not UNDEF: + return self._subcontext(term.context, propagate=True) + return self + + def get_context_for_type(self, node: Any) -> Optional[Context]: + if self.version >= 1.1: + rtype = self.get_type(node) if isinstance(node, dict) else None + if not isinstance(rtype, list): + rtype = [rtype] if rtype else [] + + typeterm = None + for rt in rtype: + try: + typeterm = self.terms.get(rt) + except TypeError: + # extra lenience, triggers if type is set to a literal + pass + if typeterm is not None: + break + + if typeterm and typeterm.context: + subcontext = self.subcontext(typeterm.context, propagate=False) + if subcontext: + return subcontext + + return self.parent if self.propagate is False else self + + def get_id(self, obj: Dict[str, Any]) -> Any: + return self._get(obj, ID) + + def get_type(self, obj: Dict[str, Any]) -> Any: + return self._get(obj, TYPE) + + def get_language(self, obj: Dict[str, Any]) -> Any: + return self._get(obj, LANG) + + def get_value(self, obj: Dict[str, Any]) -> Any: + return self._get(obj, VALUE) + + def get_graph(self, obj: Dict[str, Any]) -> Any: + return self._get(obj, GRAPH) + + def get_list(self, obj: Dict[str, Any]) -> Any: + return self._get(obj, LIST) + + def get_set(self, obj: Dict[str, Any]) -> Any: + return self._get(obj, SET) + + def get_rev(self, obj: Dict[str, Any]) -> Any: + return self._get(obj, REV) + + def _get(self, obj: Dict[str, Any], key: str) -> Any: + for alias in self._alias.get(key, []): + if alias in obj: + return obj.get(alias) + return obj.get(key) + + # type error: Missing return statement + def get_key(self, key: str) -> str: # type: ignore[return] + for alias in self.get_keys(key): + return alias + + def get_keys(self, key: str) -> Generator[str, None, None]: + if key in self._alias: + for alias in self._alias[key]: + yield alias + yield key + + lang_key = property(lambda self: self.get_key(LANG)) + id_key = property(lambda self: self.get_key(ID)) + type_key = property(lambda self: self.get_key(TYPE)) + value_key = property(lambda self: self.get_key(VALUE)) + list_key = property(lambda self: self.get_key(LIST)) + rev_key = property(lambda self: self.get_key(REV)) + graph_key = property(lambda self: self.get_key(GRAPH)) + + def add_term( + self, + name: str, + idref: str, + coercion: Union[Defined, str] = UNDEF, + container: Union[Collection[Any], str, Defined] = UNDEF, + index: Optional[Union[str, Defined]] = None, + language: Optional[Union[str, Defined]] = UNDEF, + reverse: bool = False, + context: Any = UNDEF, + prefix: Optional[bool] = None, + protected: bool = False, + ): + if self.version < 1.1 or prefix is None: + prefix = isinstance(idref, str) and idref.endswith(URI_GEN_DELIMS) + + if not self._accept_term(name): + return + + if self.version >= 1.1: + existing = self.terms.get(name) + if existing and existing.protected: + return + + if isinstance(container, (list, set, tuple)): + container = set(container) + elif container is not UNDEF: + container = set([container]) + else: + container = set() + + term = Term( + idref, + name, + coercion, + container, + index, + language, + reverse, + context, + prefix, + protected, + ) + + self.terms[name] = term + + container_key: Union[Defined, str] + for container_key in (LIST, LANG, SET): # , INDEX, ID, GRAPH): + if container_key in container: + break + else: + container_key = UNDEF + + self._lookup[(idref, coercion or language, container_key, reverse)] = term + + if term.prefix is True: + self._prefixes[idref] = name + + def find_term( + self, + idref: str, + coercion: Optional[Union[str, Defined]] = None, + container: Union[Defined, str] = UNDEF, + language: Optional[str] = None, + reverse: bool = False, + ): + lu = self._lookup + + if coercion is None: + coercion = language + + if coercion is not UNDEF and container: + found = lu.get((idref, coercion, container, reverse)) + if found: + return found + + if coercion is not UNDEF: + found = lu.get((idref, coercion, UNDEF, reverse)) + if found: + return found + + if container: + found = lu.get((idref, coercion, container, reverse)) + if found: + return found + elif language: + found = lu.get((idref, UNDEF, LANG, reverse)) + if found: + return found + else: + found = lu.get((idref, coercion or UNDEF, SET, reverse)) + if found: + return found + + return lu.get((idref, UNDEF, UNDEF, reverse)) + + def resolve(self, curie_or_iri: str) -> str: + iri = self.expand(curie_or_iri, False) + # type error: Argument 1 to "isblank" of "Context" has incompatible type "Optional[str]"; expected "str" + if self.isblank(iri): # type: ignore[arg-type] + # type error: Incompatible return value type (got "Optional[str]", expected "str") + return iri # type: ignore[return-value] + # type error: Unsupported right operand type for in ("Optional[str]") + if " " in iri: # type: ignore[operator] + return "" + # type error: Argument 1 to "resolve_iri" of "Context" has incompatible type "Optional[str]"; expected "str" + return self.resolve_iri(iri) # type: ignore[arg-type] + + def resolve_iri(self, iri: str) -> str: + # type error: Argument 1 to "norm_url" has incompatible type "Optional[str]"; expected "str" + return norm_url(self._base, iri) # type: ignore[arg-type] + + def isblank(self, ref: str) -> bool: + return ref.startswith("_:") + + def expand(self, term_curie_or_iri: Any, use_vocab: bool = True) -> Optional[str]: + if not isinstance(term_curie_or_iri, str): + return term_curie_or_iri + + if not self._accept_term(term_curie_or_iri): + return "" + + if use_vocab: + term = self.terms.get(term_curie_or_iri) + if term: + return term.id + + is_term, pfx, local = self._prep_expand(term_curie_or_iri) + if pfx == "_": + return term_curie_or_iri + + if pfx is not None: + ns = self.terms.get(pfx) + if ns and ns.prefix and ns.id: + return ns.id + local + elif is_term and use_vocab: + if self.vocab: + return self.vocab + term_curie_or_iri + return None + + return self.resolve_iri(term_curie_or_iri) + + def shrink_iri(self, iri: str) -> str: + ns, name = split_iri(str(iri)) + pfx = self._prefixes.get(ns) + if pfx: + # type error: Argument 1 to "join" of "str" has incompatible type "Tuple[Any, Optional[str]]"; expected "Iterable[str]" + return ":".join((pfx, name)) # type: ignore[arg-type] + elif self._base: + if str(iri) == self._base: + return "" + # type error: Argument 1 to "startswith" of "str" has incompatible type "Optional[str]"; expected "Union[str, Tuple[str, ...]]" + elif iri.startswith(self._basedomain): # type: ignore[arg-type] + # type error: Argument 1 to "len" has incompatible type "Optional[str]"; expected "Sized" + return iri[len(self._basedomain) :] # type: ignore[arg-type] + return iri + + def to_symbol(self, iri: str) -> Optional[str]: + iri = str(iri) + term = self.find_term(iri) + if term: + return term.name + ns, name = split_iri(iri) + if ns == self.vocab: + return name + pfx = self._prefixes.get(ns) + if pfx: + # type error: Argument 1 to "join" of "str" has incompatible type "Tuple[Any, Optional[str]]"; expected "Iterable[str]" + return ":".join((pfx, name)) # type: ignore[arg-type] + return iri + + def load( + self, + source: _ContextSourceType, + base: Optional[str] = None, + referenced_contexts: Set[Any] = None, + ): + self.active = True + sources: List[Tuple[Optional[str], Union[Dict[str, Any], str, None]]] = [] + # "Union[List[Union[Dict[str, Any], str]], List[Dict[str, Any]], List[str]]" : expression + # "Union[List[Dict[str, Any]], Dict[str, Any], List[str], str]" : variable + source = source if isinstance(source, list) else [source] + referenced_contexts = referenced_contexts or set() + self._prep_sources(base, source, sources, referenced_contexts) + for source_url, source in sources: + if source is None: + self._clear() + else: + # type error: Argument 1 to "_read_source" of "Context" has incompatible type "Union[Dict[str, Any], str]"; expected "Dict[str, Any]" + self._read_source(source, source_url, referenced_contexts) # type: ignore[arg-type] + + def _accept_term(self, key: str) -> bool: + if self.version < 1.1: + return True + if key and len(key) > 1 and key[0] == "@" and key[1].isalnum(): + return key in NODE_KEYS + else: + return True + + def _prep_sources( + self, + base: Optional[str], + inputs: Union[List[Union[Dict[str, Any], str, None]], List[str]], + sources: List[Tuple[Optional[str], Union[Dict[str, Any], str, None]]], + referenced_contexts: Set[str], + in_source_url: Optional[str] = None, + ): + for source in inputs: + source_url = in_source_url + new_base = base + if isinstance(source, str): + source_url = source + source_doc_base = base or self.doc_base + new_ctx = self._fetch_context( + source, source_doc_base, referenced_contexts + ) + if new_ctx is None: + continue + else: + if base: + if TYPE_CHECKING: + # if base is not None, then source_doc_base won't be + # none due to how it is assigned. + assert source_doc_base is not None + new_base = urljoin(source_doc_base, source_url) + source = new_ctx + + if isinstance(source, dict): + if CONTEXT in source: + source = source[CONTEXT] + # type ignore: Incompatible types in assignment (expression has type "List[Union[Dict[str, Any], str, None]]", variable has type "Union[Dict[str, Any], str, None]") + source = source if isinstance(source, list) else [source] # type: ignore[assignment] + + if isinstance(source, list): + # type error: Statement is unreachable + self._prep_sources( # type: ignore[unreachable] + new_base, source, sources, referenced_contexts, source_url + ) + else: + sources.append((source_url, source)) + + def _fetch_context( + self, source: str, base: Optional[str], referenced_contexts: Set[str] + ): + # type error: Value of type variable "AnyStr" of "urljoin" cannot be "Optional[str]" + source_url = urljoin(base, source) # type: ignore[type-var] + + if source_url in referenced_contexts: + raise RECURSIVE_CONTEXT_INCLUSION + + # type error: Argument 1 to "add" of "set" has incompatible type "Optional[str]"; expected "str" + referenced_contexts.add(source_url) # type: ignore[arg-type] + + if source_url in self._context_cache: + return self._context_cache[source_url] + + # type error: Incompatible types in assignment (expression has type "Optional[Any]", variable has type "str") + source_json, _ = source_to_json(source_url) + if source_json and CONTEXT not in source_json: + raise INVALID_REMOTE_CONTEXT + + # type error: Invalid index type "Optional[str]" for "Dict[str, Any]"; expected type "str" + self._context_cache[source_url] = source_json # type: ignore[index] + + return source_json + + def _read_source( + self, + source: Dict[str, Any], + source_url: Optional[str] = None, + referenced_contexts: Optional[Set[str]] = None, + ): + imports = source.get(IMPORT) + if imports: + if not isinstance(imports, str): + raise INVALID_CONTEXT_ENTRY + + imported = self._fetch_context( + imports, self.base, referenced_contexts or set() + ) + if not isinstance(imported, dict): + raise INVALID_CONTEXT_ENTRY + + imported = imported[CONTEXT] + imported.update(source) + source = imported + + self.vocab = source.get(VOCAB, self.vocab) + self.version = source.get(VERSION, self.version) + protected = source.get(PROTECTED, False) + + for key, value in source.items(): + if key in {VOCAB, VERSION, IMPORT, PROTECTED}: + continue + elif key == PROPAGATE and isinstance(value, bool): + self.propagate = value + elif key == LANG: + self.language = value + elif key == BASE: + if not source_url and not imports: + self.base = value + else: + self._read_term(source, key, value, protected) + + def _read_term( + self, + source: Dict[str, Any], + name: str, + dfn: Union[Dict[str, Any], str], + protected: bool = False, + ) -> None: + idref = None + if isinstance(dfn, dict): + # term = self._create_term(source, key, value) + rev = dfn.get(REV) + protected = dfn.get(PROTECTED, protected) + + coercion = dfn.get(TYPE, UNDEF) + if coercion and coercion not in (ID, TYPE, VOCAB): + coercion = self._rec_expand(source, coercion) + + idref = rev or dfn.get(ID, UNDEF) + if idref == TYPE: + idref = str(RDF.type) + coercion = VOCAB + elif idref is not UNDEF: + idref = self._rec_expand(source, idref) + elif ":" in name: + idref = self._rec_expand(source, name) + elif self.vocab: + idref = self.vocab + name + + context = dfn.get(CONTEXT, UNDEF) + + self.add_term( + name, + idref, + coercion, + dfn.get(CONTAINER, UNDEF), + dfn.get(INDEX, UNDEF), + dfn.get(LANG, UNDEF), + bool(rev), + context, + dfn.get(PREFIX), + protected=protected, + ) + else: + if isinstance(dfn, str): + if not self._accept_term(dfn): + return + idref = self._rec_expand(source, dfn) + # type error: Argument 2 to "add_term" of "Context" has incompatible type "Optional[str]"; expected "str" + self.add_term(name, idref, protected=protected) # type: ignore[arg-type] + + if idref in NODE_KEYS: + self._alias.setdefault(idref, []).append(name) + else: + # undo aliases that may have been inherited from parent context + for v in self._alias.values(): + if name in v: + v.remove(name) + + def _rec_expand( + self, source: Dict[str, Any], expr: Optional[str], prev: Optional[str] = None + ) -> Optional[str]: + if expr == prev or expr in NODE_KEYS: + return expr + + nxt: Optional[str] + # type error: Argument 1 to "_prep_expand" of "Context" has incompatible type "Optional[str]"; expected "str" + is_term, pfx, nxt = self._prep_expand(expr) # type: ignore[arg-type] + if pfx: + iri = self._get_source_id(source, pfx) + if iri is None: + if pfx + ":" == self.vocab: + return expr + else: + term = self.terms.get(pfx) + if term: + iri = term.id + + if iri is None: + nxt = expr + else: + nxt = iri + nxt + else: + nxt = self._get_source_id(source, nxt) or nxt + if ":" not in nxt and self.vocab: + return self.vocab + nxt + + return self._rec_expand(source, nxt, expr) + + def _prep_expand(self, expr: str) -> Tuple[bool, Optional[str], str]: + if ":" not in expr: + return True, None, expr + pfx, local = expr.split(":", 1) + if not local.startswith("//"): + return False, pfx, local + else: + return False, None, expr + + def _get_source_id(self, source: Dict[str, Any], key: str) -> Optional[str]: + # .. from source dict or if already defined + term = source.get(key) + if term is None: + dfn = self.terms.get(key) + if dfn: + term = dfn.id + elif isinstance(term, dict): + term = term.get(ID) + return term + + def _term_dict(self, term: Term) -> Union[Dict[str, Any], str]: + tdict: Dict[str, Any] = {} + if term.type != UNDEF: + tdict[TYPE] = self.shrink_iri(term.type) + if term.container: + tdict[CONTAINER] = list(term.container) + if term.language != UNDEF: + tdict[LANG] = term.language + if term.reverse: + tdict[REV] = term.id + else: + tdict[ID] = term.id + if tdict.keys() == {ID}: + return tdict[ID] + return tdict + + def to_dict(self) -> Dict[str, Any]: + """ + Returns a dictionary representation of the context that can be + serialized to JSON. + + Returns: + a dictionary representation of the context. + """ + r = {v: k for (k, v) in self._prefixes.items()} + r.update({term.name: self._term_dict(term) for term in self._lookup.values()}) + if self.base: + r[BASE] = self.base + if self.language: + r[LANG] = self.language + return r + + +Term = namedtuple( + "Term", + "id, name, type, container, index, language, reverse, context," "prefix, protected", +) + +Term.__new__.__defaults__ = (UNDEF, UNDEF, UNDEF, UNDEF, False, UNDEF, False, False) diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/shared/jsonld/errors.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/shared/jsonld/errors.py new file mode 100644 index 0000000000000000000000000000000000000000..6ba6e4b9adc9a72bb727fe543587aa2363c2ace6 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/shared/jsonld/errors.py @@ -0,0 +1,9 @@ +# https://github.com/RDFLib/rdflib-jsonld/blob/feature/json-ld-1.1/rdflib_jsonld/errors.py +class JSONLDException(ValueError): # noqa: N818 + pass + + +# http://www.w3.org/TR/json-ld-api/#idl-def-JsonLdErrorCode.{code-message} +RECURSIVE_CONTEXT_INCLUSION = JSONLDException("recursive context inclusion") +INVALID_REMOTE_CONTEXT = JSONLDException("invalid remote context") +INVALID_CONTEXT_ENTRY = JSONLDException("invalid context entry") diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/shared/jsonld/keys.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/shared/jsonld/keys.py new file mode 100644 index 0000000000000000000000000000000000000000..6b998ad410ce087fbc31661843a6c65b6bbe789f --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/shared/jsonld/keys.py @@ -0,0 +1,24 @@ +# https://github.com/RDFLib/rdflib-jsonld/blob/feature/json-ld-1.1/rdflib_jsonld/keys.py +BASE = "@base" +CONTAINER = "@container" +CONTEXT = "@context" +# DIRECTION = u'@direction' +GRAPH = "@graph" +ID = "@id" +IMPORT = "@import" +INCLUDED = "@included" +INDEX = "@index" +JSON = "@json" +LANG = LANGUAGE = "@language" +LIST = "@list" +NEST = "@nest" +NONE = "@none" +PREFIX = "@prefix" +PROPAGATE = "@propagate" +PROTECTED = "@protected" +REV = REVERSE = "@reverse" +SET = "@set" +TYPE = "@type" +VALUE = "@value" +VERSION = "@version" +VOCAB = "@vocab" diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/shared/jsonld/util.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/shared/jsonld/util.py new file mode 100644 index 0000000000000000000000000000000000000000..47583e94575ee5263fece6f949f79ae47535d984 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/shared/jsonld/util.py @@ -0,0 +1,358 @@ +# https://github.com/RDFLib/rdflib-jsonld/blob/feature/json-ld-1.1/rdflib_jsonld/util.py +from __future__ import annotations + +import json +import pathlib +from html.parser import HTMLParser +from io import StringIO, TextIOBase, TextIOWrapper +from typing import IO, TYPE_CHECKING, Any, Dict, List, Optional, TextIO, Tuple, Union + +if TYPE_CHECKING: + import json +else: + try: + import json + + assert json # workaround for pyflakes issue #13 + except ImportError: + import simplejson as json + +from posixpath import normpath, sep +from typing import TYPE_CHECKING, cast +from urllib.parse import urljoin, urlsplit, urlunsplit + +try: + import orjson + + _HAS_ORJSON = True +except ImportError: + orjson = None # type: ignore[assignment, unused-ignore] + _HAS_ORJSON = False + + +from rdflib.parser import ( + BytesIOWrapper, + InputSource, + PythonInputSource, + StringInputSource, + URLInputSource, + create_input_source, +) + + +def source_to_json( + source: Optional[ + Union[IO[bytes], TextIO, InputSource, str, bytes, pathlib.PurePath] + ], + fragment_id: Optional[str] = None, + extract_all_scripts: Optional[bool] = False, +) -> Tuple[Union[Dict, List[Dict]], Any]: + """Extract JSON from a source document. + + The source document can be JSON or HTML with embedded JSON script elements (type attribute = "application/ld+json"). + To process as HTML `source.content_type` must be set to "text/html" or "application/xhtml+xml". + + Args: + source: the input source document (JSON or HTML) + fragment_id: if source is an HTML document then extract only the script element with matching id attribute, defaults to None + extract_all_scripts: if source is an HTML document then extract all script elements (unless fragment_id is provided), defaults to False (extract only the first script element) + + Returns: + Tuple with the extracted JSON document and value of the HTML base element + """ + + if isinstance(source, PythonInputSource): + return source.data, None + + if isinstance(source, StringInputSource): + # A StringInputSource is assumed to be never a HTMLJSON doc + html_base: Any = None + # We can get the original string from the StringInputSource + # It's hidden in the BytesIOWrapper 'wrapped' attribute + b_stream = source.getByteStream() + original_string: Optional[str] = None + json_dict: Union[Dict, List[Dict]] + if isinstance(b_stream, BytesIOWrapper): + wrapped_inner = cast(Union[str, StringIO, TextIOBase], b_stream.wrapped) + if isinstance(wrapped_inner, str): + original_string = wrapped_inner + elif isinstance(wrapped_inner, StringIO): + original_string = wrapped_inner.getvalue() + if _HAS_ORJSON: + if original_string is not None: + json_dict = orjson.loads(original_string) + elif isinstance(b_stream, BytesIOWrapper): + # use the CharacterStream instead + c_stream = source.getCharacterStream() + json_dict = orjson.loads(c_stream.read()) + else: + # orjson assumes its in utf-8 encoding so + # don't bother to check the source.getEncoding() + json_dict = orjson.loads(b_stream.read()) + else: + if original_string is not None: + json_dict = json.loads(original_string) + else: + json_dict = json.load(source.getCharacterStream()) + return json_dict, html_base + + # TODO: conneg for JSON (fix support in rdflib's URLInputSource!) + source = create_input_source(source, format="json-ld") + try: + content_type = source.content_type + except (AttributeError, LookupError): + content_type = None + + is_html = content_type is not None and content_type.lower() in ( + "text/html", + "application/xhtml+xml", + ) + if is_html: + html_docparser: Optional[HTMLJSONParser] = HTMLJSONParser( + fragment_id=fragment_id, extract_all_scripts=extract_all_scripts + ) + else: + html_docparser = None + try: + b_stream = source.getByteStream() + except (AttributeError, LookupError): + b_stream = None + try: + c_stream = source.getCharacterStream() + except (AttributeError, LookupError): + c_stream = None + if b_stream is None and c_stream is None: + raise ValueError( + f"Source does not have a character stream or a byte stream and cannot be used {type(source)}" + ) + try: + b_encoding: Optional[str] = None if b_stream is None else source.getEncoding() + except (AttributeError, LookupError): + b_encoding = None + underlying_string: Optional[str] = None + if b_stream is not None and isinstance(b_stream, BytesIOWrapper): + # Try to find an underlying wrapped Unicode string to use? + wrapped_inner = b_stream.wrapped + if isinstance(wrapped_inner, str): + underlying_string = wrapped_inner + elif isinstance(wrapped_inner, StringIO): + underlying_string = wrapped_inner.getvalue() + try: + if is_html and html_docparser is not None: + # Offload parsing to the HTMLJSONParser + if underlying_string is not None: + html_string: str = underlying_string + elif c_stream is not None: + html_string = c_stream.read() + else: + if TYPE_CHECKING: + assert b_stream is not None + if b_encoding is None: + b_encoding = "utf-8" + html_string = TextIOWrapper(b_stream, encoding=b_encoding).read() + html_docparser.feed(html_string) + json_dict, html_base = html_docparser.get_json(), html_docparser.get_base() + elif _HAS_ORJSON: + html_base = None + if underlying_string is not None: + json_dict = orjson.loads(underlying_string) + elif ( + (b_stream is not None and isinstance(b_stream, BytesIOWrapper)) + or b_stream is None + ) and c_stream is not None: + # use the CharacterStream instead + json_dict = orjson.loads(c_stream.read()) + else: + if TYPE_CHECKING: + assert b_stream is not None + # b_stream is not None + json_dict = orjson.loads(b_stream.read()) + else: + html_base = None + if underlying_string is not None: + return json.loads(underlying_string) + if c_stream is not None: + use_stream = c_stream + else: + if TYPE_CHECKING: + assert b_stream is not None + # b_stream is not None + if b_encoding is None: + b_encoding = "utf-8" + use_stream = TextIOWrapper(b_stream, encoding=b_encoding) + json_dict = json.load(use_stream) + return json_dict, html_base + finally: + if b_stream is not None: + try: + b_stream.close() + except AttributeError: + pass + if c_stream is not None: + try: + c_stream.close() + except AttributeError: + pass + + +VOCAB_DELIMS = ("#", "/", ":") + + +def split_iri(iri: str) -> Tuple[str, Optional[str]]: + for delim in VOCAB_DELIMS: + at = iri.rfind(delim) + if at > -1: + return iri[: at + 1], iri[at + 1 :] + return iri, None + + +def norm_url(base: str, url: str) -> str: + """ + ```python + >>> norm_url('http://example.org/', '/one') + 'http://example.org/one' + >>> norm_url('http://example.org/', '/one#') + 'http://example.org/one#' + >>> norm_url('http://example.org/one', 'two') + 'http://example.org/two' + >>> norm_url('http://example.org/one/', 'two') + 'http://example.org/one/two' + >>> norm_url('http://example.org/', 'http://example.net/one') + 'http://example.net/one' + >>> norm_url('http://example.org/', 'http://example.org//one') + 'http://example.org//one' + + ``` + """ + if "://" in url: + return url + + # Fix for URNs + parsed_base = urlsplit(base) + parsed_url = urlsplit(url) + if parsed_url.scheme: + # Assume full URL + return url + if parsed_base.scheme in ("urn", "urn-x"): + # No scheme -> assume relative and join paths + base_path_parts = parsed_base.path.split("/", 1) + base_path = "/" + (base_path_parts[1] if len(base_path_parts) > 1 else "") + joined_path = urljoin(base_path, parsed_url.path) + fragment = f"#{parsed_url.fragment}" if parsed_url.fragment else "" + result = f"{parsed_base.scheme}:{base_path_parts[0]}{joined_path}{fragment}" + else: + parts = urlsplit(urljoin(base, url)) + path = normpath(parts[2]) + if sep != "/": + path = "/".join(path.split(sep)) + if parts[2].endswith("/") and not path.endswith("/"): + path += "/" + result = urlunsplit(parts[0:2] + (path,) + parts[3:]) + if url.endswith("#") and not result.endswith("#"): + result += "#" + return result + + +# type error: Missing return statement +def context_from_urlinputsource(source: URLInputSource) -> Optional[str]: # type: ignore[return] + """ + Please note that JSON-LD documents served with the `application/ld+json` media type + MUST have all context information, including references to external contexts, + within the body of the document. Contexts linked via a + http://www.w3.org/ns/json-ld#context HTTP Link Header MUST be + ignored for such documents. + """ + if source.content_type != "application/ld+json": + try: + # source.links is the new way of getting Link headers from URLInputSource + links = source.links + except AttributeError: + # type error: Return value expected + return # type: ignore[return-value] + for link in links: + if ' rel="http://www.w3.org/ns/json-ld#context"' in link: + i, j = link.index("<"), link.index(">") + if i > -1 and j > -1: + # type error: Value of type variable "AnyStr" of "urljoin" cannot be "Optional[str]" + return urljoin(source.url, link[i + 1 : j]) # type: ignore[type-var] + + +__all__ = [ + "json", + "source_to_json", + "split_iri", + "norm_url", + "context_from_urlinputsource", + "orjson", + "_HAS_ORJSON", +] + + +class HTMLJSONParser(HTMLParser): + def __init__( + self, + fragment_id: Optional[str] = None, + extract_all_scripts: Optional[bool] = False, + ): + super().__init__() + self.fragment_id = fragment_id + self.json: List[Dict] = [] + self.contains_json = False + self.fragment_id_does_not_match = False + self.base = None + self.extract_all_scripts = extract_all_scripts + self.script_count = 0 + + def handle_starttag(self, tag, attrs): + self.contains_json = False + self.fragment_id_does_not_match = False + + # Only set self. contains_json to True if the + # type is 'application/ld+json' + if tag == "script": + for attr, value in attrs: + if attr == "type" and value == "application/ld+json": + self.contains_json = True + elif attr == "id" and self.fragment_id and value != self.fragment_id: + self.fragment_id_does_not_match = True + + elif tag == "base": + for attr, value in attrs: + if attr == "href": + self.base = value + + def handle_data(self, data): + # Only do something when we know the context is a + # script element containing application/ld+json + + if self.contains_json is True and self.fragment_id_does_not_match is False: + + if not self.extract_all_scripts and self.script_count > 0: + return + + if data.strip() == "": + # skip empty data elements + return + + # Try to parse the json + if _HAS_ORJSON: + # orjson can load a unicode string + # if that's the only thing we have, + # its not worth encoding it to bytes + parsed = orjson.loads(data) + else: + parsed = json.loads(data) + + # Add to the result document + if isinstance(parsed, list): + self.json.extend(parsed) + else: + self.json.append(parsed) + + self.script_count += 1 + + def get_json(self) -> List[Dict]: + return self.json + + def get_base(self): + return self.base diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__init__.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c59dd13f4a9d0427cbd79c1c2158e96b95593969 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__init__.py @@ -0,0 +1,62 @@ +"""SPARQL implementation for RDFLib + +!!! example "New in version 4.0" +""" + +from importlib.metadata import entry_points +from typing import TYPE_CHECKING + +SPARQL_LOAD_GRAPHS = True +""" +If True, using FROM and FROM NAMED +will load/parse more data +""" + + +SPARQL_DEFAULT_GRAPH_UNION = True +""" +If True - the default graph in the RDF Dataset is the union of all +named graphs (like RDFLib's ConjunctiveGraph) +""" + + +CUSTOM_EVALS = {} +""" +Custom evaluation functions + +These must be functions taking (ctx, part) and raise +NotImplementedError if they cannot handle a certain part +""" + + +PLUGIN_ENTRY_POINT = "rdf.plugins.sparqleval" + + +from . import operators, parser, parserutils +from .processor import prepareQuery, prepareUpdate, processUpdate + +assert parser +assert operators +assert parserutils + + +all_entry_points = entry_points() +if hasattr(all_entry_points, "select"): + for ep in all_entry_points.select(group=PLUGIN_ENTRY_POINT): + CUSTOM_EVALS[ep.name] = ep.load() +else: + # Prior to Python 3.10, this returns a dict instead of the selection interface + if TYPE_CHECKING: + assert isinstance(all_entry_points, dict) + for ep in all_entry_points.get(PLUGIN_ENTRY_POINT, []): + CUSTOM_EVALS[ep.name] = ep.load() + +__all__ = [ + "prepareQuery", + "prepareUpdate", + "processUpdate", + "operators", + "parser", + "parserutils", + "CUSTOM_EVALS", +] diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/__init__.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dd20953c23edca8571269d4c49176e85005aa476 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/__init__.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/aggregates.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/aggregates.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fefa9cb7311d25c25fe4cd8ccf721eb1fb0041a4 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/aggregates.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/algebra.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/algebra.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4c466111f4f389c46ecba4ffd19fb6536d8ae8e3 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/algebra.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/datatypes.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/datatypes.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f5f8ccc77ab52238032dd6ac04a767ea124eaa84 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/datatypes.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/evaluate.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/evaluate.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c0c2501c5e0b4bd8c7251a59f6bd223b66237180 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/evaluate.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/evalutils.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/evalutils.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..63ed6bdde1db44cf25a7d2e96c576382d5ccd13d Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/evalutils.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/operators.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/operators.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..146552d9cd1c0b4a87934d4a621a784673a5362b Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/operators.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/parser.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/parser.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f0c112ef16bc9b66935e3733748afbec65b2cdae Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/parser.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/parserutils.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/parserutils.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6325636453f9ffc2b52aedd28efeeaf42994feda Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/parserutils.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/processor.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/processor.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..75ad552a41e3accc929256451defb1bc1c8a83b8 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/processor.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/pyparsing_compat.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/pyparsing_compat.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..46561b50e1c0f49aed4133d9528c19254c999981 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/pyparsing_compat.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/sparql.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/sparql.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c04c2d32ce037054df8e1233933da0eaa51b9784 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/sparql.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/update.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/update.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a6da46162359c11d12c8e7fa12e2861893228892 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/__pycache__/update.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/aggregates.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/aggregates.py new file mode 100644 index 0000000000000000000000000000000000000000..12972e79515712dc1783adb2ab40596d46f1721e --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/aggregates.py @@ -0,0 +1,316 @@ +""" +Aggregation functions +""" + +from __future__ import annotations + +from decimal import Decimal +from typing import ( + Any, + Callable, + Dict, + Iterable, + List, + Mapping, + MutableMapping, + Optional, + Set, + Tuple, + TypeVar, + Union, + overload, +) + +from rdflib.namespace import XSD +from rdflib.plugins.sparql.datatypes import type_promotion +from rdflib.plugins.sparql.evalutils import _eval, _val +from rdflib.plugins.sparql.operators import numeric +from rdflib.plugins.sparql.parserutils import CompValue +from rdflib.plugins.sparql.sparql import FrozenBindings, NotBoundError, SPARQLTypeError +from rdflib.term import BNode, Identifier, Literal, URIRef, Variable + + +class Accumulator: + """abstract base class for different aggregation functions""" + + def __init__(self, aggregation: CompValue): + self.get_value: Callable[[], Optional[Literal]] + self.update: Callable[[FrozenBindings, Aggregator], None] + self.var = aggregation.res + self.expr = aggregation.vars + if not aggregation.distinct: + # type error: Cannot assign to a method + self.use_row = self.dont_care # type: ignore[method-assign] + self.distinct = False + else: + self.distinct = aggregation.distinct + self.seen: Set[Any] = set() + + def dont_care(self, row: FrozenBindings) -> bool: + """skips distinct test""" + return True + + def use_row(self, row: FrozenBindings) -> bool: + """tests distinct with set""" + return _eval(self.expr, row) not in self.seen + + def set_value(self, bindings: MutableMapping[Variable, Identifier]) -> None: + """sets final value in bindings""" + # type error: Incompatible types in assignment (expression has type "Optional[Literal]", target has type "Identifier") + bindings[self.var] = self.get_value() # type: ignore[assignment] + + +class Counter(Accumulator): + def __init__(self, aggregation: CompValue): + super(Counter, self).__init__(aggregation) + self.value = 0 + if self.expr == "*": + # cannot eval "*" => always use the full row + # type error: Cannot assign to a method + self.eval_row = self.eval_full_row # type: ignore[assignment] + + def update(self, row: FrozenBindings, aggregator: Aggregator) -> None: + try: + val = self.eval_row(row) + except NotBoundError: + # skip UNDEF + return + self.value += 1 + if self.distinct: + self.seen.add(val) + + def get_value(self) -> Literal: + return Literal(self.value) + + def eval_row(self, row: FrozenBindings) -> Identifier: + return _eval(self.expr, row) + + def eval_full_row(self, row: FrozenBindings) -> FrozenBindings: + return row + + def use_row(self, row: FrozenBindings) -> bool: + try: + return self.eval_row(row) not in self.seen + except NotBoundError: + # happens when counting zero optional nodes. See issue #2229 + return False + + +@overload +def type_safe_numbers(*args: int) -> Tuple[int]: ... + + +@overload +def type_safe_numbers( + *args: Union[Decimal, float, int] +) -> Tuple[Union[float, int]]: ... + + +def type_safe_numbers(*args: Union[Decimal, float, int]) -> Iterable[Union[float, int]]: + if any(isinstance(arg, float) for arg in args) and any( + isinstance(arg, Decimal) for arg in args + ): + return map(float, args) + # type error: Incompatible return value type (got "Tuple[Union[Decimal, float, int], ...]", expected "Iterable[Union[float, int]]") + # NOTE on type error: if args contains a Decimal it will nopt get here. + return args # type: ignore[return-value] + + +class Sum(Accumulator): + def __init__(self, aggregation: CompValue): + super(Sum, self).__init__(aggregation) + self.value = 0 + self.datatype: Optional[str] = None + + def update(self, row: FrozenBindings, aggregator: Aggregator) -> None: + try: + value = _eval(self.expr, row) + dt = self.datatype + if dt is None: + dt = value.datatype + else: + # type error: Argument 1 to "type_promotion" has incompatible type "str"; expected "URIRef" + dt = type_promotion(dt, value.datatype) # type: ignore[arg-type] + self.datatype = dt + self.value = sum(type_safe_numbers(self.value, numeric(value))) + if self.distinct: + self.seen.add(value) + except NotBoundError: + # skip UNDEF + pass + + def get_value(self) -> Literal: + return Literal(self.value, datatype=self.datatype) + + +class Average(Accumulator): + def __init__(self, aggregation: CompValue): + super(Average, self).__init__(aggregation) + self.counter = 0 + self.sum = 0 + self.datatype: Optional[str] = None + + def update(self, row: FrozenBindings, aggregator: Aggregator) -> None: + try: + value = _eval(self.expr, row) + dt = self.datatype + self.sum = sum(type_safe_numbers(self.sum, numeric(value))) + if dt is None: + dt = value.datatype + else: + # type error: Argument 1 to "type_promotion" has incompatible type "str"; expected "URIRef" + dt = type_promotion(dt, value.datatype) # type: ignore[arg-type] + self.datatype = dt + if self.distinct: + self.seen.add(value) + self.counter += 1 + # skip UNDEF or BNode => SPARQLTypeError + except NotBoundError: + pass + except SPARQLTypeError: + pass + + def get_value(self) -> Literal: + if self.counter == 0: + return Literal(0) + if self.datatype in (XSD.float, XSD.double): + return Literal(self.sum / self.counter) + else: + return Literal(Decimal(self.sum) / Decimal(self.counter)) + + +class Extremum(Accumulator): + """abstract base class for Minimum and Maximum""" + + def __init__(self, aggregation: CompValue): + self.compare: Callable[[Any, Any], Any] + super(Extremum, self).__init__(aggregation) + self.value: Any = None + # DISTINCT would not change the value for MIN or MAX + # type error: Cannot assign to a method + self.use_row = self.dont_care # type: ignore[method-assign] + + def set_value(self, bindings: MutableMapping[Variable, Identifier]) -> None: + if self.value is not None: + # simply do not set if self.value is still None + bindings[self.var] = Literal(self.value) + + def update(self, row: FrozenBindings, aggregator: Aggregator) -> None: + try: + if self.value is None: + self.value = _eval(self.expr, row) + else: + # self.compare is implemented by Minimum/Maximum + self.value = self.compare(self.value, _eval(self.expr, row)) + # skip UNDEF or BNode => SPARQLTypeError + except NotBoundError: + pass + except SPARQLTypeError: + pass + + +_ValueT = TypeVar("_ValueT", Variable, BNode, URIRef, Literal) + + +class Minimum(Extremum): + def compare(self, val1: _ValueT, val2: _ValueT) -> _ValueT: + return min(val1, val2, key=_val) + + +class Maximum(Extremum): + def compare(self, val1: _ValueT, val2: _ValueT) -> _ValueT: + return max(val1, val2, key=_val) + + +class Sample(Accumulator): + """takes the first eligible value""" + + def __init__(self, aggregation): + super(Sample, self).__init__(aggregation) + # DISTINCT would not change the value + # type error: Cannot assign to a method + self.use_row = self.dont_care # type: ignore[method-assign] + + def update(self, row: FrozenBindings, aggregator: Aggregator) -> None: + try: + # set the value now + aggregator.bindings[self.var] = _eval(self.expr, row) + # and skip this accumulator for future rows + del aggregator.accumulators[self.var] + except NotBoundError: + pass + + def get_value(self) -> None: + # set None if no value was set + return None + + +class GroupConcat(Accumulator): + value: List[Literal] + + def __init__(self, aggregation: CompValue): + super(GroupConcat, self).__init__(aggregation) + # only GROUPCONCAT needs to have a list as accumulator + self.value = [] + if aggregation.separator is None: + self.separator = " " + else: + self.separator = aggregation.separator + + def update(self, row: FrozenBindings, aggregator: Aggregator) -> None: + try: + value = _eval(self.expr, row) + # skip UNDEF + if isinstance(value, NotBoundError): + return + self.value.append(value) + if self.distinct: + self.seen.add(value) + # skip UNDEF + # NOTE: It seems like this is not the way undefined values occur, they + # come through not as exceptions but as values. This is left here + # however as it may occur in some cases. + # TODO: Consider removing this. + except NotBoundError: + pass + + def get_value(self) -> Literal: + return Literal(self.separator.join(str(v) for v in self.value)) + + +class Aggregator: + """combines different Accumulator objects""" + + accumulator_classes = { + "Aggregate_Count": Counter, + "Aggregate_Sample": Sample, + "Aggregate_Sum": Sum, + "Aggregate_Avg": Average, + "Aggregate_Min": Minimum, + "Aggregate_Max": Maximum, + "Aggregate_GroupConcat": GroupConcat, + } + + def __init__(self, aggregations: List[CompValue]): + self.bindings: Dict[Variable, Identifier] = {} + self.accumulators: Dict[str, Accumulator] = {} + for a in aggregations: + accumulator_class = self.accumulator_classes.get(a.name) + if accumulator_class is None: + raise Exception("Unknown aggregate function " + a.name) + self.accumulators[a.res] = accumulator_class(a) + + def update(self, row: FrozenBindings) -> None: + """update all own accumulators""" + # SAMPLE accumulators may delete themselves + # => iterate over list not generator + + for acc in list(self.accumulators.values()): + if acc.use_row(row): + acc.update(row, self) + + def get_bindings(self) -> Mapping[Variable, Identifier]: + """calculate and set last values""" + for acc in self.accumulators.values(): + acc.set_value(self.bindings) + return self.bindings diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/algebra.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/algebra.py new file mode 100644 index 0000000000000000000000000000000000000000..568f9dff1a7dce9451c0dc5926efbd8b86b61ba4 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/algebra.py @@ -0,0 +1,1688 @@ +""" +Converting the 'parse-tree' output of pyparsing to a SPARQL Algebra expression + +http://www.w3.org/TR/sparql11-query/#sparqlQuery +""" + +from __future__ import annotations + +import collections +import functools +import operator +import typing +from functools import reduce +from typing import ( + Any, + Callable, + DefaultDict, + Dict, + Iterable, + List, + Mapping, + Optional, + Set, + Tuple, + overload, +) + +from pyparsing import ParseResults + +from rdflib.paths import ( + AlternativePath, + InvPath, + MulPath, + NegatedPath, + Path, + SequencePath, +) +from rdflib.plugins.sparql.operators import TrueFilter, and_ +from rdflib.plugins.sparql.operators import simplify as simplifyFilters +from rdflib.plugins.sparql.parserutils import CompValue, Expr +from rdflib.plugins.sparql.sparql import Prologue, Query, Update + +# --------------------------- +# Some convenience methods +from rdflib.term import BNode, Identifier, Literal, URIRef, Variable + + +def OrderBy(p: CompValue, expr: List[CompValue]) -> CompValue: + return CompValue("OrderBy", p=p, expr=expr) + + +def ToMultiSet(p: typing.Union[List[Dict[Variable, str]], CompValue]) -> CompValue: + return CompValue("ToMultiSet", p=p) + + +def Union(p1: CompValue, p2: CompValue) -> CompValue: + return CompValue("Union", p1=p1, p2=p2) + + +def Join(p1: CompValue, p2: Optional[CompValue]) -> CompValue: + return CompValue("Join", p1=p1, p2=p2) + + +def Minus(p1: CompValue, p2: CompValue) -> CompValue: + return CompValue("Minus", p1=p1, p2=p2) + + +def Graph(term: Identifier, graph: CompValue) -> CompValue: + return CompValue("Graph", term=term, p=graph) + + +def BGP( + triples: Optional[List[Tuple[Identifier, Identifier, Identifier]]] = None +) -> CompValue: + return CompValue("BGP", triples=triples or []) + + +def LeftJoin(p1: CompValue, p2: CompValue, expr) -> CompValue: + return CompValue("LeftJoin", p1=p1, p2=p2, expr=expr) + + +def Filter(expr: Expr, p: CompValue) -> CompValue: + return CompValue("Filter", expr=expr, p=p) + + +def Extend( + p: CompValue, expr: typing.Union[Identifier, Expr], var: Variable +) -> CompValue: + return CompValue("Extend", p=p, expr=expr, var=var) + + +def Values(res: List[Dict[Variable, str]]) -> CompValue: + return CompValue("values", res=res) + + +def Project(p: CompValue, PV: List[Variable]) -> CompValue: + return CompValue("Project", p=p, PV=PV) + + +def Group(p: CompValue, expr: Optional[List[Variable]] = None) -> CompValue: + return CompValue("Group", p=p, expr=expr) + + +def _knownTerms( + triple: Tuple[Identifier, Identifier, Identifier], + varsknown: Set[typing.Union[BNode, Variable]], + varscount: Dict[Identifier, int], +) -> Tuple[int, int, bool]: + return ( + len( + [ + x + for x in triple + if x not in varsknown and isinstance(x, (Variable, BNode)) + ] + ), + -sum(varscount.get(x, 0) for x in triple), + not isinstance(triple[2], Literal), + ) + + +def 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 + """ + + def _addvar(term: str, varsknown: Set[typing.Union[Variable, BNode]]): + if isinstance(term, (Variable, BNode)): + varsknown.add(term) + + # NOTE on type errors: most of these are because the same variable is used + # for different types. + + # type error: List comprehension has incompatible type List[Tuple[None, Tuple[Identifier, Identifier, Identifier]]]; expected List[Tuple[Identifier, Identifier, Identifier]] + l_ = [(None, x) for x in l_] # type: ignore[misc] + varsknown: Set[typing.Union[BNode, Variable]] = set() + varscount: Dict[Identifier, int] = collections.defaultdict(int) + for t in l_: + for c in t[1]: + if isinstance(c, (Variable, BNode)): + varscount[c] += 1 + i = 0 + + # Done in steps, sort by number of bound terms + # the top block of patterns with the most bound terms is kept + # the rest is resorted based on the vars bound after the first + # block is evaluated + + # we sort by decorate/undecorate, since we need the value of the sort keys + + while i < len(l_): + # type error: Generator has incompatible item type "Tuple[Any, Identifier]"; expected "Tuple[Identifier, Identifier, Identifier]" + # type error: Argument 1 to "_knownTerms" has incompatible type "Identifier"; expected "Tuple[Identifier, Identifier, Identifier]" + l_[i:] = sorted((_knownTerms(x[1], varsknown, varscount), x[1]) for x in l_[i:]) # type: ignore[misc,arg-type] + # type error: Incompatible types in assignment (expression has type "str", variable has type "Tuple[Identifier, Identifier, Identifier]") + t = l_[i][0][0] # type: ignore[assignment] # top block has this many terms bound + j = 0 + while i + j < len(l_) and l_[i + j][0][0] == t: + for c in l_[i + j][1]: + _addvar(c, varsknown) + j += 1 + i += 1 + + # type error: List comprehension has incompatible type List[Identifier]; expected List[Tuple[Identifier, Identifier, Identifier]] + return [x[1] for x in l_] # type: ignore[misc] + + +def triples( + l: typing.Union[ # noqa: E741 + List[List[Identifier]], List[Tuple[Identifier, Identifier, Identifier]] + ] +) -> List[Tuple[Identifier, Identifier, Identifier]]: + _l = reduce(lambda x, y: x + y, l) + if (len(_l) % 3) != 0: + raise Exception("these aint triples") + return reorderTriples((_l[x], _l[x + 1], _l[x + 2]) for x in range(0, len(_l), 3)) + + +# type error: Missing return statement +def translatePName( # type: ignore[return] + p: typing.Union[CompValue, str], prologue: Prologue +) -> Optional[Identifier]: + """ + Expand prefixed/relative URIs + """ + if isinstance(p, CompValue): + if p.name == "pname": + # type error: Incompatible return value type (got "Union[CompValue, str, None]", expected "Optional[Identifier]") + return prologue.absolutize(p) # type: ignore[return-value] + if p.name == "literal": + # type error: Argument "datatype" to "Literal" has incompatible type "Union[CompValue, str, None]"; expected "Optional[str]" + return Literal( + p.string, lang=p.lang, datatype=prologue.absolutize(p.datatype) # type: ignore[arg-type] + ) + elif isinstance(p, URIRef): + # type error: Incompatible return value type (got "Union[CompValue, str, None]", expected "Optional[Identifier]") + return prologue.absolutize(p) # type: ignore[return-value] + + +@overload +def translatePath(p: URIRef) -> None: ... + + +@overload +def translatePath(p: CompValue) -> Path: ... + + +# type error: Missing return statement +def translatePath(p: typing.Union[CompValue, URIRef]) -> Optional[Path]: # type: ignore[return] + """ + Translate PropertyPath expressions + """ + + if isinstance(p, CompValue): + if p.name == "PathAlternative": + if len(p.part) == 1: + return p.part[0] + else: + return AlternativePath(*p.part) + + elif p.name == "PathSequence": + if len(p.part) == 1: + return p.part[0] + else: + return SequencePath(*p.part) + + elif p.name == "PathElt": + if not p.mod: + return p.part + else: + if isinstance(p.part, list): + if len(p.part) != 1: + raise Exception("Denkfehler!") + + return MulPath(p.part[0], p.mod) + else: + return MulPath(p.part, p.mod) + + elif p.name == "PathEltOrInverse": + if isinstance(p.part, list): + if len(p.part) != 1: + raise Exception("Denkfehler!") + return InvPath(p.part[0]) + else: + return InvPath(p.part) + + elif p.name == "PathNegatedPropertySet": + if isinstance(p.part, list): + return NegatedPath(AlternativePath(*p.part)) + else: + return NegatedPath(p.part) + + +def translateExists( + e: typing.Union[Expr, Literal, Variable, URIRef] +) -> typing.Union[Expr, Literal, Variable, URIRef]: + """ + Translate the graph pattern used by EXISTS and NOT EXISTS + http://www.w3.org/TR/sparql11-query/#sparqlCollectFilters + """ + + def _c(n): + if isinstance(n, CompValue): + if n.name in ("Builtin_EXISTS", "Builtin_NOTEXISTS"): + n.graph = translateGroupGraphPattern(n.graph) + if n.graph.name == "Filter": + # filters inside (NOT) EXISTS can see vars bound outside + n.graph.no_isolated_scope = True + + e = traverse(e, visitPost=_c) + + return e + + +def collectAndRemoveFilters(parts: List[CompValue]) -> Optional[Expr]: + """FILTER expressions apply to the whole group graph pattern in which + they appear. + + http://www.w3.org/TR/sparql11-query/#sparqlCollectFilters + """ + + filters = [] + + i = 0 + while i < len(parts): + p = parts[i] + if p.name == "Filter": + filters.append(translateExists(p.expr)) + parts.pop(i) + else: + i += 1 + + if filters: + # type error: Argument 1 to "and_" has incompatible type "*List[Union[Expr, Literal, Variable]]"; expected "Expr" + return and_(*filters) # type: ignore[arg-type] + + return None + + +def translateGroupOrUnionGraphPattern(graphPattern: CompValue) -> Optional[CompValue]: + A: Optional[CompValue] = None + + for g in graphPattern.graph: + g = translateGroupGraphPattern(g) + if not A: + A = g + else: + A = Union(A, g) + return A + + +def translateGraphGraphPattern(graphPattern: CompValue) -> CompValue: + return Graph(graphPattern.term, translateGroupGraphPattern(graphPattern.graph)) + + +def translateInlineData(graphPattern: CompValue) -> CompValue: + return ToMultiSet(translateValues(graphPattern)) + + +def translateGroupGraphPattern(graphPattern: CompValue) -> CompValue: + """ + http://www.w3.org/TR/sparql11-query/#convertGraphPattern + """ + + if graphPattern.translated: + # This occurs if it is attempted to translate a group graph pattern twice, + # which occurs with nested (NOT) EXISTS filters. Simply return the already + # translated pattern instead. + return graphPattern + if graphPattern.name == "SubSelect": + # The first output from translate cannot be None for a subselect query + # as it can only be None for certain DESCRIBE queries. + # type error: Argument 1 to "ToMultiSet" has incompatible type "Optional[CompValue]"; + # expected "Union[List[Dict[Variable, str]], CompValue]" + return ToMultiSet(translate(graphPattern)[0]) # type: ignore[arg-type] + + if not graphPattern.part: + graphPattern.part = [] # empty { } + + filters = collectAndRemoveFilters(graphPattern.part) + + g: List[CompValue] = [] + for p in graphPattern.part: + if p.name == "TriplesBlock": + # merge adjacent TripleBlocks + if not (g and g[-1].name == "BGP"): + g.append(BGP()) + g[-1]["triples"] += triples(p.triples) + else: + g.append(p) + + G = BGP() + for p in g: + if p.name == "OptionalGraphPattern": + A = translateGroupGraphPattern(p.graph) + if A.name == "Filter": + G = LeftJoin(G, A.p, A.expr) + else: + G = LeftJoin(G, A, TrueFilter) + elif p.name == "MinusGraphPattern": + G = Minus(p1=G, p2=translateGroupGraphPattern(p.graph)) + elif p.name == "GroupOrUnionGraphPattern": + G = Join(p1=G, p2=translateGroupOrUnionGraphPattern(p)) + elif p.name == "GraphGraphPattern": + G = Join(p1=G, p2=translateGraphGraphPattern(p)) + elif p.name == "InlineData": + G = Join(p1=G, p2=translateInlineData(p)) + elif p.name == "ServiceGraphPattern": + G = Join(p1=G, p2=p) + elif p.name in ("BGP", "Extend"): + G = Join(p1=G, p2=p) + elif p.name == "Bind": + # translateExists will translate the expression if it is EXISTS, and otherwise return + # the expression as is. This is needed because EXISTS has a graph pattern + # which must be translated to work properly during evaluation. + G = Extend(G, translateExists(p.expr), p.var) + + else: + raise Exception( + "Unknown part in GroupGraphPattern: %s - %s" % (type(p), p.name) + ) + + if filters: + G = Filter(expr=filters, p=G) + + # Mark this graph pattern as translated + G.translated = True + + return G + + +class StopTraversal(Exception): # noqa: N818 + def __init__(self, rv: bool): + self.rv = rv + + +def _traverse( + e: Any, + visitPre: Callable[[Any], Any] = lambda n: None, + visitPost: Callable[[Any], Any] = lambda n: None, +): + """Traverse a parse-tree, visit each node + + if visit functions return a value, replace current node + """ + _e = visitPre(e) + if _e is not None: + return _e + + if e is None: + return None + + if isinstance(e, (list, ParseResults)): + return [_traverse(x, visitPre, visitPost) for x in e] + elif isinstance(e, tuple): + return tuple([_traverse(x, visitPre, visitPost) for x in e]) + + elif isinstance(e, CompValue): + for k, val in e.items(): + e[k] = _traverse(val, visitPre, visitPost) + + _e = visitPost(e) + if _e is not None: + return _e + + return e + + +def _traverseAgg(e: Any, visitor: Callable[[Any, Any], Any] = lambda n, v: None): + """ + Traverse a parse-tree, visit each node + + if visit functions return a value, replace current node + """ + + res = [] + + if isinstance(e, (list, ParseResults, tuple)): + res = [_traverseAgg(x, visitor) for x in e] + elif isinstance(e, CompValue): + for k, val in e.items(): + if val is not None: + res.append(_traverseAgg(val, visitor)) + + return visitor(e, res) + + +def 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 + """ + try: + r = _traverse(tree, visitPre, visitPost) + if complete is not None: + return complete + return r + except StopTraversal as st: + return st.rv + + +def _hasAggregate(x) -> None: + """ + Traverse parse(sub)Tree + return true if any aggregates are used + """ + + if isinstance(x, CompValue): + if x.name.startswith("Aggregate_"): + raise StopTraversal(True) + + +# type error: Missing return statement +def _aggs(e, A) -> Optional[Variable]: # type: ignore[return] + """ + Collect Aggregates in A + replaces aggregates with variable references + """ + + # TODO: nested Aggregates? + + if isinstance(e, CompValue) and e.name.startswith("Aggregate_"): + A.append(e) + aggvar = Variable("__agg_%d__" % len(A)) + e["res"] = aggvar + return aggvar + + +# type error: Missing return statement +def _findVars(x, res: Set[Variable]) -> Optional[CompValue]: # type: ignore[return] + """ + Find all variables in a tree + """ + if isinstance(x, Variable): + res.add(x) + if isinstance(x, CompValue): + if x.name == "Bind": + res.add(x.var) + return x # stop recursion and finding vars in the expr + elif x.name == "SubSelect": + if x.projection: + res.update(v.var or v.evar for v in x.projection) + + return x + + +def _addVars(x, children: List[Set[Variable]]) -> Set[Variable]: + """ + find which variables may be bound by this part of the query + """ + if isinstance(x, Variable): + return set([x]) + elif isinstance(x, CompValue): + if x.name == "RelationalExpression": + x["_vars"] = set() + elif x.name == "Extend": + # vars only used in the expr for a bind should not be included + x["_vars"] = reduce( + operator.or_, + [child for child, part in zip(children, x) if part != "expr"], + set(), + ) + + else: + x["_vars"] = set(reduce(operator.or_, children, set())) + + if x.name == "SubSelect": + if x.projection: + s = set(v.var or v.evar for v in x.projection) + else: + s = set() + + return s + + return x["_vars"] + + return reduce(operator.or_, children, set()) + + +# type error: Missing return statement +def _sample(e: typing.Union[CompValue, List[Expr], Expr, List[str], Variable], v: Optional[Variable] = None) -> Optional[CompValue]: # type: ignore[return] + """ + For each unaggregated variable V in expr + Replace V with Sample(V) + """ + if isinstance(e, CompValue) and e.name.startswith("Aggregate_"): + return e # do not replace vars in aggregates + if isinstance(e, Variable) and v != e: + return CompValue("Aggregate_Sample", vars=e) + + +def _simplifyFilters(e: Any) -> Any: + if isinstance(e, Expr): + return simplifyFilters(e) + + +def translateAggregates( + q: CompValue, M: CompValue +) -> Tuple[CompValue, List[Tuple[Variable, Variable]]]: + E: List[Tuple[Variable, Variable]] = [] + A: List[CompValue] = [] + + # collect/replace aggs in : + # select expr as ?var + if q.projection: + for v in q.projection: + if v.evar: + v.expr = traverse(v.expr, functools.partial(_sample, v=v.evar)) + v.expr = traverse(v.expr, functools.partial(_aggs, A=A)) + + # having clause + if traverse(q.having, _hasAggregate, complete=True): + q.having = traverse(q.having, _sample) + traverse(q.having, functools.partial(_aggs, A=A)) + + # order by + if traverse(q.orderby, _hasAggregate, complete=False): + q.orderby = traverse(q.orderby, _sample) + traverse(q.orderby, functools.partial(_aggs, A=A)) + + # sample all other select vars + # TODO: only allowed for vars in group-by? + if q.projection: + for v in q.projection: + if v.var: + rv = Variable("__agg_%d__" % (len(A) + 1)) + A.append(CompValue("Aggregate_Sample", vars=v.var, res=rv)) + E.append((rv, v.var)) + + return CompValue("AggregateJoin", A=A, p=M), E + + +def translateValues( + v: CompValue, +) -> typing.Union[List[Dict[Variable, str]], CompValue]: + # if len(v.var)!=len(v.value): + # raise Exception("Unmatched vars and values in ValueClause: "+str(v)) + + res: List[Dict[Variable, str]] = [] + if not v.var: + return res + if not v.value: + return res + if not isinstance(v.value[0], list): + for val in v.value: + res.append({v.var[0]: val}) + else: + for vals in v.value: + res.append(dict(zip(v.var, vals))) + + return Values(res) + + +def translate(q: CompValue) -> Tuple[Optional[CompValue], List[Variable]]: + """ + http://www.w3.org/TR/sparql11-query/#convertSolMod + """ + + _traverse(q, _simplifyFilters) + + q.where = traverse(q.where, visitPost=translatePath) + + # TODO: Var scope test + VS: Set[Variable] = set() + + # All query types have a WHERE clause EXCEPT some DESCRIBE queries + # where only explicit IRIs are provided. + if q.name == "DescribeQuery": + # For DESCRIBE queries, use the vars provided in q.var. + # If there is no WHERE clause, vars should be explicit IRIs to describe. + # If there is a WHERE clause, vars can be any combination of explicit IRIs + # and variables. + VS = set(q.var) + + # If there is no WHERE clause, just return the vars projected + if q.where is None: + return None, list(VS) + + # Otherwise, evaluate the WHERE clause like SELECT DISTINCT + else: + q.modifier = "DISTINCT" + + else: + traverse(q.where, functools.partial(_findVars, res=VS)) + + # depth-first recursive generation of mapped query tree + M = translateGroupGraphPattern(q.where) + + aggregate = False + if q.groupby: + conditions = [] + # convert "GROUP BY (?expr as ?var)" to an Extend + for c in q.groupby.condition: + if isinstance(c, CompValue) and c.name == "GroupAs": + M = Extend(M, c.expr, c.var) + c = c.var + conditions.append(c) + + M = Group(p=M, expr=conditions) + aggregate = True + elif ( + traverse(q.having, _hasAggregate, complete=False) + or traverse(q.orderby, _hasAggregate, complete=False) + or any( + traverse(x.expr, _hasAggregate, complete=False) + for x in q.projection or [] + if x.evar + ) + ): + # if any aggregate is used, implicit group by + M = Group(p=M) + aggregate = True + + if aggregate: + M, aggregateAliases = translateAggregates(q, M) + else: + aggregateAliases = [] + + # Need to remove the aggregate var aliases before joining to VALUES; + # else the variable names won't match up correctly when aggregating. + for alias, var in aggregateAliases: + M = Extend(M, alias, var) + + # HAVING + if q.having: + M = Filter(expr=and_(*q.having.condition), p=M) + + # VALUES + if q.valuesClause: + M = Join(p1=M, p2=ToMultiSet(translateValues(q.valuesClause))) + + if not q.projection: + # select * + + # Find the first child projection in each branch of the mapped query tree, + # then include the variables it projects out in our projected variables. + for child_projection in _find_first_child_projections(M): + VS |= set(child_projection.PV) + + PV = list(VS) + else: + E = list() + PV = list() + for v in q.projection: + if v.var: + if v not in PV: + PV.append(v.var) + elif v.evar: + if v not in PV: + PV.append(v.evar) + + E.append((v.expr, v.evar)) + else: + raise Exception("I expected a var or evar here!") + + for e, v in E: + M = Extend(M, e, v) + + # ORDER BY + if q.orderby: + M = OrderBy( + M, + [ + CompValue("OrderCondition", expr=c.expr, order=c.order) + for c in q.orderby.condition + ], + ) + + # PROJECT + M = Project(M, PV) + + if q.modifier: + if q.modifier == "DISTINCT": + M = CompValue("Distinct", p=M) + elif q.modifier == "REDUCED": + M = CompValue("Reduced", p=M) + + if q.limitoffset: + offset = 0 + if q.limitoffset.offset is not None: + offset = q.limitoffset.offset.toPython() + + if q.limitoffset.limit is not None: + M = CompValue( + "Slice", p=M, start=offset, length=q.limitoffset.limit.toPython() + ) + else: + M = CompValue("Slice", p=M, start=offset) + + return M, PV + + +def _find_first_child_projections(M: CompValue) -> Iterable[CompValue]: + """ + Recursively find the first child instance of a Projection operation in each of + the branches of the query execution plan/tree. + """ + + for child_op in M.values(): + if isinstance(child_op, CompValue): + if child_op.name == "Project": + yield child_op + else: + for child_projection in _find_first_child_projections(child_op): + yield child_projection + + +# type error: Missing return statement +def simplify(n: Any) -> Optional[CompValue]: # type: ignore[return] + """Remove joins to empty BGPs""" + if isinstance(n, CompValue): + if n.name == "Join": + if n.p1.name == "BGP" and len(n.p1.triples) == 0: + return n.p2 + if n.p2.name == "BGP" and len(n.p2.triples) == 0: + return n.p1 + elif n.name == "BGP": + n["triples"] = reorderTriples(n.triples) + return n + + +def analyse(n: Any, children: Any) -> bool: + """ + Some things can be lazily joined. + This propegates whether they can up the tree + and sets lazy flags for all joins + """ + + if isinstance(n, CompValue): + if n.name == "Join": + n["lazy"] = all(children) + return False + elif n.name in ("Slice", "Distinct"): + return False + else: + return all(children) + else: + return True + + +def translatePrologue( + p: ParseResults, + base: Optional[str], + initNs: Optional[Mapping[str, Any]] = None, + prologue: Optional[Prologue] = None, +) -> Prologue: + if prologue is None: + prologue = Prologue() + prologue.base = "" + if base: + prologue.base = base + if initNs: + for k, v in initNs.items(): + prologue.bind(k, v) + + x: CompValue + for x in p: + if x.name == "Base": + prologue.base = x.iri + elif x.name == "PrefixDecl": + prologue.bind(x.prefix, prologue.absolutize(x.iri)) + + return prologue + + +def translateQuads( + quads: CompValue, +) -> Tuple[ + List[Tuple[Identifier, Identifier, Identifier]], + DefaultDict[str, List[Tuple[Identifier, Identifier, Identifier]]], +]: + if quads.triples: + alltriples = triples(quads.triples) + else: + alltriples = [] + + allquads: DefaultDict[str, List[Tuple[Identifier, Identifier, Identifier]]] = ( + collections.defaultdict(list) + ) + + if quads.quadsNotTriples: + for q in quads.quadsNotTriples: + if q.triples: + allquads[q.term] += triples(q.triples) + + return alltriples, allquads + + +def translateUpdate1(u: CompValue, prologue: Prologue) -> CompValue: + if u.name in ("Load", "Clear", "Drop", "Create"): + pass # no translation needed + elif u.name in ("Add", "Move", "Copy"): + pass + elif u.name in ("InsertData", "DeleteData", "DeleteWhere"): + t, q = translateQuads(u.quads) + u["quads"] = q + u["triples"] = t + if u.name in ("DeleteWhere", "DeleteData"): + pass # TODO: check for bnodes in triples + elif u.name == "Modify": + if u.delete: + u.delete["triples"], u.delete["quads"] = translateQuads(u.delete.quads) + if u.insert: + u.insert["triples"], u.insert["quads"] = translateQuads(u.insert.quads) + u["where"] = translateGroupGraphPattern(u.where) + else: + raise Exception("Unknown type of update operation: %s" % u) + + u.prologue = prologue + return u + + +def translateUpdate( + q: CompValue, + base: Optional[str] = None, + initNs: Optional[Mapping[str, Any]] = None, +) -> Update: + """ + Returns a list of SPARQL Update Algebra expressions + """ + + res: List[CompValue] = [] + prologue = None + if not q.request: + # type error: Incompatible return value type (got "List[CompValue]", expected "Update") + return res # type: ignore[return-value] + for p, u in zip(q.prologue, q.request): + prologue = translatePrologue(p, base, initNs, prologue) + + # absolutize/resolve prefixes + u = traverse(u, visitPost=functools.partial(translatePName, prologue=prologue)) + u = _traverse(u, _simplifyFilters) + + u = traverse(u, visitPost=translatePath) + + res.append(translateUpdate1(u, prologue)) + + # type error: Argument 1 to "Update" has incompatible type "Optional[Any]"; expected "Prologue" + return Update(prologue, res) # type: ignore[arg-type] + + +def 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 + """ + + # We get in: (prologue, query) + + prologue = translatePrologue(q[0], base, initNs) + + # absolutize/resolve prefixes + q[1] = traverse( + q[1], visitPost=functools.partial(translatePName, prologue=prologue) + ) + + P, PV = translate(q[1]) + datasetClause = q[1].datasetClause + if q[1].name == "ConstructQuery": + template = triples(q[1].template) if q[1].template else None + + res = CompValue(q[1].name, p=P, template=template, datasetClause=datasetClause) + else: + res = CompValue(q[1].name, p=P, datasetClause=datasetClause, PV=PV) + + res = traverse(res, visitPost=simplify) + _traverseAgg(res, visitor=analyse) + _traverseAgg(res, _addVars) + + return Query(prologue, res) + + +class ExpressionNotCoveredException(Exception): # noqa: N818 + pass + + +class _AlgebraTranslator: + """Translator of a Query's algebra to its equivalent SPARQL (string). + + Coded as a class to support storage of state during the translation process, + without use of a file. + + Anticipated Usage: + + ```python + translated_query = _AlgebraTranslator(query).translateAlgebra() + ``` + + An external convenience function which wraps the above call, + `translateAlgebra`, is supplied, so this class does not need to be + referenced by client code at all in normal use. + """ + + def __init__(self, query_algebra: Query): + self.query_algebra = query_algebra + self.aggr_vars: DefaultDict[Identifier, List[Identifier]] = ( + collections.defaultdict(list) + ) + self._alg_translation: str = "" + + def _replace( + self, + old: str, + new: str, + search_from_match: str = None, + search_from_match_occurrence: int = None, + count: int = 1, + ): + def find_nth(haystack, needle, n): + start = haystack.lower().find(needle) + while start >= 0 and n > 1: + start = haystack.lower().find(needle, start + len(needle)) + n -= 1 + return start + + if search_from_match and search_from_match_occurrence: + position = find_nth( + self._alg_translation, search_from_match, search_from_match_occurrence + ) + filedata_pre = self._alg_translation[:position] + filedata_post = self._alg_translation[position:].replace(old, new, count) + self._alg_translation = filedata_pre + filedata_post + else: + self._alg_translation = self._alg_translation.replace(old, new, count) + + def convert_node_arg( + self, node_arg: typing.Union[Identifier, CompValue, Expr, str] + ) -> str: + if isinstance(node_arg, Identifier): + if node_arg in self.aggr_vars.keys(): + grp_var = self.aggr_vars[node_arg].pop(0).n3() + return grp_var + else: + return node_arg.n3() + elif isinstance(node_arg, CompValue): + return "{" + node_arg.name + "}" + elif isinstance(node_arg, str): + return node_arg + else: + raise ExpressionNotCoveredException( + "The expression {0} might not be covered yet.".format(node_arg) + ) + + def sparql_query_text(self, node): + """""" + + if isinstance(node, CompValue): + # 18.2 Query Forms + if node.name == "SelectQuery": + self._alg_translation = "-*-SELECT-*- " + "{" + node.p.name + "}" + + # 18.2 Graph Patterns + elif node.name == "BGP": + # Identifiers or Paths + # Negated path throws a type error. Probably n3() method of negated paths should be fixed + triples = "".join( + triple[0].n3() + " " + triple[1].n3() + " " + triple[2].n3() + "." + for triple in node.triples + ) + self._replace("{BGP}", triples) + # The dummy -*-SELECT-*- is placed during a SelectQuery or Multiset pattern in order to be able + # to match extended variables in a specific Select-clause (see "Extend" below) + self._replace("-*-SELECT-*-", "SELECT", count=-1) + # If there is no "Group By" clause the placeholder will simply be deleted. Otherwise there will be + # no matching {GroupBy} placeholder because it has already been replaced by "group by variables" + self._replace("{GroupBy}", "", count=-1) + self._replace("{Having}", "", count=-1) + elif node.name == "Join": + self._replace( + "{Join}", "{" + node.p1.name + "}{" + node.p2.name + "}" + ) # + elif node.name == "LeftJoin": + self._replace( + "{LeftJoin}", + "{" + node.p1.name + "}OPTIONAL{{" + node.p2.name + "}}", + ) + elif node.name == "Filter": + if isinstance(node.expr, CompValue): + expr = node.expr.name + else: + raise ExpressionNotCoveredException( + "This expression might not be covered yet." + ) + if node.p: + # Filter with p=AggregateJoin = Having + if node.p.name == "AggregateJoin": + self._replace("{Filter}", "{" + node.p.name + "}") + self._replace("{Having}", "HAVING({" + expr + "})") + else: + self._replace( + "{Filter}", "FILTER({" + expr + "}) {" + node.p.name + "}" + ) + else: + self._replace("{Filter}", "FILTER({" + expr + "})") + + elif node.name == "Union": + self._replace( + "{Union}", "{{" + node.p1.name + "}}UNION{{" + node.p2.name + "}}" + ) + elif node.name == "Graph": + expr = "GRAPH " + node.term.n3() + " {{" + node.p.name + "}}" + self._replace("{Graph}", expr) + elif node.name == "Extend": + query_string = self._alg_translation.lower() + select_occurrences = query_string.count("-*-select-*-") + self._replace( + node.var.n3(), + "(" + + self.convert_node_arg(node.expr) + + " as " + + node.var.n3() + + ")", + search_from_match="-*-select-*-", + search_from_match_occurrence=select_occurrences, + ) + self._replace("{Extend}", "{" + node.p.name + "}") + elif node.name == "Minus": + expr = "{" + node.p1.name + "}MINUS{{" + node.p2.name + "}}" + self._replace("{Minus}", expr) + elif node.name == "Group": + group_by_vars = [] + if node.expr: + for var in node.expr: + if isinstance(var, Identifier): + group_by_vars.append(var.n3()) + else: + raise ExpressionNotCoveredException( + "This expression might not be covered yet." + ) + self._replace("{Group}", "{" + node.p.name + "}") + self._replace( + "{GroupBy}", "GROUP BY " + " ".join(group_by_vars) + " " + ) + else: + self._replace("{Group}", "{" + node.p.name + "}") + elif node.name == "AggregateJoin": + self._replace("{AggregateJoin}", "{" + node.p.name + "}") + for agg_func in node.A: + if isinstance(agg_func.res, Identifier): + identifier = agg_func.res.n3() + else: + raise ExpressionNotCoveredException( + "This expression might not be covered yet." + ) + self.aggr_vars[agg_func.res].append(agg_func.vars) + + agg_func_name = agg_func.name.split("_")[1] + distinct = "" + if agg_func.distinct: + distinct = agg_func.distinct + " " + if agg_func_name == "GroupConcat": + self._replace( + identifier, + "GROUP_CONCAT" + + "(" + + distinct + + agg_func.vars.n3() + + ";SEPARATOR=" + + agg_func.separator.n3() + + ")", + ) + else: + self._replace( + identifier, + agg_func_name.upper() + + "(" + + distinct + + self.convert_node_arg(agg_func.vars) + + ")", + ) + # For non-aggregated variables the aggregation function "sample" is automatically assigned. + # However, we do not want to have "sample" wrapped around non-aggregated variables. That is + # why we replace it. If "sample" is used on purpose it will not be replaced as the alias + # must be different from the variable in this case. + self._replace( + "(SAMPLE({0}) as {0})".format( + self.convert_node_arg(agg_func.vars) + ), + self.convert_node_arg(agg_func.vars), + ) + elif node.name == "GroupGraphPatternSub": + self._replace( + "GroupGraphPatternSub", + " ".join([self.convert_node_arg(pattern) for pattern in node.part]), + ) + elif node.name == "TriplesBlock": + self._replace( + "{TriplesBlock}", + "".join( + triple[0].n3() + + " " + + triple[1].n3() + + " " + + triple[2].n3() + + "." + for triple in node.triples + ), + ) + + # 18.2 Solution modifiers + elif node.name == "ToList": + raise ExpressionNotCoveredException( + "This expression might not be covered yet." + ) + elif node.name == "OrderBy": + order_conditions = [] + for c in node.expr: + if isinstance(c.expr, Identifier): + var = c.expr.n3() + if c.order is not None: + cond = c.order + "(" + var + ")" + else: + cond = var + order_conditions.append(cond) + else: + raise ExpressionNotCoveredException( + "This expression might not be covered yet." + ) + self._replace("{OrderBy}", "{" + node.p.name + "}") + self._replace("{OrderConditions}", " ".join(order_conditions) + " ") + elif node.name == "Project": + project_variables = [] + for var in node.PV: + if isinstance(var, Identifier): + project_variables.append(var.n3()) + else: + raise ExpressionNotCoveredException( + "This expression might not be covered yet." + ) + order_by_pattern = "" + if node.p.name == "OrderBy": + order_by_pattern = "ORDER BY {OrderConditions}" + self._replace( + "{Project}", + " ".join(project_variables) + + "{{" + + node.p.name + + "}}" + + "{GroupBy}" + + order_by_pattern + + "{Having}", + ) + elif node.name == "Distinct": + self._replace("{Distinct}", "DISTINCT {" + node.p.name + "}") + elif node.name == "Reduced": + self._replace("{Reduced}", "REDUCED {" + node.p.name + "}") + elif node.name == "Slice": + slice = "OFFSET " + str(node.start) + " LIMIT " + str(node.length) + self._replace("{Slice}", "{" + node.p.name + "}" + slice) + elif node.name == "ToMultiSet": + if node.p.name == "values": + self._replace("{ToMultiSet}", "{{" + node.p.name + "}}") + else: + self._replace( + "{ToMultiSet}", "{-*-SELECT-*- " + "{" + node.p.name + "}" + "}" + ) + + # 18.2 Property Path + + # 17 Expressions and Testing Values + # # 17.3 Operator Mapping + elif node.name == "RelationalExpression": + expr = self.convert_node_arg(node.expr) + op = node.op + if isinstance(list, type(node.other)): + other = ( + "(" + + ", ".join(self.convert_node_arg(expr) for expr in node.other) + + ")" + ) + else: + other = self.convert_node_arg(node.other) + condition = "{left} {operator} {right}".format( + left=expr, operator=op, right=other + ) + self._replace("{RelationalExpression}", condition) + elif node.name == "ConditionalAndExpression": + inner_nodes = " && ".join( + [self.convert_node_arg(expr) for expr in node.other] + ) + self._replace( + "{ConditionalAndExpression}", + self.convert_node_arg(node.expr) + " && " + inner_nodes, + ) + elif node.name == "ConditionalOrExpression": + inner_nodes = " || ".join( + [self.convert_node_arg(expr) for expr in node.other] + ) + self._replace( + "{ConditionalOrExpression}", + "(" + self.convert_node_arg(node.expr) + " || " + inner_nodes + ")", + ) + elif node.name == "MultiplicativeExpression": + left_side = self.convert_node_arg(node.expr) + multiplication = left_side + for i, operator in enumerate(node.op): + multiplication += ( + operator + " " + self.convert_node_arg(node.other[i]) + " " + ) + self._replace("{MultiplicativeExpression}", multiplication) + elif node.name == "AdditiveExpression": + left_side = self.convert_node_arg(node.expr) + addition = left_side + for i, operator in enumerate(node.op): + addition += ( + operator + " " + self.convert_node_arg(node.other[i]) + " " + ) + self._replace("{AdditiveExpression}", addition) + elif node.name == "UnaryNot": + self._replace("{UnaryNot}", "!" + self.convert_node_arg(node.expr)) + + # # 17.4 Function Definitions + # # # 17.4.1 Functional Forms + elif node.name.endswith("BOUND"): + bound_var = self.convert_node_arg(node.arg) + self._replace("{Builtin_BOUND}", "bound(" + bound_var + ")") + elif node.name.endswith("IF"): + arg2 = self.convert_node_arg(node.arg2) + arg3 = self.convert_node_arg(node.arg3) + + if_expression = ( + "IF(" + "{" + node.arg1.name + "}, " + arg2 + ", " + arg3 + ")" + ) + self._replace("{Builtin_IF}", if_expression) + elif node.name.endswith("COALESCE"): + self._replace( + "{Builtin_COALESCE}", + "COALESCE(" + + ", ".join(self.convert_node_arg(arg) for arg in node.arg) + + ")", + ) + elif node.name.endswith("Builtin_EXISTS"): + # The node's name which we get with node.graph.name returns "Join" instead of GroupGraphPatternSub + # According to https://www.w3.org/TR/2013/REC-sparql11-query-20130321/#rExistsFunc + # ExistsFunc can only have a GroupGraphPattern as parameter. However, when we print the query algebra + # we get a GroupGraphPatternSub + self._replace( + "{Builtin_EXISTS}", "EXISTS " + "{{" + node.graph.name + "}}" + ) + traverse(node.graph, visitPre=self.sparql_query_text) + return node.graph + elif node.name.endswith("Builtin_NOTEXISTS"): + # The node's name which we get with node.graph.name returns "Join" instead of GroupGraphPatternSub + # According to https://www.w3.org/TR/2013/REC-sparql11-query-20130321/#rNotExistsFunc + # NotExistsFunc can only have a GroupGraphPattern as parameter. However, when we print the query algebra + # we get a GroupGraphPatternSub + self._replace( + "{Builtin_NOTEXISTS}", "NOT EXISTS " + "{{" + node.graph.name + "}}" + ) + traverse(node.graph, visitPre=self.sparql_query_text) + return node.graph + # # # # 17.4.1.5 logical-or: Covered in "RelationalExpression" + # # # # 17.4.1.6 logical-and: Covered in "RelationalExpression" + # # # # 17.4.1.7 RDFterm-equal: Covered in "RelationalExpression" + elif node.name.endswith("sameTerm"): + self._replace( + "{Builtin_sameTerm}", + "SAMETERM(" + + self.convert_node_arg(node.arg1) + + ", " + + self.convert_node_arg(node.arg2) + + ")", + ) + # # # # IN: Covered in "RelationalExpression" + # # # # NOT IN: Covered in "RelationalExpression" + + # # # 17.4.2 Functions on RDF Terms + elif node.name.endswith("Builtin_isIRI"): + self._replace( + "{Builtin_isIRI}", "isIRI(" + self.convert_node_arg(node.arg) + ")" + ) + elif node.name.endswith("Builtin_isBLANK"): + self._replace( + "{Builtin_isBLANK}", + "isBLANK(" + self.convert_node_arg(node.arg) + ")", + ) + elif node.name.endswith("Builtin_isLITERAL"): + self._replace( + "{Builtin_isLITERAL}", + "isLITERAL(" + self.convert_node_arg(node.arg) + ")", + ) + elif node.name.endswith("Builtin_isNUMERIC"): + self._replace( + "{Builtin_isNUMERIC}", + "isNUMERIC(" + self.convert_node_arg(node.arg) + ")", + ) + elif node.name.endswith("Builtin_STR"): + self._replace( + "{Builtin_STR}", "STR(" + self.convert_node_arg(node.arg) + ")" + ) + elif node.name.endswith("Builtin_LANG"): + self._replace( + "{Builtin_LANG}", "LANG(" + self.convert_node_arg(node.arg) + ")" + ) + elif node.name.endswith("Builtin_DATATYPE"): + self._replace( + "{Builtin_DATATYPE}", + "DATATYPE(" + self.convert_node_arg(node.arg) + ")", + ) + elif node.name.endswith("Builtin_IRI"): + self._replace( + "{Builtin_IRI}", "IRI(" + self.convert_node_arg(node.arg) + ")" + ) + elif node.name.endswith("Builtin_BNODE"): + self._replace( + "{Builtin_BNODE}", "BNODE(" + self.convert_node_arg(node.arg) + ")" + ) + elif node.name.endswith("STRDT"): + self._replace( + "{Builtin_STRDT}", + "STRDT(" + + self.convert_node_arg(node.arg1) + + ", " + + self.convert_node_arg(node.arg2) + + ")", + ) + elif node.name.endswith("Builtin_STRLANG"): + self._replace( + "{Builtin_STRLANG}", + "STRLANG(" + + self.convert_node_arg(node.arg1) + + ", " + + self.convert_node_arg(node.arg2) + + ")", + ) + elif node.name.endswith("Builtin_UUID"): + self._replace("{Builtin_UUID}", "UUID()") + elif node.name.endswith("Builtin_STRUUID"): + self._replace("{Builtin_STRUUID}", "STRUUID()") + + # # # 17.4.3 Functions on Strings + elif node.name.endswith("Builtin_STRLEN"): + self._replace( + "{Builtin_STRLEN}", + "STRLEN(" + self.convert_node_arg(node.arg) + ")", + ) + elif node.name.endswith("Builtin_SUBSTR"): + args = [self.convert_node_arg(node.arg), node.start] + if node.length: + args.append(node.length) + expr = "SUBSTR(" + ", ".join(args) + ")" + self._replace("{Builtin_SUBSTR}", expr) + elif node.name.endswith("Builtin_UCASE"): + self._replace( + "{Builtin_UCASE}", "UCASE(" + self.convert_node_arg(node.arg) + ")" + ) + elif node.name.endswith("Builtin_LCASE"): + self._replace( + "{Builtin_LCASE}", "LCASE(" + self.convert_node_arg(node.arg) + ")" + ) + elif node.name.endswith("Builtin_STRSTARTS"): + self._replace( + "{Builtin_STRSTARTS}", + "STRSTARTS(" + + self.convert_node_arg(node.arg1) + + ", " + + self.convert_node_arg(node.arg2) + + ")", + ) + elif node.name.endswith("Builtin_STRENDS"): + self._replace( + "{Builtin_STRENDS}", + "STRENDS(" + + self.convert_node_arg(node.arg1) + + ", " + + self.convert_node_arg(node.arg2) + + ")", + ) + elif node.name.endswith("Builtin_CONTAINS"): + self._replace( + "{Builtin_CONTAINS}", + "CONTAINS(" + + self.convert_node_arg(node.arg1) + + ", " + + self.convert_node_arg(node.arg2) + + ")", + ) + elif node.name.endswith("Builtin_STRBEFORE"): + self._replace( + "{Builtin_STRBEFORE}", + "STRBEFORE(" + + self.convert_node_arg(node.arg1) + + ", " + + self.convert_node_arg(node.arg2) + + ")", + ) + elif node.name.endswith("Builtin_STRAFTER"): + self._replace( + "{Builtin_STRAFTER}", + "STRAFTER(" + + self.convert_node_arg(node.arg1) + + ", " + + self.convert_node_arg(node.arg2) + + ")", + ) + elif node.name.endswith("Builtin_ENCODE_FOR_URI"): + self._replace( + "{Builtin_ENCODE_FOR_URI}", + "ENCODE_FOR_URI(" + self.convert_node_arg(node.arg) + ")", + ) + elif node.name.endswith("Builtin_CONCAT"): + expr = "CONCAT({vars})".format( + vars=", ".join(self.convert_node_arg(elem) for elem in node.arg) + ) + self._replace("{Builtin_CONCAT}", expr) + elif node.name.endswith("Builtin_LANGMATCHES"): + self._replace( + "{Builtin_LANGMATCHES}", + "LANGMATCHES(" + + self.convert_node_arg(node.arg1) + + ", " + + self.convert_node_arg(node.arg2) + + ")", + ) + elif node.name.endswith("REGEX"): + args = [ + self.convert_node_arg(node.text), + self.convert_node_arg(node.pattern), + ] + expr = "REGEX(" + ", ".join(args) + ")" + self._replace("{Builtin_REGEX}", expr) + elif node.name.endswith("REPLACE"): + self._replace( + "{Builtin_REPLACE}", + "REPLACE(" + + self.convert_node_arg(node.arg) + + ", " + + self.convert_node_arg(node.pattern) + + ", " + + self.convert_node_arg(node.replacement) + + ")", + ) + + # # # 17.4.4 Functions on Numerics + elif node.name == "Builtin_ABS": + self._replace( + "{Builtin_ABS}", "ABS(" + self.convert_node_arg(node.arg) + ")" + ) + elif node.name == "Builtin_ROUND": + self._replace( + "{Builtin_ROUND}", "ROUND(" + self.convert_node_arg(node.arg) + ")" + ) + elif node.name == "Builtin_CEIL": + self._replace( + "{Builtin_CEIL}", "CEIL(" + self.convert_node_arg(node.arg) + ")" + ) + elif node.name == "Builtin_FLOOR": + self._replace( + "{Builtin_FLOOR}", "FLOOR(" + self.convert_node_arg(node.arg) + ")" + ) + elif node.name == "Builtin_RAND": + self._replace("{Builtin_RAND}", "RAND()") + + # # # 17.4.5 Functions on Dates and Times + elif node.name == "Builtin_NOW": + self._replace("{Builtin_NOW}", "NOW()") + elif node.name == "Builtin_YEAR": + self._replace( + "{Builtin_YEAR}", "YEAR(" + self.convert_node_arg(node.arg) + ")" + ) + elif node.name == "Builtin_MONTH": + self._replace( + "{Builtin_MONTH}", "MONTH(" + self.convert_node_arg(node.arg) + ")" + ) + elif node.name == "Builtin_DAY": + self._replace( + "{Builtin_DAY}", "DAY(" + self.convert_node_arg(node.arg) + ")" + ) + elif node.name == "Builtin_HOURS": + self._replace( + "{Builtin_HOURS}", "HOURS(" + self.convert_node_arg(node.arg) + ")" + ) + elif node.name == "Builtin_MINUTES": + self._replace( + "{Builtin_MINUTES}", + "MINUTES(" + self.convert_node_arg(node.arg) + ")", + ) + elif node.name == "Builtin_SECONDS": + self._replace( + "{Builtin_SECONDS}", + "SECONDS(" + self.convert_node_arg(node.arg) + ")", + ) + elif node.name == "Builtin_TIMEZONE": + self._replace( + "{Builtin_TIMEZONE}", + "TIMEZONE(" + self.convert_node_arg(node.arg) + ")", + ) + elif node.name == "Builtin_TZ": + self._replace( + "{Builtin_TZ}", "TZ(" + self.convert_node_arg(node.arg) + ")" + ) + + # # # 17.4.6 Hash functions + elif node.name == "Builtin_MD5": + self._replace( + "{Builtin_MD5}", "MD5(" + self.convert_node_arg(node.arg) + ")" + ) + elif node.name == "Builtin_SHA1": + self._replace( + "{Builtin_SHA1}", "SHA1(" + self.convert_node_arg(node.arg) + ")" + ) + elif node.name == "Builtin_SHA256": + self._replace( + "{Builtin_SHA256}", + "SHA256(" + self.convert_node_arg(node.arg) + ")", + ) + elif node.name == "Builtin_SHA384": + self._replace( + "{Builtin_SHA384}", + "SHA384(" + self.convert_node_arg(node.arg) + ")", + ) + elif node.name == "Builtin_SHA512": + self._replace( + "{Builtin_SHA512}", + "SHA512(" + self.convert_node_arg(node.arg) + ")", + ) + + # Other + elif node.name == "values": + columns = [] + for key in node.res[0].keys(): + if isinstance(key, Identifier): + columns.append(key.n3()) + else: + raise ExpressionNotCoveredException( + "The expression {0} might not be covered yet.".format(key) + ) + values = "VALUES (" + " ".join(columns) + ")" + + rows = "" + for elem in node.res: + row = [] + for term in elem.values(): + if isinstance(term, Identifier): + row.append( + term.n3() + ) # n3() is not part of Identifier class but every subclass has it + elif isinstance(term, str): + row.append(term) + else: + raise ExpressionNotCoveredException( + "The expression {0} might not be covered yet.".format( + term + ) + ) + rows += "(" + " ".join(row) + ")" + + self._replace("values", values + "{" + rows + "}") + elif node.name == "ServiceGraphPattern": + self._replace( + "{ServiceGraphPattern}", + "SERVICE " + + self.convert_node_arg(node.term) + + "{" + + node.graph.name + + "}", + ) + traverse(node.graph, visitPre=self.sparql_query_text) + return node.graph + # else: + # raise ExpressionNotCoveredException("The expression {0} might not be covered yet.".format(node.name)) + + def translateAlgebra(self) -> str: + traverse(self.query_algebra.algebra, visitPre=self.sparql_query_text) + return self._alg_translation + + +def translateAlgebra(query_algebra: Query) -> str: + """ + Translates a SPARQL 1.1 algebra tree into the corresponding query string. + + Args: + query_algebra: An algebra returned by `translateQuery`. + + Returns: + The query form generated from the SPARQL 1.1 algebra tree for + SELECT queries. + """ + query_from_algebra = _AlgebraTranslator( + query_algebra=query_algebra + ).translateAlgebra() + return query_from_algebra + + +def pprintAlgebra(q) -> None: + def pp(p, ind=" "): + # if isinstance(p, list): + # print "[ " + # for x in p: pp(x,ind) + # print "%s ]"%ind + # return + if not isinstance(p, CompValue): + print(p) + return + print("%s(" % (p.name,)) + for k in p: + print( + "%s%s =" + % ( + ind, + k, + ), + end=" ", + ) + pp(p[k], ind + " ") + print("%s)" % ind) + + try: + pp(q.algebra) + except AttributeError: + # it's update, just a list + for x in q: + pp(x) diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/datatypes.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/datatypes.py new file mode 100644 index 0000000000000000000000000000000000000000..bc06525a035d04174a70627dca640360d1d6a6a2 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/datatypes.py @@ -0,0 +1,102 @@ +""" +Utility functions for supporting the XML Schema Datatypes hierarchy +""" + +from __future__ import annotations + +from typing import TYPE_CHECKING, Dict, List, Optional, Set + +from rdflib.namespace import XSD + +if TYPE_CHECKING: + from rdflib.term import URIRef + + +XSD_DTs: Set[URIRef] = set( + ( + XSD.integer, + XSD.decimal, + XSD.float, + XSD.double, + XSD.string, + XSD.boolean, + XSD.dateTime, + XSD.nonPositiveInteger, + XSD.negativeInteger, + XSD.long, + XSD.int, + XSD.short, + XSD.byte, + XSD.nonNegativeInteger, + XSD.unsignedLong, + XSD.unsignedInt, + XSD.unsignedShort, + XSD.unsignedByte, + XSD.positiveInteger, + XSD.date, + ) +) + +# adding dateTime datatypes + +XSD_DateTime_DTs = set((XSD.dateTime, XSD.date, XSD.time)) + +XSD_Duration_DTs = set((XSD.duration, XSD.dayTimeDuration, XSD.yearMonthDuration)) + +_sub_types: Dict[URIRef, List[URIRef]] = { + XSD.integer: [ + XSD.nonPositiveInteger, + XSD.negativeInteger, + XSD.long, + XSD.int, + XSD.short, + XSD.byte, + XSD.nonNegativeInteger, + XSD.positiveInteger, + XSD.unsignedLong, + XSD.unsignedInt, + XSD.unsignedShort, + XSD.unsignedByte, + ], +} + +_super_types: Dict[URIRef, URIRef] = {} +for superdt in XSD_DTs: + for subdt in _sub_types.get(superdt, []): + _super_types[subdt] = superdt + +# we only care about float, double, integer, decimal +_typePromotionMap: Dict[URIRef, Dict[URIRef, URIRef]] = { + XSD.float: {XSD.integer: XSD.float, XSD.decimal: XSD.float, XSD.double: XSD.double}, + XSD.double: { + XSD.integer: XSD.double, + XSD.float: XSD.double, + XSD.decimal: XSD.double, + }, + XSD.decimal: { + XSD.integer: XSD.decimal, + XSD.float: XSD.float, + XSD.double: XSD.double, + }, + XSD.integer: { + XSD.decimal: XSD.decimal, + XSD.float: XSD.float, + XSD.double: XSD.double, + }, +} + + +def type_promotion(t1: URIRef, t2: Optional[URIRef]) -> URIRef: + if t2 is None: + return t1 + t1 = _super_types.get(t1, t1) + t2 = _super_types.get(t2, t2) + if t1 == t2: + return t1 # matching super-types + try: + if TYPE_CHECKING: + # type assert because mypy is confused and thinks t2 can be None + assert t2 is not None + return _typePromotionMap[t1][t2] + except KeyError: + raise TypeError("Operators cannot combine datatypes %s and %s" % (t1, t2)) diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/evaluate.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/evaluate.py new file mode 100644 index 0000000000000000000000000000000000000000..1bdfb33518ac06ca14d1051290401014fba213db --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/evaluate.py @@ -0,0 +1,684 @@ +""" +These method recursively evaluate the SPARQL Algebra + +evalQuery is the entry-point, it will setup context and +return the SPARQLResult object + +evalPart is called on each level and will delegate to the right method + +A `rdflib.plugins.sparql.sparql.QueryContext` is passed along, keeping +information needed for evaluation + +A list of dicts (solution mappings) is returned, apart from GroupBy which may +also return a dict of list of dicts +""" + +from __future__ import annotations + +import collections +import itertools +import re +from typing import ( + TYPE_CHECKING, + Any, + Deque, + Dict, + Generator, + Iterable, + List, + Mapping, + Optional, + Tuple, + Union, +) +from urllib.parse import urlencode +from urllib.request import Request, urlopen + +from pyparsing import ParseException + +from rdflib.graph import Graph +from rdflib.plugins.sparql import CUSTOM_EVALS, parser +from rdflib.plugins.sparql.aggregates import Aggregator +from rdflib.plugins.sparql.evalutils import ( + _ebv, + _eval, + _fillTemplate, + _join, + _minus, + _val, +) +from rdflib.plugins.sparql.parserutils import CompValue, value +from rdflib.plugins.sparql.sparql import ( + AlreadyBound, + FrozenBindings, + FrozenDict, + Query, + QueryContext, + SPARQLError, +) +from rdflib.term import BNode, Identifier, Literal, URIRef, Variable + +if TYPE_CHECKING: + from rdflib.paths import Path + +import json + +try: + import orjson + + _HAS_ORJSON = True +except ImportError: + orjson = None # type: ignore[assignment, unused-ignore] + _HAS_ORJSON = False + +_Triple = Tuple[Identifier, Identifier, Identifier] + + +def evalBGP( + ctx: QueryContext, bgp: List[_Triple] +) -> Generator[FrozenBindings, None, None]: + """ + A basic graph pattern + """ + + if not bgp: + yield ctx.solution() + return + + s, p, o = bgp[0] + + _s = ctx[s] + _p = ctx[p] + _o = ctx[o] + + # type error: Item "None" of "Optional[Graph]" has no attribute "triples" + # type Argument 1 to "triples" of "Graph" has incompatible type "Tuple[Union[str, Path, None], Union[str, Path, None], Union[str, Path, None]]"; expected "Tuple[Optional[Node], Optional[Node], Optional[Node]]" + for ss, sp, so in ctx.graph.triples((_s, _p, _o)): # type: ignore[union-attr, arg-type] + if None in (_s, _p, _o): + c = ctx.push() + else: + c = ctx + + if _s is None: + # type error: Incompatible types in assignment (expression has type "Union[Node, Any]", target has type "Identifier") + c[s] = ss # type: ignore[assignment] + + try: + if _p is None: + # type error: Incompatible types in assignment (expression has type "Union[Node, Any]", target has type "Identifier") + c[p] = sp # type: ignore[assignment] + except AlreadyBound: + continue + + try: + if _o is None: + # type error: Incompatible types in assignment (expression has type "Union[Node, Any]", target has type "Identifier") + c[o] = so # type: ignore[assignment] + except AlreadyBound: + continue + + for x in evalBGP(c, bgp[1:]): + yield x + + +def evalExtend( + ctx: QueryContext, extend: CompValue +) -> Generator[FrozenBindings, None, None]: + # TODO: Deal with dict returned from evalPart from GROUP BY + + for c in evalPart(ctx, extend.p): + try: + e = _eval(extend.expr, c.forget(ctx, _except=extend._vars)) + if isinstance(e, SPARQLError): + raise e + + yield c.merge({extend.var: e}) + + except SPARQLError: + yield c + + +def evalLazyJoin( + ctx: QueryContext, join: CompValue +) -> Generator[FrozenBindings, None, None]: + """ + A lazy join will push the variables bound + in the first part to the second part, + essentially doing the join implicitly + hopefully evaluating much fewer triples + """ + for a in evalPart(ctx, join.p1): + c = ctx.thaw(a) + for b in evalPart(c, join.p2): + yield b.merge(a) # merge, as some bindings may have been forgotten + + +def evalJoin(ctx: QueryContext, join: CompValue) -> Generator[FrozenDict, None, None]: + # TODO: Deal with dict returned from evalPart from GROUP BY + # only ever for join.p1 + + if join.lazy: + return evalLazyJoin(ctx, join) + else: + a = evalPart(ctx, join.p1) + b = set(evalPart(ctx, join.p2)) + return _join(a, b) + + +def evalUnion(ctx: QueryContext, union: CompValue) -> List[Any]: + branch1_branch2 = [] + for x in evalPart(ctx, union.p1): + branch1_branch2.append(x) + for x in evalPart(ctx, union.p2): + branch1_branch2.append(x) + return branch1_branch2 + + +def evalMinus(ctx: QueryContext, minus: CompValue) -> Generator[FrozenDict, None, None]: + a = evalPart(ctx, minus.p1) + b = set(evalPart(ctx, minus.p2)) + return _minus(a, b) + + +def evalLeftJoin( + ctx: QueryContext, join: CompValue +) -> Generator[FrozenBindings, None, None]: + # import pdb; pdb.set_trace() + for a in evalPart(ctx, join.p1): + ok = False + c = ctx.thaw(a) + for b in evalPart(c, join.p2): + if _ebv(join.expr, b.forget(ctx)): + ok = True + yield b.merge(a) + if not ok: + # we've cheated, the ctx above may contain + # vars bound outside our scope + # before we yield a solution without the OPTIONAL part + # check that we would have had no OPTIONAL matches + # even without prior bindings... + p1_vars = join.p1._vars + if p1_vars is None or not any( + _ebv(join.expr, b) + for b in evalPart(ctx.thaw(a.remember(p1_vars)), join.p2) + ): + yield a + + +def evalFilter( + ctx: QueryContext, part: CompValue +) -> Generator[FrozenBindings, None, None]: + # TODO: Deal with dict returned from evalPart! + for c in evalPart(ctx, part.p): + if _ebv( + part.expr, + c.forget(ctx, _except=part._vars) if not part.no_isolated_scope else c, + ): + yield c + + +def evalGraph( + ctx: QueryContext, part: CompValue +) -> Generator[FrozenBindings, None, None]: + if ctx.dataset is None: + raise Exception( + "Non-conjunctive-graph doesn't know about " + + "graphs. Try a query without GRAPH." + ) + + ctx = ctx.clone() + graph: Union[str, Path, None, Graph] = ctx[part.term] + prev_graph = ctx.graph + if graph is None: + for graph in ctx.dataset.contexts(): + # in SPARQL the default graph is NOT a named graph + if graph == ctx.dataset.default_context: + continue + + c = ctx.pushGraph(graph) + c = c.push() + graphSolution = [{part.term: graph.identifier}] + for x in _join(evalPart(c, part.p), graphSolution): + x.ctx.graph = prev_graph + yield x + + else: + if TYPE_CHECKING: + assert not isinstance(graph, Graph) + # type error: Argument 1 to "get_context" of "ConjunctiveGraph" has incompatible type "Union[str, Path]"; expected "Union[Node, str, None]" + c = ctx.pushGraph(ctx.dataset.get_context(graph)) # type: ignore[arg-type] + for x in evalPart(c, part.p): + x.ctx.graph = prev_graph + yield x + + +def evalValues( + ctx: QueryContext, part: CompValue +) -> Generator[FrozenBindings, None, None]: + for r in part.p.res: + c = ctx.push() + try: + for k, v in r.items(): + if v != "UNDEF": + c[k] = v + except AlreadyBound: + continue + + yield c.solution() + + +def evalMultiset(ctx: QueryContext, part: CompValue): + if part.p.name == "values": + return evalValues(ctx, part) + + return evalPart(ctx, part.p) + + +def evalPart(ctx: QueryContext, part: CompValue) -> Any: + # try custom evaluation functions + for name, c in CUSTOM_EVALS.items(): + try: + return c(ctx, part) + except NotImplementedError: + pass # the given custome-function did not handle this part + + if part.name == "BGP": + # Reorder triples patterns by number of bound nodes in the current ctx + # Do patterns with more bound nodes first + triples = sorted( + part.triples, key=lambda t: len([n for n in t if ctx[n] is None]) + ) + + return evalBGP(ctx, triples) + elif part.name == "Filter": + return evalFilter(ctx, part) + elif part.name == "Join": + return evalJoin(ctx, part) + elif part.name == "LeftJoin": + return evalLeftJoin(ctx, part) + elif part.name == "Graph": + return evalGraph(ctx, part) + elif part.name == "Union": + return evalUnion(ctx, part) + elif part.name == "ToMultiSet": + return evalMultiset(ctx, part) + elif part.name == "Extend": + return evalExtend(ctx, part) + elif part.name == "Minus": + return evalMinus(ctx, part) + + elif part.name == "Project": + return evalProject(ctx, part) + elif part.name == "Slice": + return evalSlice(ctx, part) + elif part.name == "Distinct": + return evalDistinct(ctx, part) + elif part.name == "Reduced": + return evalReduced(ctx, part) + + elif part.name == "OrderBy": + return evalOrderBy(ctx, part) + elif part.name == "Group": + return evalGroup(ctx, part) + elif part.name == "AggregateJoin": + return evalAggregateJoin(ctx, part) + + elif part.name == "SelectQuery": + return evalSelectQuery(ctx, part) + elif part.name == "AskQuery": + return evalAskQuery(ctx, part) + elif part.name == "ConstructQuery": + return evalConstructQuery(ctx, part) + + elif part.name == "ServiceGraphPattern": + return evalServiceQuery(ctx, part) + + elif part.name == "DescribeQuery": + return evalDescribeQuery(ctx, part) + + else: + raise Exception("I dont know: %s" % part.name) + + +def evalServiceQuery(ctx: QueryContext, part: CompValue): + res = {} + match = re.match( + "^service <(.*)>[ \n]*{(.*)}[ \n]*$", + # type error: Argument 2 to "get" of "CompValue" has incompatible type "str"; expected "bool" [arg-type] + part.get("service_string", ""), # type: ignore[arg-type] + re.DOTALL | re.I, + ) + + if match: + service_url = match.group(1) + service_query = _buildQueryStringForServiceCall(ctx, match.group(2)) + + query_settings = {"query": service_query, "output": "json"} + headers = { + "accept": "application/sparql-results+json", + "user-agent": "rdflibForAnUser", + } + # GET is easier to cache so prefer that if the query is not to long + if len(service_query) < 600: + response = urlopen( + Request(service_url + "?" + urlencode(query_settings), headers=headers) + ) + else: + response = urlopen( + Request( + service_url, + data=urlencode(query_settings).encode(), + headers=headers, + ) + ) + if response.status == 200: + if _HAS_ORJSON: + json_dict = orjson.loads(response.read()) + else: + json_dict = json.loads(response.read()) + variables = res["vars_"] = json_dict["head"]["vars"] + # or just return the bindings? + res = json_dict["results"]["bindings"] + if len(res) > 0: + for r in res: + # type error: Argument 2 to "_yieldBindingsFromServiceCallResult" has incompatible type "str"; expected "Dict[str, Dict[str, str]]" + for bound in _yieldBindingsFromServiceCallResult(ctx, r, variables): # type: ignore[arg-type] + yield bound + else: + raise Exception( + "Service: %s responded with code: %s", service_url, response.status + ) + + +""" + Build a query string to be used by the service call. + It is supposed to pass in the existing bound solutions. + Re-adds prefixes if added and sets the base. + Wraps it in select if needed. +""" + + +def _buildQueryStringForServiceCall(ctx: QueryContext, service_query: str) -> str: + try: + parser.parseQuery(service_query) + except ParseException: + # This could be because we don't have a select around the service call. + service_query = "SELECT REDUCED * WHERE {" + service_query + "}" + # type error: Item "None" of "Optional[Prologue]" has no attribute "namespace_manager" + for p in ctx.prologue.namespace_manager.store.namespaces(): # type: ignore[union-attr] + service_query = "PREFIX " + p[0] + ":" + p[1].n3() + " " + service_query + # re add the base if one was defined + # type error: Item "None" of "Optional[Prologue]" has no attribute "base" + base = ctx.prologue.base # type: ignore[union-attr] + if base is not None and len(base) > 0: + service_query = "BASE <" + base + "> " + service_query + sol = [v for v in ctx.solution() if isinstance(v, Variable)] + if len(sol) > 0: + variables = " ".join([v.n3() for v in sol]) + variables_bound = " ".join([ctx.get(v).n3() for v in sol]) + service_query = ( + service_query + "VALUES (" + variables + ") {(" + variables_bound + ")}" + ) + return service_query + + +def _yieldBindingsFromServiceCallResult( + ctx: QueryContext, r: Dict[str, Dict[str, str]], variables: List[str] +) -> Generator[FrozenBindings, None, None]: + res_dict: Dict[Variable, Identifier] = {} + for var in variables: + if var in r and r[var]: + var_binding = r[var] + var_type = var_binding["type"] + if var_type == "uri": + res_dict[Variable(var)] = URIRef(var_binding["value"]) + elif var_type == "literal": + res_dict[Variable(var)] = Literal( + var_binding["value"], + datatype=var_binding.get("datatype"), + lang=var_binding.get("xml:lang"), + ) + # This is here because of + # https://www.w3.org/TR/2006/NOTE-rdf-sparql-json-res-20061004/#variable-binding-results + elif var_type == "typed-literal": + res_dict[Variable(var)] = Literal( + var_binding["value"], datatype=URIRef(var_binding["datatype"]) + ) + elif var_type == "bnode": + res_dict[Variable(var)] = BNode(var_binding["value"]) + else: + raise ValueError(f"invalid type {var_type!r} for variable {var!r}") + yield FrozenBindings(ctx, res_dict) + + +def evalGroup(ctx: QueryContext, group: CompValue): + """ + http://www.w3.org/TR/sparql11-query/#defn_algGroup + """ + # grouping should be implemented by evalAggregateJoin + return evalPart(ctx, group.p) + + +def evalAggregateJoin( + ctx: QueryContext, agg: CompValue +) -> Generator[FrozenBindings, None, None]: + # import pdb ; pdb.set_trace() + p = evalPart(ctx, agg.p) + # p is always a Group, we always get a dict back + + group_expr = agg.p.expr + res: Dict[Any, Any] = collections.defaultdict( + lambda: Aggregator(aggregations=agg.A) + ) + + if group_expr is None: + # no grouping, just COUNT in SELECT clause + # get 1 aggregator for counting + aggregator = res[True] + for row in p: + aggregator.update(row) + else: + for row in p: + # determine right group aggregator for row + k = tuple(_eval(e, row, False) for e in group_expr) + res[k].update(row) + + # all rows are done; yield aggregated values + for aggregator in res.values(): + yield FrozenBindings(ctx, aggregator.get_bindings()) + + # there were no matches + if len(res) == 0: + yield FrozenBindings(ctx) + + +def evalOrderBy( + ctx: QueryContext, part: CompValue +) -> Generator[FrozenBindings, None, None]: + res = evalPart(ctx, part.p) + + for e in reversed(part.expr): + reverse = bool(e.order and e.order == "DESC") + res = sorted( + res, key=lambda x: _val(value(x, e.expr, variables=True)), reverse=reverse + ) + + return res + + +def evalSlice(ctx: QueryContext, slice: CompValue): + res = evalPart(ctx, slice.p) + + return itertools.islice( + res, + slice.start, + slice.start + slice.length if slice.length is not None else None, + ) + + +def evalReduced( + ctx: QueryContext, part: CompValue +) -> Generator[FrozenBindings, None, None]: + """apply REDUCED to result + + REDUCED is not as strict as DISTINCT, but if the incoming rows were sorted + it should produce the same result with limited extra memory and time per + incoming row. + """ + + # This implementation uses a most recently used strategy and a limited + # buffer size. It relates to a LRU caching algorithm: + # https://en.wikipedia.org/wiki/Cache_algorithms#Least_Recently_Used_.28LRU.29 + MAX = 1 + # TODO: add configuration or determine "best" size for most use cases + # 0: No reduction + # 1: compare only with the last row, almost no reduction with + # unordered incoming rows + # N: The greater the buffer size the greater the reduction but more + # memory and time are needed + + # mixed data structure: set for lookup, deque for append/pop/remove + mru_set = set() + mru_queue: Deque[Any] = collections.deque() + + for row in evalPart(ctx, part.p): + if row in mru_set: + # forget last position of row + mru_queue.remove(row) + else: + # row seems to be new + yield row + mru_set.add(row) + if len(mru_set) > MAX: + # drop the least recently used row from buffer + mru_set.remove(mru_queue.pop()) + # put row to the front + mru_queue.appendleft(row) + + +def evalDistinct( + ctx: QueryContext, part: CompValue +) -> Generator[FrozenBindings, None, None]: + res = evalPart(ctx, part.p) + + done = set() + for x in res: + if x not in done: + yield x + done.add(x) + + +def evalProject(ctx: QueryContext, project: CompValue): + res = evalPart(ctx, project.p) + return (row.project(project.PV) for row in res) + + +def evalSelectQuery( + ctx: QueryContext, query: CompValue +) -> Mapping[str, Union[str, List[Variable], Iterable[FrozenDict]]]: + res: Dict[str, Union[str, List[Variable], Iterable[FrozenDict]]] = {} + res["type_"] = "SELECT" + res["bindings"] = evalPart(ctx, query.p) + res["vars_"] = query.PV + return res + + +def evalAskQuery(ctx: QueryContext, query: CompValue) -> Mapping[str, Union[str, bool]]: + res: Dict[str, Union[bool, str]] = {} + res["type_"] = "ASK" + res["askAnswer"] = False + for x in evalPart(ctx, query.p): + res["askAnswer"] = True + break + + return res + + +def evalConstructQuery( + ctx: QueryContext, query: CompValue +) -> Mapping[str, Union[str, Graph]]: + template = query.template + + if not template: + # a construct-where query + template = query.p.p.triples # query->project->bgp ... + + graph = Graph() + + for c in evalPart(ctx, query.p): + graph += _fillTemplate(template, c) + + res: Dict[str, Union[str, Graph]] = {} + res["type_"] = "CONSTRUCT" + res["graph"] = graph + + return res + + +def evalDescribeQuery(ctx: QueryContext, query) -> Dict[str, Union[str, Graph]]: + # Create a result graph and bind namespaces from the graph being queried + graph = Graph() + # type error: Item "None" of "Optional[Graph]" has no attribute "namespaces" + for pfx, ns in ctx.graph.namespaces(): # type: ignore[union-attr] + graph.bind(pfx, ns) + + to_describe = set() + + # Explicit IRIs may be provided to a DESCRIBE query. + # If there is a WHERE clause, explicit IRIs may be provided in + # addition to projected variables. Find those explicit IRIs and + # prepare to describe them. + for iri in query.PV: + if isinstance(iri, URIRef): + to_describe.add(iri) + + # If there is a WHERE clause, evaluate it then find the unique set of + # resources to describe across all bindings and projected variables + if query.p is not None: + bindings = evalPart(ctx, query.p) + to_describe.update(*(set(binding.values()) for binding in bindings)) + + # Get a CBD for all resources identified to describe + for resource in to_describe: + # type error: Item "None" of "Optional[Graph]" has no attribute "cbd" + ctx.graph.cbd(resource, target_graph=graph) # type: ignore[union-attr] + + res: Dict[str, Union[str, Graph]] = {} + res["type_"] = "DESCRIBE" + res["graph"] = graph + + return res + + +def evalQuery( + graph: Graph, + query: Query, + initBindings: Optional[Mapping[str, Identifier]] = None, + base: Optional[str] = None, +) -> Mapping[Any, Any]: + """Evaluate a SPARQL query against a graph. + + !!! warning "Caution" + + This method can access indirectly requested network endpoints, for + example, query processing will attempt to access network endpoints + specified in `SERVICE` directives. + + When processing untrusted or potentially malicious queries, measures + should be taken to restrict network and file access. + + For information on available security measures, see the RDFLib + [Security Considerations](../security_considerations.md) + documentation. + """ + main = query.algebra + + initBindings = dict((Variable(k), v) for k, v in (initBindings or {}).items()) + + ctx = QueryContext( + graph, initBindings=initBindings, datasetClause=main.datasetClause + ) + + ctx.prologue = query.prologue + + return evalPart(ctx, main) diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/evalutils.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/evalutils.py new file mode 100644 index 0000000000000000000000000000000000000000..1f737e469f0499a5e95cbec7401f420e1cff8b7c --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/evalutils.py @@ -0,0 +1,188 @@ +from __future__ import annotations + +import collections +from typing import ( + Any, + DefaultDict, + Generator, + Iterable, + Mapping, + Set, + Tuple, + TypeVar, + Union, + overload, +) + +from rdflib.plugins.sparql.operators import EBV +from rdflib.plugins.sparql.parserutils import CompValue, Expr +from rdflib.plugins.sparql.sparql import ( + FrozenBindings, + FrozenDict, + NotBoundError, + QueryContext, + SPARQLError, +) +from rdflib.term import BNode, Identifier, Literal, URIRef, Variable + +_ContextType = Union[FrozenBindings, QueryContext] +_FrozenDictT = TypeVar("_FrozenDictT", bound=FrozenDict) + + +def _diff( + a: Iterable[_FrozenDictT], b: Iterable[_FrozenDictT], expr +) -> Set[_FrozenDictT]: + res = set() + + for x in a: + if all(not x.compatible(y) or not _ebv(expr, x.merge(y)) for y in b): + res.add(x) + + return res + + +def _minus( + a: Iterable[_FrozenDictT], b: Iterable[_FrozenDictT] +) -> Generator[_FrozenDictT, None, None]: + for x in a: + if all((not x.compatible(y)) or x.disjointDomain(y) for y in b): + yield x + + +@overload +def _join( + a: Iterable[FrozenBindings], b: Iterable[Mapping[Identifier, Identifier]] +) -> Generator[FrozenBindings, None, None]: ... + + +@overload +def _join( + a: Iterable[FrozenDict], b: Iterable[Mapping[Identifier, Identifier]] +) -> Generator[FrozenDict, None, None]: ... + + +def _join( + a: Iterable[FrozenDict], b: Iterable[Mapping[Identifier, Identifier]] +) -> Generator[FrozenDict, None, None]: + for x in a: + for y in b: + if x.compatible(y): + yield x.merge(y) + + +def _ebv(expr: Union[Literal, Variable, Expr], ctx: FrozenDict) -> bool: + """ + Return true/false for the given expr + Either the expr is itself true/false + or evaluates to something, with the given ctx + + an error is false + """ + + try: + return EBV(expr) + except SPARQLError: + pass + if isinstance(expr, Expr): + try: + return EBV(expr.eval(ctx)) + except SPARQLError: + return False # filter error == False + # type error: Subclass of "Literal" and "CompValue" cannot exist: would have incompatible method signatures + elif isinstance(expr, CompValue): # type: ignore[unreachable] + raise Exception("Weird - filter got a CompValue without evalfn! %r" % expr) + elif isinstance(expr, Variable): + try: + return EBV(ctx[expr]) + except: # noqa: E722 + return False + return False + + +@overload +def _eval( + expr: Union[Literal, URIRef], + ctx: FrozenBindings, + raise_not_bound_error: bool = ..., +) -> Union[Literal, URIRef]: ... + + +@overload +def _eval( + expr: Union[Variable, Expr], + ctx: FrozenBindings, + raise_not_bound_error: bool = ..., +) -> Union[Any, SPARQLError]: ... + + +def _eval( + expr: Union[Literal, URIRef, Variable, Expr], + ctx: FrozenBindings, + raise_not_bound_error: bool = True, +) -> Any: + if isinstance(expr, (Literal, URIRef)): + return expr + if isinstance(expr, Expr): + return expr.eval(ctx) + elif isinstance(expr, Variable): + try: + return ctx[expr] + except KeyError: + if raise_not_bound_error: + raise NotBoundError("Variable %s is not bound" % expr) + else: + return None + elif isinstance(expr, CompValue): # type: ignore[unreachable] + raise Exception("Weird - _eval got a CompValue without evalfn! %r" % expr) + else: + raise Exception("Cannot eval thing: %s (%s)" % (expr, type(expr))) + + +def _filter( + a: Iterable[FrozenDict], expr: Union[Literal, Variable, Expr] +) -> Generator[FrozenDict, None, None]: + for c in a: + if _ebv(expr, c): + yield c + + +def _fillTemplate( + template: Iterable[Tuple[Identifier, Identifier, Identifier]], + solution: _ContextType, +) -> Generator[Tuple[Identifier, Identifier, Identifier], None, None]: + """ + For construct/deleteWhere and friends + + Fill a triple template with instantiated variables + """ + + bnodeMap: DefaultDict[BNode, BNode] = collections.defaultdict(BNode) + for t in template: + s, p, o = t + + _s = solution.get(s) + _p = solution.get(p) + _o = solution.get(o) + + # instantiate new bnodes for each solution + _s, _p, _o = [ + bnodeMap[x] if isinstance(x, BNode) else y for x, y in zip(t, (_s, _p, _o)) + ] + + if _s is not None and _p is not None and _o is not None: + yield (_s, _p, _o) + + +_ValueT = TypeVar("_ValueT", Variable, BNode, URIRef, Literal) + + +def _val(v: _ValueT) -> Tuple[int, _ValueT]: + """utilitity for ordering things""" + if isinstance(v, Variable): + return (0, v) + elif isinstance(v, BNode): + return (1, v) + elif isinstance(v, URIRef): + return (2, v) + elif isinstance(v, Literal): + return (3, v) diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/operators.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/operators.py new file mode 100644 index 0000000000000000000000000000000000000000..fffd383ebabdf16e973051c1f5ca413b10cd900b --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/operators.py @@ -0,0 +1,1255 @@ +""" +This contains evaluation functions for expressions + +They get bound as instances-methods to the CompValue objects from parserutils +using setEvalFn +""" + +from __future__ import annotations + +import datetime as py_datetime # naming conflict with function within this module +import hashlib +import math +import operator as pyop # python operators +import random +import re +import uuid +import warnings +from decimal import ROUND_HALF_DOWN, ROUND_HALF_UP, Decimal, InvalidOperation +from functools import reduce +from typing import Any, Callable, Dict, NoReturn, Optional, Tuple, Union, overload +from urllib.parse import quote + +from pyparsing import ParseResults + +from rdflib.namespace import RDF, XSD +from rdflib.plugins.sparql.datatypes import ( + XSD_DateTime_DTs, + XSD_DTs, + XSD_Duration_DTs, + type_promotion, +) +from rdflib.plugins.sparql.parserutils import CompValue, Expr +from rdflib.plugins.sparql.sparql import ( + FrozenBindings, + QueryContext, + SPARQLError, + SPARQLTypeError, +) +from rdflib.term import ( + BNode, + IdentifiedNode, + Identifier, + Literal, + Node, + URIRef, + Variable, +) +from rdflib.xsd_datetime import Duration, parse_datetime # type: ignore[attr-defined] + + +def Builtin_IRI(expr: Expr, ctx: FrozenBindings) -> URIRef: + """ + http://www.w3.org/TR/sparql11-query/#func-iri + """ + + a = expr.arg + + if isinstance(a, URIRef): + return a + if isinstance(a, Literal): + # type error: Item "None" of "Optional[Prologue]" has no attribute "absolutize" + # type error: Incompatible return value type (got "Union[CompValue, str, None, Any]", expected "URIRef") + return ctx.prologue.absolutize(URIRef(a)) # type: ignore[union-attr,return-value] + + raise SPARQLError("IRI function only accepts URIRefs or Literals/Strings!") + + +def Builtin_isBLANK(expr: Expr, ctx: FrozenBindings) -> Literal: + return Literal(isinstance(expr.arg, BNode)) + + +def Builtin_isLITERAL(expr, ctx) -> Literal: + return Literal(isinstance(expr.arg, Literal)) + + +def Builtin_isIRI(expr, ctx) -> Literal: + return Literal(isinstance(expr.arg, URIRef)) + + +def Builtin_isNUMERIC(expr, ctx) -> Literal: + try: + numeric(expr.arg) + return Literal(True) + except: # noqa: E722 + return Literal(False) + + +def Builtin_BNODE(expr, ctx) -> BNode: + """ + http://www.w3.org/TR/sparql11-query/#func-bnode + """ + + a = expr.arg + + if a is None: + return BNode() + + if isinstance(a, Literal): + return ctx.bnodes[a] # defaultdict does the right thing + + raise SPARQLError("BNode function only accepts no argument or literal/string") + + +def Builtin_ABS(expr: Expr, ctx) -> Literal: + """ + http://www.w3.org/TR/sparql11-query/#func-abs + """ + + return Literal(abs(numeric(expr.arg))) + + +def Builtin_IF(expr: Expr, ctx): + """ + http://www.w3.org/TR/sparql11-query/#func-if + """ + + return expr.arg2 if EBV(expr.arg1) else expr.arg3 + + +def Builtin_RAND(expr: Expr, ctx) -> Literal: + """ + http://www.w3.org/TR/sparql11-query/#idp2133952 + """ + + return Literal(random.random()) + + +def Builtin_UUID(expr: Expr, ctx) -> URIRef: + """ + http://www.w3.org/TR/sparql11-query/#func-strdt + """ + + return URIRef(uuid.uuid4().urn) + + +def Builtin_STRUUID(expr, ctx) -> Literal: + """ + http://www.w3.org/TR/sparql11-query/#func-strdt + """ + + return Literal(str(uuid.uuid4())) + + +def Builtin_MD5(expr: Expr, ctx) -> Literal: + s = string(expr.arg).encode("utf-8") + return Literal(hashlib.md5(s).hexdigest()) + + +def Builtin_SHA1(expr: Expr, ctx) -> Literal: + s = string(expr.arg).encode("utf-8") + return Literal(hashlib.sha1(s).hexdigest()) + + +def Builtin_SHA256(expr: Expr, ctx) -> Literal: + s = string(expr.arg).encode("utf-8") + return Literal(hashlib.sha256(s).hexdigest()) + + +def Builtin_SHA384(expr: Expr, ctx) -> Literal: + s = string(expr.arg).encode("utf-8") + return Literal(hashlib.sha384(s).hexdigest()) + + +def Builtin_SHA512(expr: Expr, ctx) -> Literal: + s = string(expr.arg).encode("utf-8") + return Literal(hashlib.sha512(s).hexdigest()) + + +def Builtin_COALESCE(expr: Expr, ctx): + """ + http://www.w3.org/TR/sparql11-query/#func-coalesce + """ + for x in expr.get("arg", variables=True): + if x is not None and not isinstance(x, (SPARQLError, Variable)): + return x + raise SPARQLError("COALESCE got no arguments that did not evaluate to an error") + + +def Builtin_CEIL(expr: Expr, ctx) -> Literal: + """ + http://www.w3.org/TR/sparql11-query/#func-ceil + """ + + l_ = expr.arg + return Literal(int(math.ceil(numeric(l_))), datatype=l_.datatype) + + +def Builtin_FLOOR(expr: Expr, ctx) -> Literal: + """ + http://www.w3.org/TR/sparql11-query/#func-floor + """ + l_ = expr.arg + return Literal(int(math.floor(numeric(l_))), datatype=l_.datatype) + + +def Builtin_ROUND(expr: Expr, ctx) -> Literal: + """ + http://www.w3.org/TR/sparql11-query/#func-round + """ + + # This used to be just math.bound + # but in py3k bound was changed to + # "round-to-even" behaviour + # this is an ugly work-around + l_ = expr.arg + v = numeric(l_) + v = int(Decimal(v).quantize(1, ROUND_HALF_UP if v > 0 else ROUND_HALF_DOWN)) + return Literal(v, datatype=l_.datatype) + + +def Builtin_REGEX(expr: Expr, ctx) -> Literal: + """ + http://www.w3.org/TR/sparql11-query/#func-regex + Invokes the XPath fn:matches function to match text against a regular + expression pattern. + The regular expression language is defined in XQuery 1.0 and XPath 2.0 + Functions and Operators section 7.6.1 Regular Expression Syntax + """ + + text = string(expr.text) + pattern = string(expr.pattern) + flags = expr.flags + + cFlag = 0 + if flags: + # Maps XPath REGEX flags (http://www.w3.org/TR/xpath-functions/#flags) + # to Python's re flags + flagMap = dict([("i", re.IGNORECASE), ("s", re.DOTALL), ("m", re.MULTILINE)]) + cFlag = reduce(pyop.or_, [flagMap.get(f, 0) for f in flags]) + + return Literal(bool(re.search(str(pattern), text, cFlag))) + + +def Builtin_REPLACE(expr: Expr, ctx) -> Literal: + """ + http://www.w3.org/TR/sparql11-query/#func-substr + """ + text = string(expr.arg) + pattern = string(expr.pattern) + replacement = string(expr.replacement) + flags = expr.flags + + # python uses \1, xpath/sparql uses $1 + # type error: Incompatible types in assignment (expression has type "str", variable has type "Literal") + replacement = re.sub("\\$([0-9]*)", r"\\\1", replacement) # type: ignore[assignment] + + cFlag = 0 + if flags: + # Maps XPath REGEX flags (http://www.w3.org/TR/xpath-functions/#flags) + # to Python's re flags + flagMap = dict([("i", re.IGNORECASE), ("s", re.DOTALL), ("m", re.MULTILINE)]) + cFlag = reduce(pyop.or_, [flagMap.get(f, 0) for f in flags]) + + # @@FIXME@@ either datatype OR lang, NOT both + + return Literal( + re.sub(str(pattern), replacement, text, cFlag), + datatype=text.datatype, + lang=text.language, + ) + + +def Builtin_STRDT(expr: Expr, ctx) -> Literal: + """ + http://www.w3.org/TR/sparql11-query/#func-strdt + """ + + return Literal(str(expr.arg1), datatype=expr.arg2) + + +def Builtin_STRLANG(expr: Expr, ctx) -> Literal: + """ + http://www.w3.org/TR/sparql11-query/#func-strlang + """ + + s = string(expr.arg1) + if s.language or s.datatype: + raise SPARQLError("STRLANG expects a simple literal") + + # TODO: normalisation of lang tag to lower-case + # should probably happen in literal __init__ + return Literal(str(s), lang=str(expr.arg2).lower()) + + +def Builtin_CONCAT(expr: Expr, ctx) -> Literal: + """ + http://www.w3.org/TR/sparql11-query/#func-concat + """ + + # dt/lang passed on only if they all match + + dt = set(x.datatype for x in expr.arg if isinstance(x, Literal)) + # type error: Incompatible types in assignment (expression has type "Optional[str]", variable has type "Set[Optional[str]]") + dt = dt.pop() if len(dt) == 1 else None # type: ignore[assignment] + + lang = set(x.language for x in expr.arg if isinstance(x, Literal)) + # type error: error: Incompatible types in assignment (expression has type "Optional[str]", variable has type "Set[Optional[str]]") + lang = lang.pop() if len(lang) == 1 else None # type: ignore[assignment] + + # NOTE on type errors: this is because same variable is used for two incompatibel types + # type error: Argument "datatype" to "Literal" has incompatible type "Set[Any]"; expected "Optional[str]" [arg-type] + # type error: Argument "lang" to "Literal" has incompatible type "Set[Any]"; expected "Optional[str]" + return Literal("".join(string(x) for x in expr.arg), datatype=dt, lang=lang) # type: ignore[arg-type] + + +def _compatibleStrings(a: Literal, b: Literal) -> None: + string(a) + string(b) + + if b.language and a.language != b.language: + raise SPARQLError("incompatible arguments to str functions") + + +def Builtin_STRSTARTS(expr: Expr, ctx) -> Literal: + """ + http://www.w3.org/TR/sparql11-query/#func-strstarts + """ + + a = expr.arg1 + b = expr.arg2 + _compatibleStrings(a, b) + + return Literal(a.startswith(b)) + + +def Builtin_STRENDS(expr: Expr, ctx) -> Literal: + """ + http://www.w3.org/TR/sparql11-query/#func-strends + """ + a = expr.arg1 + b = expr.arg2 + + _compatibleStrings(a, b) + + return Literal(a.endswith(b)) + + +def Builtin_STRBEFORE(expr: Expr, ctx) -> Literal: + """ + http://www.w3.org/TR/sparql11-query/#func-strbefore + """ + + a = expr.arg1 + b = expr.arg2 + _compatibleStrings(a, b) + + i = a.find(b) + if i == -1: + return Literal("") + else: + return Literal(a[:i], lang=a.language, datatype=a.datatype) + + +def Builtin_STRAFTER(expr: Expr, ctx) -> Literal: + """ + http://www.w3.org/TR/sparql11-query/#func-strafter + """ + + a = expr.arg1 + b = expr.arg2 + _compatibleStrings(a, b) + + i = a.find(b) + if i == -1: + return Literal("") + else: + return Literal(a[i + len(b) :], lang=a.language, datatype=a.datatype) + + +def Builtin_CONTAINS(expr: Expr, ctx) -> Literal: + """ + http://www.w3.org/TR/sparql11-query/#func-strcontains + """ + + a = expr.arg1 + b = expr.arg2 + _compatibleStrings(a, b) + + return Literal(b in a) + + +def Builtin_ENCODE_FOR_URI(expr: Expr, ctx) -> Literal: + return Literal(quote(string(expr.arg).encode("utf-8"), safe="")) + + +def Builtin_SUBSTR(expr: Expr, ctx) -> Literal: + """ + http://www.w3.org/TR/sparql11-query/#func-substr + """ + + a = string(expr.arg) + + start = numeric(expr.start) - 1 + + length = expr.length + if length is not None: + length = numeric(length) + start + + return Literal(a[start:length], lang=a.language, datatype=a.datatype) + + +def Builtin_STRLEN(e: Expr, ctx) -> Literal: + l_ = string(e.arg) + + return Literal(len(l_)) + + +def Builtin_STR(e: Expr, ctx) -> Literal: + arg = e.arg + if isinstance(arg, SPARQLError): + raise arg + return Literal(str(arg)) # plain literal + + +def Builtin_LCASE(e: Expr, ctx) -> Literal: + l_ = string(e.arg) + + return Literal(l_.lower(), datatype=l_.datatype, lang=l_.language) + + +def Builtin_LANGMATCHES(e: Expr, ctx) -> Literal: + """ + http://www.w3.org/TR/sparql11-query/#func-langMatches + + + """ + langTag = string(e.arg1) + langRange = string(e.arg2) + + if str(langTag) == "": + return Literal(False) # nothing matches empty! + + return Literal(_lang_range_check(langRange, langTag)) + + +def Builtin_NOW(e: Expr, ctx) -> Literal: + """ + http://www.w3.org/TR/sparql11-query/#func-now + """ + return Literal(ctx.now) + + +def Builtin_YEAR(e: Expr, ctx) -> Literal: + d = date(e.arg) + return Literal(d.year) + + +def Builtin_MONTH(e: Expr, ctx) -> Literal: + d = date(e.arg) + return Literal(d.month) + + +def Builtin_DAY(e: Expr, ctx) -> Literal: + d = date(e.arg) + return Literal(d.day) + + +def Builtin_HOURS(e: Expr, ctx) -> Literal: + d = datetime(e.arg) + return Literal(d.hour) + + +def Builtin_MINUTES(e: Expr, ctx) -> Literal: + d = datetime(e.arg) + return Literal(d.minute) + + +def Builtin_SECONDS(e: Expr, ctx) -> Literal: + """ + http://www.w3.org/TR/sparql11-query/#func-seconds + """ + d = datetime(e.arg) + result_value = Decimal(d.second) + if d.microsecond: + result_value += Decimal(d.microsecond) / Decimal(1000000) + return Literal(result_value, datatype=XSD.decimal) + + +def Builtin_TIMEZONE(e: Expr, ctx) -> Literal: + """ + http://www.w3.org/TR/sparql11-query/#func-timezone + + Returns: + The timezone part of arg as an xsd:dayTimeDuration. + + Raises: + An error if there is no timezone. + """ + dt = datetime(e.arg) + if not dt.tzinfo: + raise SPARQLError("datatime has no timezone: %r" % dt) + + delta = dt.utcoffset() + + # type error: Item "None" of "Optional[timedelta]" has no attribute "days" + d = delta.days # type: ignore[union-attr] + # type error: Item "None" of "Optional[timedelta]" has no attribute "seconds" + s = delta.seconds # type: ignore[union-attr] + neg = "" + + if d < 0: + s = -24 * 60 * 60 * d - s + d = 0 + neg = "-" + + h = s / (60 * 60) + m = (s - h * 60 * 60) / 60 + s = s - h * 60 * 60 - m * 60 + + tzdelta = "%sP%sT%s%s%s" % ( + neg, + "%dD" % d if d else "", + "%dH" % h if h else "", + "%dM" % m if m else "", + "%dS" % s if not d and not h and not m else "", + ) + + return Literal(tzdelta, datatype=XSD.dayTimeDuration) + + +def Builtin_TZ(e: Expr, ctx) -> Literal: + d = datetime(e.arg) + if not d.tzinfo: + return Literal("") + n = d.tzinfo.tzname(d) + if n is None: + n = "" + elif n == "UTC": + n = "Z" + elif n.startswith("UTC"): + # Replace tzname like "UTC-05:00" with simply "-05:00" to match Jena tz fn + n = n[3:] + return Literal(n) + + +def Builtin_UCASE(e: Expr, ctx) -> Literal: + l_ = string(e.arg) + + return Literal(l_.upper(), datatype=l_.datatype, lang=l_.language) + + +def Builtin_LANG(e: Expr, ctx) -> Literal: + """http://www.w3.org/TR/sparql11-query/#func-lang + + Returns the language tag of ltrl, if it has one. It returns "" if ltrl has + no language tag. Note that the RDF data model does not include literals + with an empty language tag. + """ + + l_ = literal(e.arg) + return Literal(l_.language or "") + + +def Builtin_DATATYPE(e: Expr, ctx) -> Optional[str]: + l_ = e.arg + if not isinstance(l_, Literal): + raise SPARQLError("Can only get datatype of literal: %r" % l_) + if l_.language: + return RDF.langString + if not l_.datatype and not l_.language: + return XSD.string + return l_.datatype + + +def Builtin_sameTerm(e: Expr, ctx) -> Literal: + a = e.arg1 + b = e.arg2 + return Literal(a == b) + + +def Builtin_BOUND(e: Expr, ctx) -> Literal: + """ + http://www.w3.org/TR/sparql11-query/#func-bound + """ + n = e.get("arg", variables=True) + + return Literal(not isinstance(n, Variable)) + + +def Builtin_EXISTS(e: Expr, ctx: FrozenBindings) -> Literal: + # damn... + from rdflib.plugins.sparql.evaluate import evalPart + + exists = e.name == "Builtin_EXISTS" + + # type error: Incompatible types in assignment (expression has type "QueryContext", variable has type "FrozenBindings") + ctx = ctx.ctx.thaw(ctx) # type: ignore[assignment] # hmm + # type error: Argument 1 to "evalPart" has incompatible type "FrozenBindings"; expected "QueryContext" + for x in evalPart(ctx, e.graph): # type: ignore[arg-type] + return Literal(exists) + return Literal(not exists) + + +_CustomFunction = Callable[[Expr, FrozenBindings], Node] + +_CUSTOM_FUNCTIONS: Dict[URIRef, Tuple[_CustomFunction, bool]] = {} + + +def register_custom_function( + uri: URIRef, func: _CustomFunction, override: bool = False, raw: bool = False +) -> None: + """Register a custom SPARQL function. + + By default, the function will be passed the RDF terms in the argument list. + If raw is True, the function will be passed an Expression and a Context. + + The function must return an RDF term, or raise a SparqlError. + """ + if not override and uri in _CUSTOM_FUNCTIONS: + raise ValueError("A function is already registered as %s" % uri.n3()) + _CUSTOM_FUNCTIONS[uri] = (func, raw) + + +def custom_function( + uri: URIRef, override: bool = False, raw: bool = False +) -> Callable[[_CustomFunction], _CustomFunction]: + """ + Decorator version of :func:`register_custom_function`. + """ + + def decorator(func: _CustomFunction) -> _CustomFunction: + register_custom_function(uri, func, override=override, raw=raw) + return func + + return decorator + + +def unregister_custom_function( + uri: URIRef, func: Optional[Callable[..., Any]] = None +) -> None: + """ + The 'func' argument is included for compatibility with existing code. + A previous implementation checked that the function associated with + the given uri was actually 'func', but this is not necessary as the + uri should uniquely identify the function. + """ + if _CUSTOM_FUNCTIONS.get(uri): + del _CUSTOM_FUNCTIONS[uri] + else: + warnings.warn("This function is not registered as %s" % uri.n3()) + + +def Function(e: Expr, ctx: FrozenBindings) -> Node: + """ + Custom functions and casts + """ + pair = _CUSTOM_FUNCTIONS.get(e.iri) + if pair is None: + # no such function is registered + raise SPARQLError("Unknown function %r" % e.iri) + func, raw = pair + if raw: + # function expects expression and context + return func(e, ctx) + else: + # function expects the argument list + try: + return func(*e.expr) + except TypeError as ex: + # wrong argument number + raise SPARQLError(*ex.args) + + +@custom_function(XSD.string, raw=True) +@custom_function(XSD.dateTime, raw=True) +@custom_function(XSD.float, raw=True) +@custom_function(XSD.double, raw=True) +@custom_function(XSD.decimal, raw=True) +@custom_function(XSD.integer, raw=True) +@custom_function(XSD.boolean, raw=True) +def default_cast(e: Expr, ctx: FrozenBindings) -> Literal: # type: ignore[return] + if not e.expr: + raise SPARQLError("Nothing given to cast.") + if len(e.expr) > 1: + raise SPARQLError("Cannot cast more than one thing!") + + x = e.expr[0] + + if e.iri == XSD.string: + if isinstance(x, (URIRef, Literal)): + return Literal(x, datatype=XSD.string) + else: + raise SPARQLError("Cannot cast term %r of type %r" % (x, type(x))) + + if not isinstance(x, Literal): + raise SPARQLError("Can only cast Literals to non-string data-types") + + if x.datatype and not x.datatype in XSD_DTs: # noqa: E713 + raise SPARQLError("Cannot cast literal with unknown datatype: %r" % x.datatype) + + if e.iri == XSD.dateTime: + if x.datatype and x.datatype not in (XSD.dateTime, XSD.string): + raise SPARQLError("Cannot cast %r to XSD:dateTime" % x.datatype) + try: + return Literal(parse_datetime(x), datatype=e.iri) + except: # noqa: E722 + raise SPARQLError("Cannot interpret '%r' as datetime" % x) + + if x.datatype == XSD.dateTime: + raise SPARQLError("Cannot cast XSD.dateTime to %r" % e.iri) + + if e.iri in (XSD.float, XSD.double): + try: + return Literal(float(x), datatype=e.iri) + except: # noqa: E722 + raise SPARQLError("Cannot interpret '%r' as float" % x) + + elif e.iri == XSD.decimal: + if "e" in x or "E" in x: # SPARQL/XSD does not allow exponents in decimals + raise SPARQLError("Cannot interpret '%r' as decimal" % x) + try: + return Literal(Decimal(x), datatype=e.iri) + except: # noqa: E722 + raise SPARQLError("Cannot interpret '%r' as decimal" % x) + + elif e.iri == XSD.integer: + try: + return Literal(int(x), datatype=XSD.integer) + except: # noqa: E722 + raise SPARQLError("Cannot interpret '%r' as int" % x) + + elif e.iri == XSD.boolean: + # # I would argue that any number is True... + # try: + # return Literal(bool(int(x)), datatype=XSD.boolean) + # except: + if x.lower() in ("1", "true"): + return Literal(True) + if x.lower() in ("0", "false"): + return Literal(False) + raise SPARQLError("Cannot interpret '%r' as bool" % x) + + +def UnaryNot(expr: Expr, ctx: FrozenBindings) -> Literal: + return Literal(not EBV(expr.expr)) + + +def UnaryMinus(expr: Expr, ctx: FrozenBindings) -> Literal: + return Literal(-numeric(expr.expr)) + + +def UnaryPlus(expr: Expr, ctx: FrozenBindings) -> Literal: + return Literal(+numeric(expr.expr)) + + +def MultiplicativeExpression( + e: Expr, ctx: Union[QueryContext, FrozenBindings] +) -> Literal: + expr = e.expr + other = e.other + + # because of the way the mul-expr production handled operator precedence + # we sometimes have nothing to do + if other is None: + return expr + try: + res: Union[Decimal, float] + res = Decimal(numeric(expr)) + for op, f in zip(e.op, other): + f = numeric(f) + + if type(f) == float: # noqa: E721 + res = float(res) + + if op == "*": + res *= f + else: + res /= f + except (InvalidOperation, ZeroDivisionError): + raise SPARQLError("divide by 0") + + return Literal(res) + + +# type error: Missing return statement +def AdditiveExpression(e: Expr, ctx: Union[QueryContext, FrozenBindings]) -> Literal: # type: ignore[return] + expr = e.expr + other = e.other + + # because of the way the add-expr production handled operator precedence + # we sometimes have nothing to do + if other is None: + return expr + + # handling arithmetic(addition/subtraction) of dateTime, date, time + # and duration datatypes (if any) + if hasattr(expr, "datatype") and ( + expr.datatype in XSD_DateTime_DTs or expr.datatype in XSD_Duration_DTs + ): + res = dateTimeObjects(expr) + dt = expr.datatype + + for op, term in zip(e.op, other): + # check if operation is datetime,date,time operation over + # another datetime,date,time datatype + if dt in XSD_DateTime_DTs and dt == term.datatype and op == "-": + # checking if there are more than one datetime operands - + # in that case it doesn't make sense for example + # ( dateTime1 - dateTime2 - dateTime3 ) is an invalid operation + if len(other) > 1: + error_message = "Can't evaluate multiple %r arguments" + # type error: Too many arguments for "SPARQLError" + raise SPARQLError(error_message, dt.datatype) # type: ignore[call-arg] + else: + n = dateTimeObjects(term) + res = calculateDuration(res, n) + return res + + # datetime,date,time +/- duration,dayTimeDuration,yearMonthDuration + elif dt in XSD_DateTime_DTs and term.datatype in XSD_Duration_DTs: + n = dateTimeObjects(term) + res = calculateFinalDateTime(res, dt, n, term.datatype, op) + return res + + # duration,dayTimeDuration,yearMonthDuration + datetime,date,time + elif dt in XSD_Duration_DTs and term.datatype in XSD_DateTime_DTs: + if op == "+": + n = dateTimeObjects(term) + res = calculateFinalDateTime(res, dt, n, term.datatype, op) + return res + + # rest are invalid types + else: + raise SPARQLError("Invalid DateTime Operations") + + # handling arithmetic(addition/subtraction) of numeric datatypes (if any) + else: + res = numeric(expr) + + dt = expr.datatype + + for op, term in zip(e.op, other): + n = numeric(term) + if isinstance(n, Decimal) and isinstance(res, float): + n = float(n) + if isinstance(n, float) and isinstance(res, Decimal): + res = float(res) + + dt = type_promotion(dt, term.datatype) + + if op == "+": + res += n + else: + res -= n + + return Literal(res, datatype=dt) + + +def RelationalExpression(e: Expr, ctx: Union[QueryContext, FrozenBindings]) -> Literal: + expr = e.expr + other = e.other + op = e.op + + # because of the way the add-expr production handled operator precedence + # we sometimes have nothing to do + if other is None: + return expr + + ops = dict( + [ + (">", lambda x, y: x.__gt__(y)), + ("<", lambda x, y: x.__lt__(y)), + ("=", lambda x, y: x.eq(y)), + ("!=", lambda x, y: x.neq(y)), + (">=", lambda x, y: x.__ge__(y)), + ("<=", lambda x, y: x.__le__(y)), + ("IN", pyop.contains), + ("NOT IN", lambda x, y: not pyop.contains(x, y)), + ] + ) + + if op in ("IN", "NOT IN"): + res = op == "NOT IN" + + error: Union[bool, SPARQLError] = False + + if other == RDF.nil: + other = [] + + for x in other: + try: + if x == expr: + return Literal(True ^ res) + except SPARQLError as e: + error = e + if not error: + return Literal(False ^ res) + else: + # Note on type error: this is because variable is Union[bool, SPARQLError] + # type error: Exception must be derived from BaseException + raise error # type: ignore[misc] + + if op not in ("=", "!=", "IN", "NOT IN"): + if not isinstance(expr, Literal): + raise SPARQLError( + "Compare other than =, != of non-literals is an error: %r" % expr + ) + if not isinstance(other, Literal): + raise SPARQLError( + "Compare other than =, != of non-literals is an error: %r" % other + ) + else: + if not isinstance(expr, Node): + raise SPARQLError("I cannot compare this non-node: %r" % expr) + if not isinstance(other, Node): + raise SPARQLError("I cannot compare this non-node: %r" % other) + + if isinstance(expr, Literal) and isinstance(other, Literal): + if ( + expr.datatype is not None + and expr.datatype not in XSD_DTs + and other.datatype is not None + and other.datatype not in XSD_DTs + ): + # in SPARQL for non-XSD DT Literals we can only do =,!= + if op not in ("=", "!="): + raise SPARQLError("Can only do =,!= comparisons of non-XSD Literals") + + try: + r = ops[op](expr, other) + if r == NotImplemented: + raise SPARQLError("Error when comparing") + except TypeError as te: + raise SPARQLError(*te.args) + return Literal(r) + + +def ConditionalAndExpression( + e: Expr, ctx: Union[QueryContext, FrozenBindings] +) -> Literal: + # TODO: handle returned errors + + expr = e.expr + other = e.other + + # because of the way the add-expr production handled operator precedence + # we sometimes have nothing to do + if other is None: + return expr + + return Literal(all(EBV(x) for x in [expr] + other)) + + +def ConditionalOrExpression( + e: Expr, ctx: Union[QueryContext, FrozenBindings] +) -> Literal: + # TODO: handle errors + + expr = e.expr + other = e.other + + # because of the way the add-expr production handled operator precedence + # we sometimes have nothing to do + if other is None: + return expr + # A logical-or that encounters an error on only one branch + # will return TRUE if the other branch is TRUE and an error + # if the other branch is FALSE. + error = None + for x in [expr] + other: + try: + if EBV(x): + return Literal(True) + except SPARQLError as e: + error = e + if error: + raise error + return Literal(False) + + +def not_(arg) -> Expr: + return Expr("UnaryNot", UnaryNot, expr=arg) + + +def and_(*args: Expr) -> Expr: + if len(args) == 1: + return args[0] + + return Expr( + "ConditionalAndExpression", + ConditionalAndExpression, + expr=args[0], + other=list(args[1:]), + ) + + +TrueFilter = Expr("TrueFilter", lambda _1, _2: Literal(True)) + + +def simplify(expr: Any) -> Any: + if isinstance(expr, ParseResults) and len(expr) == 1: + return simplify(expr[0]) + + if isinstance(expr, (list, ParseResults)): + return list(map(simplify, expr)) + if not isinstance(expr, CompValue): + return expr + if expr.name.endswith("Expression"): + if expr.other is None: + return simplify(expr.expr) + + for k in expr.keys(): + expr[k] = simplify(expr[k]) + # expr['expr']=simplify(expr.expr) + # expr['other']=simplify(expr.other) + + return expr + + +def literal(s: Literal) -> Literal: + if not isinstance(s, Literal): + raise SPARQLError("Non-literal passed as string: %r" % s) + return s + + +def datetime(e: Literal) -> py_datetime.datetime: + if not isinstance(e, Literal): + raise SPARQLError("Non-literal passed as datetime: %r" % e) + if not e.datatype == XSD.dateTime: + raise SPARQLError("Literal with wrong datatype passed as datetime: %r" % e) + return e.toPython() + + +def date(e: Literal) -> py_datetime.date: + if not isinstance(e, Literal): + raise SPARQLError("Non-literal passed as date: %r" % e) + if e.datatype not in (XSD.date, XSD.dateTime): + raise SPARQLError("Literal with wrong datatype passed as date: %r" % e) + result = e.toPython() + if isinstance(result, py_datetime.datetime): + return result.date() + return result + + +def string(s: Literal) -> Literal: + """ + Make sure the passed thing is a string literal + i.e. plain literal, xsd:string literal or lang-tagged literal + """ + if not isinstance(s, Literal): + raise SPARQLError("Non-literal passes as string: %r" % s) + if s.datatype and s.datatype != XSD.string: + raise SPARQLError("Non-string datatype-literal passes as string: %r" % s) + return s + + +def numeric(expr: Literal) -> Any: + """ + return a number from a literal + http://www.w3.org/TR/xpath20/#promotion + + or TypeError + """ + + if not isinstance(expr, Literal): + raise SPARQLTypeError("%r is not a literal!" % expr) + + if expr.datatype not in ( + XSD.float, + XSD.double, + XSD.decimal, + XSD.integer, + XSD.nonPositiveInteger, + XSD.negativeInteger, + XSD.nonNegativeInteger, + XSD.positiveInteger, + XSD.unsignedLong, + XSD.unsignedInt, + XSD.unsignedShort, + XSD.unsignedByte, + XSD.long, + XSD.int, + XSD.short, + XSD.byte, + ): + raise SPARQLTypeError("%r does not have a numeric datatype!" % expr) + + return expr.toPython() + + +def dateTimeObjects(expr: Literal) -> Any: + """ + return a dataTime/date/time/duration/dayTimeDuration/yearMonthDuration python objects from a literal + """ + return expr.toPython() + + +# type error: Missing return statement +def isCompatibleDateTimeDatatype( # type: ignore[return] + obj1: Union[py_datetime.date, py_datetime.datetime], + dt1: URIRef, + obj2: Union[Duration, py_datetime.timedelta], + dt2: URIRef, +) -> bool: + """ + Returns a boolean indicating if first object is compatible + with operation(+/-) over second object. + """ + if dt1 == XSD.date: + if dt2 == XSD.yearMonthDuration: + return True + elif dt2 == XSD.dayTimeDuration or dt2 == XSD.Duration: + # checking if the dayTimeDuration has no Time Component + # else it won't be compatible with Date Literal + if "T" in str(obj2): + return False + else: + return True + + if dt1 == XSD.time: + if dt2 == XSD.yearMonthDuration: + return False + elif dt2 == XSD.dayTimeDuration or dt2 == XSD.Duration: + # checking if the dayTimeDuration has no Date Component + # (by checking if the format is "PT...." ) + # else it won't be compatible with Time Literal + if "T" == str(obj2)[1]: + return True + else: + return False + + if dt1 == XSD.dateTime: + # compatible with all + return True + + +def calculateDuration( + obj1: Union[py_datetime.date, py_datetime.datetime], + obj2: Union[py_datetime.date, py_datetime.datetime], +) -> Literal: + """ + returns the duration Literal between two datetime + """ + date1 = obj1 + date2 = obj2 + # type error: No overload variant of "__sub__" of "datetime" matches argument type "date" + difference = date1 - date2 # type: ignore[operator] + return Literal(difference, datatype=XSD.duration) + + +def calculateFinalDateTime( + obj1: Union[py_datetime.date, py_datetime.datetime], + dt1: URIRef, + obj2: Union[Duration, py_datetime.timedelta], + dt2: URIRef, + operation: str, +) -> Literal: + """ + Calculates the final dateTime/date/time resultant after addition/ + subtraction of duration/dayTimeDuration/yearMonthDuration + """ + + # checking compatibility of datatypes (duration types and date/time/dateTime) + if isCompatibleDateTimeDatatype(obj1, dt1, obj2, dt2): + # proceed + if operation == "-": + ans = obj1 - obj2 + return Literal(ans, datatype=dt1) + else: + ans = obj1 + obj2 + return Literal(ans, datatype=dt1) + + else: + raise SPARQLError("Incompatible Data types to DateTime Operations") + + +@overload +def EBV(rt: Literal) -> bool: ... + + +@overload +def EBV(rt: Union[Variable, IdentifiedNode, SPARQLError, Expr]) -> NoReturn: ... + + +@overload +def EBV(rt: Union[Identifier, SPARQLError, Expr]) -> Union[bool, NoReturn]: ... + + +def EBV(rt: Union[Identifier, SPARQLError, Expr]) -> bool: + """Effective Boolean Value (EBV) + + * If the argument is a typed literal with a datatype of xsd:boolean, + the EBV is the value of that argument. + * If the argument is a plain literal or a typed literal with a + datatype of xsd:string, the EBV is false if the operand value + has zero length; otherwise the EBV is true. + * If the argument is a numeric type or a typed literal with a datatype + derived from a numeric type, the EBV is false if the operand value is + NaN or is numerically equal to zero; otherwise the EBV is true. + * All other arguments, including unbound arguments, produce a type error. + """ + + if isinstance(rt, Literal): + if rt.datatype == XSD.boolean: + return rt.toPython() + + elif rt.datatype == XSD.string or rt.datatype is None: + return len(rt) > 0 + + else: + pyRT = rt.toPython() + + if isinstance(pyRT, Literal): + # Type error, see: http://www.w3.org/TR/rdf-sparql-query/#ebv + raise SPARQLTypeError( + "http://www.w3.org/TR/rdf-sparql-query/#ebv - ' + \ + 'Could not determine the EBV for : %r" + % rt + ) + else: + return bool(pyRT) + + else: + raise SPARQLTypeError( + "http://www.w3.org/TR/rdf-sparql-query/#ebv - ' + \ + 'Only literals have Boolean values! %r" + % rt + ) + + +def _lang_range_check(range: Literal, lang: Literal) -> bool: + """ + Implementation of the extended filtering algorithm, as defined in point + 3.3.2, of [RFC 4647](http://www.rfc-editor.org/rfc/rfc4647.txt), on + matching language ranges and language tags. + Needed to handle the `rdf:PlainLiteral` datatype. + + Args: + range: language range + lang: language tag + + Author: [Ivan Herman](http://www.w3.org/People/Ivan/) + + Taken from [`RDFClosure/RestrictedDatatype.py`](http://dev.w3.org/2004/PythonLib-IH/RDFClosure/RestrictedDatatype.py) + """ + + def _match(r: str, l_: str) -> bool: + """ + Matching of a range and language item: either range is a wildcard + or the two are equal + + Args: + r: language range item + l_: language tag item + """ + return r == "*" or r == l_ + + rangeList = range.strip().lower().split("-") + langList = lang.strip().lower().split("-") + if not _match(rangeList[0], langList[0]): + return False + if len(rangeList) > len(langList): + return False + + return all(_match(*x) for x in zip(rangeList, langList)) diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/parser.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/parser.py new file mode 100644 index 0000000000000000000000000000000000000000..beb7aa6f7e8e67b43df837d1b614c257e2d4cd1d --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/parser.py @@ -0,0 +1,1567 @@ +""" +SPARQL 1.1 Parser + +based on pyparsing +""" + +from __future__ import annotations # noqa: I001 + +import re +import sys +from typing import Any, BinaryIO, List +from typing import Optional as OptionalType +from typing import TextIO, Tuple, Union + +from pyparsing import CaselessKeyword as Keyword # watch out :) +from pyparsing import ( + Combine, + Forward, + Group, + Literal, + OneOrMore, + Optional, + ParseResults, + Regex, + Suppress, + ZeroOrMore, +) + +import rdflib +from rdflib.compat import decodeUnicodeEscape + +from . import operators as op +from .pyparsing_compat import DelimitedList, combine_join_kwargs, rest_of_line +from .parserutils import Comp, CompValue, Param, ParamList + +# from pyparsing import Keyword as CaseSensitiveKeyword + + +DEBUG = False + +# ---------------- ACTIONS + + +def neg(literal: rdflib.Literal) -> rdflib.Literal: + return rdflib.Literal(-literal, datatype=literal.datatype) + + +def setLanguage(terms: Tuple[Any, OptionalType[str]]) -> rdflib.Literal: + return rdflib.Literal(terms[0], lang=terms[1]) + + +def setDataType(terms: Tuple[Any, OptionalType[str]]) -> rdflib.Literal: + return rdflib.Literal(terms[0], datatype=terms[1]) + + +def expandTriples(terms: ParseResults) -> List[Any]: + """ + Expand ; and , syntax for repeat predicates, subjects + """ + # import pdb; pdb.set_trace() + last_subject, last_predicate = None, None # Used for ; and , + try: + res: List[Any] = [] + if DEBUG: + print("Terms", terms) + l_ = len(terms) + for i, t in enumerate(terms): + if t == ",": + res.extend([last_subject, last_predicate]) + elif t == ";": + if i + 1 == len(terms) or terms[i + 1] == ";" or terms[i + 1] == ".": + continue # this semicolon is spurious + res.append(last_subject) + elif isinstance(t, list): + # BlankNodePropertyList + # is this bnode the object of previous triples? + if (len(res) % 3) == 2: + res.append(t[0]) + # is this a single [] ? + if len(t) > 1: + res += t # Don't update last_subject/last_predicate + # is this bnode the subject of more triples? + if i + 1 < l_ and terms[i + 1] not in [ + ".", + ",", + ";", + ]: # term might not be a string + last_subject, last_predicate = t[0], None + res.append(t[0]) + elif isinstance(t, ParseResults): + res += t.as_list() + elif t != ".": + res.append(t) + if (len(res) % 3) == 1: + last_subject = t + elif (len(res) % 3) == 2: + last_predicate = t + if DEBUG: + print(len(res), t) + if DEBUG: + import json + + print(json.dumps(res, indent=2)) + + return res + # print res + # assert len(res)%3 == 0, \ + # "Length of triple-list is not divisible by 3: %d!"%len(res) + + # return [tuple(res[i:i+3]) for i in range(len(res)/3)] + except: + if DEBUG: + import traceback + + traceback.print_exc() + raise + + +def expandBNodeTriples(terms: ParseResults) -> List[Any]: + """ + expand [ ?p ?o ] syntax for implicit bnodes + """ + # import pdb; pdb.set_trace() + try: + if DEBUG: + print("Bnode terms", terms) + print("1", terms[0]) + print("2", [rdflib.BNode()] + terms.as_list()[0]) + return [expandTriples([rdflib.BNode()] + terms.as_list()[0])] + except Exception as e: + if DEBUG: + print(">>>>>>>>", e) + raise + + +def expandCollection(terms: ParseResults) -> List[List[Any]]: + """ + expand ( 1 2 3 ) notation for collections + """ + if DEBUG: + print("Collection: ", terms) + + res: List[Any] = [] + other = [] + for x in terms: + if isinstance(x, list): # is this a [ .. ] ? + other += x + x = x[0] + + b = rdflib.BNode() + if res: + res += [res[-3], rdflib.RDF.rest, b, b, rdflib.RDF.first, x] + else: + res += [b, rdflib.RDF.first, x] + res += [b, rdflib.RDF.rest, rdflib.RDF.nil] + + res += other + + if DEBUG: + print("CollectionOut", res) + return [res] + + +# SPARQL Grammar from http://www.w3.org/TR/sparql11-query/#grammar +# ------ TERMINALS -------------- +# [139] IRIREF ::= '<' ([^<>"{}|^`\]-[#x00-#x20])* '>' +IRIREF = Combine( + Suppress("<") + + Regex(r'[^<>"{}|^`\\%s]*' % "".join("\\x%02X" % i for i in range(33))) + + Suppress(">") +) +IRIREF.set_parse_action(lambda x: rdflib.URIRef(x[0])) + +# [164] P_CHARS_BASE ::= [A-Z] | [a-z] | [#x00C0-#x00D6] | [#x00D8-#x00F6] | [#x00F8-#x02FF] | [#x0370-#x037D] | [#x037F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF] + +if sys.maxunicode == 0xFFFF: + # this is narrow python build (default on windows/osx) + # this means that unicode code points over 0xffff are stored + # as several characters, which in turn means that regex character + # ranges with these characters do not work. + # See + # * http://bugs.python.org/issue12729 + # * http://bugs.python.org/issue12749 + # * http://bugs.python.org/issue3665 + # + # Here we simple skip the [#x10000-#xEFFFF] part + # this means that some SPARQL queries will not parse :( + # We *could* generate a new regex with \U00010000|\U00010001 ... + # but it would be quite long :) + # + # in py3.3 this is fixed + + PN_CHARS_BASE_re = "A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD" +else: + # wide python build + PN_CHARS_BASE_re = "A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\U00010000-\U000EFFFF" + +# [165] PN_CHARS_U ::= PN_CHARS_BASE | '_' +PN_CHARS_U_re = "_" + PN_CHARS_BASE_re + +# [167] PN_CHARS ::= PN_CHARS_U | '-' | [0-9] | #x00B7 | [#x0300-#x036F] | [#x203F-#x2040] +PN_CHARS_re = "\\-0-9\u00B7\u0300-\u036F\u203F-\u2040" + PN_CHARS_U_re +# PN_CHARS = Regex(u'[%s]'%PN_CHARS_re, flags=re.U) + +# [168] PN_PREFIX ::= PN_CHARS_BASE ((PN_CHARS|'.')* PN_CHARS)? +PN_PREFIX = Regex( + "[%s](?:[%s\\.]*[%s])?" % (PN_CHARS_BASE_re, PN_CHARS_re, PN_CHARS_re), flags=re.U +) + +# [140] PNAME_NS ::= PN_PREFIX? ':' +PNAME_NS = Optional(Param("prefix", PN_PREFIX)) + Suppress(":").leave_whitespace() + +# [173] PN_LOCAL_ESC ::= '\' ( '_' | '~' | '.' | '-' | '!' | '$' | '&' | "'" | '(' | ')' | '*' | '+' | ',' | ';' | '=' | '/' | '?' | '#' | '@' | '%' ) + +PN_LOCAL_ESC_re = "\\\\[_~\\.\\-!$&\"'()*+,;=/?#@%]" +# PN_LOCAL_ESC = Regex(PN_LOCAL_ESC_re) # regex'd +# PN_LOCAL_ESC.set_parse_action(lambda x: x[0][1:]) + +# [172] HEX ::= [0-9] | [A-F] | [a-f] +# HEX = Regex('[0-9A-Fa-f]') # not needed + +# [171] PERCENT ::= '%' HEX HEX +PERCENT_re = "%[0-9a-fA-F]{2}" +# PERCENT = Regex(PERCENT_re) # regex'd +# PERCENT.set_parse_action(lambda x: chr(int(x[0][1:], 16))) + +# [170] PLX ::= PERCENT | PN_LOCAL_ESC +PLX_re = "(%s|%s)" % (PN_LOCAL_ESC_re, PERCENT_re) +# PLX = PERCENT | PN_LOCAL_ESC # regex'd + + +# [169] PN_LOCAL ::= (PN_CHARS_U | ':' | [0-9] | PLX ) ((PN_CHARS | '.' | ':' | PLX)* (PN_CHARS | ':' | PLX) )? + +PN_LOCAL = Regex( + """([%(PN_CHARS_U)s:0-9]|%(PLX)s) + (([%(PN_CHARS)s\\.:]|%(PLX)s)* + ([%(PN_CHARS)s:]|%(PLX)s) )?""" + % dict(PN_CHARS_U=PN_CHARS_U_re, PN_CHARS=PN_CHARS_re, PLX=PLX_re), + flags=re.X | re.UNICODE, +) + + +# [141] PNAME_LN ::= PNAME_NS PN_LOCAL +PNAME_LN = PNAME_NS + Param("localname", PN_LOCAL.leave_whitespace()) + +# [142] BLANK_NODE_LABEL ::= '_:' ( PN_CHARS_U | [0-9] ) ((PN_CHARS|'.')* PN_CHARS)? +BLANK_NODE_LABEL = Regex( + "_:[0-9%s](?:[\\.%s]*[%s])?" % (PN_CHARS_U_re, PN_CHARS_re, PN_CHARS_re), + flags=re.U, +) +BLANK_NODE_LABEL.set_parse_action(lambda x: rdflib.BNode(x[0][2:])) + + +# [166] VARNAME ::= ( PN_CHARS_U | [0-9] ) ( PN_CHARS_U | [0-9] | #x00B7 | [#x0300-#x036F] | [#x203F-#x2040] )* +VARNAME = Regex( + "[%s0-9][%s0-9\u00B7\u0300-\u036F\u203F-\u2040]*" % (PN_CHARS_U_re, PN_CHARS_U_re), + flags=re.U, +) + +# [143] VAR1 ::= '?' VARNAME +VAR1 = Combine(Suppress("?") + VARNAME) + +# [144] VAR2 ::= '$' VARNAME +VAR2 = Combine(Suppress("$") + VARNAME) + +# [145] LANGTAG ::= '@' [a-zA-Z]+ ('-' [a-zA-Z0-9]+)* +LANGTAG = Combine(Suppress("@") + Regex("[a-zA-Z]+(?:-[a-zA-Z0-9]+)*")) + +# [146] INTEGER ::= [0-9]+ +INTEGER = Regex(r"[0-9]+") +# INTEGER.set_results_name('integer') +INTEGER.set_parse_action(lambda x: rdflib.Literal(x[0], datatype=rdflib.XSD.integer)) + +# [155] EXPONENT ::= [eE] [+-]? [0-9]+ +EXPONENT_re = "[eE][+-]?[0-9]+" + +# [147] DECIMAL ::= [0-9]* '.' [0-9]+ +DECIMAL = Regex(r"[0-9]*\.[0-9]+") # (?![eE]) +# DECIMAL.set_results_name('decimal') +DECIMAL.set_parse_action(lambda x: rdflib.Literal(x[0], datatype=rdflib.XSD.decimal)) + +# [148] DOUBLE ::= [0-9]+ '.' [0-9]* EXPONENT | '.' ([0-9])+ EXPONENT | ([0-9])+ EXPONENT +DOUBLE = Regex(r"[0-9]+\.[0-9]*%(e)s|\.([0-9])+%(e)s|[0-9]+%(e)s" % {"e": EXPONENT_re}) +# DOUBLE.set_results_name('double') +DOUBLE.set_parse_action(lambda x: rdflib.Literal(x[0], datatype=rdflib.XSD.double)) + + +# [149] INTEGER_POSITIVE ::= '+' INTEGER +INTEGER_POSITIVE = Suppress("+") + INTEGER.copy().leave_whitespace() +INTEGER_POSITIVE.set_parse_action( + lambda x: rdflib.Literal("+" + x[0], datatype=rdflib.XSD.integer) +) + +# [150] DECIMAL_POSITIVE ::= '+' DECIMAL +DECIMAL_POSITIVE = Suppress("+") + DECIMAL.copy().leave_whitespace() + +# [151] DOUBLE_POSITIVE ::= '+' DOUBLE +DOUBLE_POSITIVE = Suppress("+") + DOUBLE.copy().leave_whitespace() + +# [152] INTEGER_NEGATIVE ::= '-' INTEGER +INTEGER_NEGATIVE = Suppress("-") + INTEGER.copy().leave_whitespace() +INTEGER_NEGATIVE.set_parse_action(lambda x: neg(x[0])) + +# [153] DECIMAL_NEGATIVE ::= '-' DECIMAL +DECIMAL_NEGATIVE = Suppress("-") + DECIMAL.copy().leave_whitespace() +DECIMAL_NEGATIVE.set_parse_action(lambda x: neg(x[0])) + +# [154] DOUBLE_NEGATIVE ::= '-' DOUBLE +DOUBLE_NEGATIVE = Suppress("-") + DOUBLE.copy().leave_whitespace() +DOUBLE_NEGATIVE.set_parse_action(lambda x: neg(x[0])) + +# [160] ECHAR ::= '\' [tbnrf\"'] +# ECHAR = Regex('\\\\[tbnrf"\']') + + +# [158] STRING_LITERAL_LONG1 ::= "'''" ( ( "'" | "''" )? ( [^'\] | ECHAR ) )* "'''" +# STRING_LITERAL_LONG1 = Literal("'''") + ( Optional( Literal("'") | "''" +# ) + ZeroOrMore( ~ Literal("'\\") | ECHAR ) ) + "'''" +STRING_LITERAL_LONG1 = Regex("'''((?:'|'')?(?:[^'\\\\]|\\\\['ntbrf\\\\]))*'''") +STRING_LITERAL_LONG1.set_parse_action( + lambda x: rdflib.Literal(decodeUnicodeEscape(x[0][3:-3])) +) + +# [159] STRING_LITERAL_LONG2 ::= '"""' ( ( '"' | '""' )? ( [^"\] | ECHAR ) )* '"""' +# STRING_LITERAL_LONG2 = Literal('"""') + ( Optional( Literal('"') | '""' +# ) + ZeroOrMore( ~ Literal('"\\') | ECHAR ) ) + '"""' +STRING_LITERAL_LONG2 = Regex('"""(?:(?:"|"")?(?:[^"\\\\]|\\\\["ntbrf\\\\]))*"""') +STRING_LITERAL_LONG2.set_parse_action( + lambda x: rdflib.Literal(decodeUnicodeEscape(x[0][3:-3])) +) + +# [156] STRING_LITERAL1 ::= "'" ( ([^#x27#x5C#xA#xD]) | ECHAR )* "'" +# STRING_LITERAL1 = Literal("'") + ZeroOrMore( +# Regex(u'[^\u0027\u005C\u000A\u000D]',flags=re.U) | ECHAR ) + "'" + +STRING_LITERAL1 = Regex("'(?:[^'\\n\\r\\\\]|\\\\['ntbrf\\\\])*'(?!')", flags=re.U) +STRING_LITERAL1.set_parse_action( + lambda x: rdflib.Literal(decodeUnicodeEscape(x[0][1:-1])) +) + +# [157] STRING_LITERAL2 ::= '"' ( ([^#x22#x5C#xA#xD]) | ECHAR )* '"' +# STRING_LITERAL2 = Literal('"') + ZeroOrMore ( +# Regex(u'[^\u0022\u005C\u000A\u000D]',flags=re.U) | ECHAR ) + '"' + +STRING_LITERAL2 = Regex('"(?:[^"\\n\\r\\\\]|\\\\["ntbrf\\\\])*"(?!")', flags=re.U) +STRING_LITERAL2.set_parse_action( + lambda x: rdflib.Literal(decodeUnicodeEscape(x[0][1:-1])) +) + +# [161] NIL ::= '(' WS* ')' +NIL = Literal("(") + ")" +NIL.set_parse_action(lambda x: rdflib.RDF.nil) + +# [162] WS ::= #x20 | #x9 | #xD | #xA +# Not needed? +# WS = #x20 | #x9 | #xD | #xA +# [163] ANON ::= '[' WS* ']' +ANON = Literal("[") + "]" +ANON.set_parse_action(lambda x: rdflib.BNode()) + +# A = CaseSensitiveKeyword('a') +A = Literal("a") +A.set_parse_action(lambda x: rdflib.RDF.type) + + +# ------ NON-TERMINALS -------------- + +# [5] BaseDecl ::= 'BASE' IRIREF +BaseDecl = Comp("Base", Keyword("BASE") + Param("iri", IRIREF)) + +# [6] PrefixDecl ::= 'PREFIX' PNAME_NS IRIREF +PrefixDecl = Comp("PrefixDecl", Keyword("PREFIX") + PNAME_NS + Param("iri", IRIREF)) + +# [4] Prologue ::= ( BaseDecl | PrefixDecl )* +Prologue = Group(ZeroOrMore(BaseDecl | PrefixDecl)) + +# [108] Var ::= VAR1 | VAR2 +Var = VAR1 | VAR2 +Var.set_parse_action(lambda x: rdflib.term.Variable(x[0])) + +# [137] PrefixedName ::= PNAME_LN | PNAME_NS +PrefixedName = Comp("pname", PNAME_LN | PNAME_NS) + +# [136] iri ::= IRIREF | PrefixedName +iri = IRIREF | PrefixedName + +# [135] String ::= STRING_LITERAL1 | STRING_LITERAL2 | STRING_LITERAL_LONG1 | STRING_LITERAL_LONG2 +String = STRING_LITERAL_LONG1 | STRING_LITERAL_LONG2 | STRING_LITERAL1 | STRING_LITERAL2 + +# [129] RDFLiteral ::= String ( LANGTAG | ( '^^' iri ) )? + +RDFLiteral = Comp( + "literal", + Param("string", String) + + Optional( + Param("lang", LANGTAG.leave_whitespace()) + | Literal("^^").leave_whitespace() + Param("datatype", iri).leave_whitespace() + ), +) + +# [132] NumericLiteralPositive ::= INTEGER_POSITIVE | DECIMAL_POSITIVE | DOUBLE_POSITIVE +NumericLiteralPositive = DOUBLE_POSITIVE | DECIMAL_POSITIVE | INTEGER_POSITIVE + +# [133] NumericLiteralNegative ::= INTEGER_NEGATIVE | DECIMAL_NEGATIVE | DOUBLE_NEGATIVE +NumericLiteralNegative = DOUBLE_NEGATIVE | DECIMAL_NEGATIVE | INTEGER_NEGATIVE + +# [131] NumericLiteralUnsigned ::= INTEGER | DECIMAL | DOUBLE +NumericLiteralUnsigned = DOUBLE | DECIMAL | INTEGER + +# [130] NumericLiteral ::= NumericLiteralUnsigned | NumericLiteralPositive | NumericLiteralNegative +NumericLiteral = ( + NumericLiteralUnsigned | NumericLiteralPositive | NumericLiteralNegative +) + +# [134] BooleanLiteral ::= 'true' | 'false' +BooleanLiteral = Keyword("true").set_parse_action( + lambda: rdflib.Literal(True) +) | Keyword("false").set_parse_action(lambda: rdflib.Literal(False)) + +# [138] BlankNode ::= BLANK_NODE_LABEL | ANON +BlankNode = BLANK_NODE_LABEL | ANON + +# [109] GraphTerm ::= iri | RDFLiteral | NumericLiteral | BooleanLiteral | BlankNode | NIL +GraphTerm = iri | RDFLiteral | NumericLiteral | BooleanLiteral | BlankNode | NIL + +# [106] VarOrTerm ::= Var | GraphTerm +VarOrTerm = Var | GraphTerm + +# [107] VarOrIri ::= Var | iri +VarOrIri = Var | iri + +# [46] GraphRef ::= 'GRAPH' iri +GraphRef = Keyword("GRAPH") + Param("graphiri", iri) + +# [47] GraphRefAll ::= GraphRef | 'DEFAULT' | 'NAMED' | 'ALL' +GraphRefAll = ( + GraphRef + | Param("graphiri", Keyword("DEFAULT")) + | Param("graphiri", Keyword("NAMED")) + | Param("graphiri", Keyword("ALL")) +) + +# [45] GraphOrDefault ::= 'DEFAULT' | 'GRAPH'? iri +GraphOrDefault = ParamList("graph", Keyword("DEFAULT")) | Optional( + Keyword("GRAPH") +) + ParamList("graph", iri) + +# [65] DataBlockValue ::= iri | RDFLiteral | NumericLiteral | BooleanLiteral | 'UNDEF' +DataBlockValue = iri | RDFLiteral | NumericLiteral | BooleanLiteral | Keyword("UNDEF") + +# [78] Verb ::= VarOrIri | A +Verb = VarOrIri | A + + +# [85] VerbSimple ::= Var +VerbSimple = Var + +# [97] Integer ::= INTEGER +Integer = INTEGER + + +TriplesNode = Forward() +TriplesNodePath = Forward() + +# [104] GraphNode ::= VarOrTerm | TriplesNode +GraphNode = VarOrTerm | TriplesNode + +# [105] GraphNodePath ::= VarOrTerm | TriplesNodePath +GraphNodePath = VarOrTerm | TriplesNodePath + + +# [93] PathMod ::= '?' | '*' | '+' +PathMod = Literal("?") | "*" | "+" + +# [96] PathOneInPropertySet ::= iri | A | '^' ( iri | A ) +PathOneInPropertySet = iri | A | Comp("InversePath", "^" + (iri | A)) + +Path = Forward() + +# [95] PathNegatedPropertySet ::= PathOneInPropertySet | '(' ( PathOneInPropertySet ( '|' PathOneInPropertySet )* )? ')' +PathNegatedPropertySet = Comp( + "PathNegatedPropertySet", + ParamList("part", PathOneInPropertySet) + | "(" + + Optional( + ParamList("part", PathOneInPropertySet) + + ZeroOrMore("|" + ParamList("part", PathOneInPropertySet)) + ) + + ")", +) + +# [94] PathPrimary ::= iri | A | '!' PathNegatedPropertySet | '(' Path ')' | 'DISTINCT' '(' Path ')' +PathPrimary = ( + iri + | A + | Suppress("!") + PathNegatedPropertySet + | Suppress("(") + Path + Suppress(")") + | Comp("DistinctPath", Keyword("DISTINCT") + "(" + Param("part", Path) + ")") +) + +# [91] PathElt ::= PathPrimary Optional(PathMod) +PathElt = Comp( + "PathElt", + Param("part", PathPrimary) + Optional(Param("mod", PathMod.leave_whitespace())), +) + +# [92] PathEltOrInverse ::= PathElt | '^' PathElt +PathEltOrInverse = PathElt | Suppress("^") + Comp( + "PathEltOrInverse", Param("part", PathElt) +) + +# [90] PathSequence ::= PathEltOrInverse ( '/' PathEltOrInverse )* +PathSequence = Comp( + "PathSequence", + ParamList("part", PathEltOrInverse) + + ZeroOrMore("/" + ParamList("part", PathEltOrInverse)), +) + + +# [89] PathAlternative ::= PathSequence ( '|' PathSequence )* +PathAlternative = Comp( + "PathAlternative", + ParamList("part", PathSequence) + ZeroOrMore("|" + ParamList("part", PathSequence)), +) + +# [88] Path ::= PathAlternative +Path <<= PathAlternative + +# [84] VerbPath ::= Path +VerbPath = Path + +# [87] ObjectPath ::= GraphNodePath +ObjectPath = GraphNodePath + +# [86] ObjectListPath ::= ObjectPath ( ',' ObjectPath )* +ObjectListPath = ObjectPath + ZeroOrMore("," + ObjectPath) + + +GroupGraphPattern = Forward() + + +# [102] Collection ::= '(' OneOrMore(GraphNode) ')' +Collection = Suppress("(") + OneOrMore(GraphNode) + Suppress(")") +Collection.set_parse_action(expandCollection) + +# [103] CollectionPath ::= '(' OneOrMore(GraphNodePath) ')' +CollectionPath = Suppress("(") + OneOrMore(GraphNodePath) + Suppress(")") +CollectionPath.set_parse_action(expandCollection) + +# [80] Object ::= GraphNode +Object = GraphNode + +# [79] ObjectList ::= Object ( ',' Object )* +ObjectList = Object + ZeroOrMore("," + Object) + +# [83] PropertyListPathNotEmpty ::= ( VerbPath | VerbSimple ) ObjectListPath ( ';' ( ( VerbPath | VerbSimple ) ObjectList )? )* +PropertyListPathNotEmpty = ( + (VerbPath | VerbSimple) + + ObjectListPath + + ZeroOrMore(";" + Optional((VerbPath | VerbSimple) + ObjectListPath)) +) + +# [82] PropertyListPath ::= Optional(PropertyListPathNotEmpty) +PropertyListPath = Optional(PropertyListPathNotEmpty) + +# [77] PropertyListNotEmpty ::= Verb ObjectList ( ';' ( Verb ObjectList )? )* +PropertyListNotEmpty = Verb + ObjectList + ZeroOrMore(";" + Optional(Verb + ObjectList)) + + +# [76] PropertyList ::= Optional(PropertyListNotEmpty) +PropertyList = Optional(PropertyListNotEmpty) + +# [99] BlankNodePropertyList ::= '[' PropertyListNotEmpty ']' +BlankNodePropertyList = Group(Suppress("[") + PropertyListNotEmpty + Suppress("]")) +BlankNodePropertyList.set_parse_action(expandBNodeTriples) + +# [101] BlankNodePropertyListPath ::= '[' PropertyListPathNotEmpty ']' +BlankNodePropertyListPath = Group( + Suppress("[") + PropertyListPathNotEmpty + Suppress("]") +) +BlankNodePropertyListPath.set_parse_action(expandBNodeTriples) + +# [98] TriplesNode ::= Collection | BlankNodePropertyList +TriplesNode <<= Collection | BlankNodePropertyList + +# [100] TriplesNodePath ::= CollectionPath | BlankNodePropertyListPath +TriplesNodePath <<= CollectionPath | BlankNodePropertyListPath + +# [75] TriplesSameSubject ::= VarOrTerm PropertyListNotEmpty | TriplesNode PropertyList +TriplesSameSubject = VarOrTerm + PropertyListNotEmpty | TriplesNode + PropertyList +TriplesSameSubject.set_parse_action(expandTriples) + +# [52] TriplesTemplate ::= TriplesSameSubject ( '.' TriplesTemplate? )? +# NOTE: pyparsing.py handling of recursive rules is limited by python's recursion +# limit. +# (https://docs.python.org/3/library/sys.html#sys.setrecursionlimit) +# To accommodate arbitrary amounts of triples this rule is rewritten to not be +# recursive: +# [52*] TriplesTemplate ::= TriplesSameSubject ( '.' TriplesSameSubject? )* +TriplesTemplate = ParamList("triples", TriplesSameSubject) + ZeroOrMore( + Suppress(".") + Optional(ParamList("triples", TriplesSameSubject)) +) + +# [51] QuadsNotTriples ::= 'GRAPH' VarOrIri '{' Optional(TriplesTemplate) '}' +QuadsNotTriples = Comp( + "QuadsNotTriples", + Keyword("GRAPH") + Param("term", VarOrIri) + "{" + Optional(TriplesTemplate) + "}", +) + +# [50] Quads ::= Optional(TriplesTemplate) ( QuadsNotTriples '.'? Optional(TriplesTemplate) )* +Quads = Comp( + "Quads", + Optional(TriplesTemplate) + + ZeroOrMore( + ParamList("quadsNotTriples", QuadsNotTriples) + + Optional(Suppress(".")) + + Optional(TriplesTemplate) + ), +) + +# [48] QuadPattern ::= '{' Quads '}' +QuadPattern = "{" + Param("quads", Quads) + "}" + +# [49] QuadData ::= '{' Quads '}' +QuadData = "{" + Param("quads", Quads) + "}" + +# [81] TriplesSameSubjectPath ::= VarOrTerm PropertyListPathNotEmpty | TriplesNodePath PropertyListPath +TriplesSameSubjectPath = ( + VarOrTerm + PropertyListPathNotEmpty | TriplesNodePath + PropertyListPath +) +TriplesSameSubjectPath.set_parse_action(expandTriples) + +# [55] TriplesBlock ::= TriplesSameSubjectPath ( '.' Optional(TriplesBlock) )? +TriplesBlock = Forward() +TriplesBlock <<= ParamList("triples", TriplesSameSubjectPath) + Optional( + Suppress(".") + Optional(TriplesBlock) +) + + +# [66] MinusGraphPattern ::= 'MINUS' GroupGraphPattern +MinusGraphPattern = Comp( + "MinusGraphPattern", Keyword("MINUS") + Param("graph", GroupGraphPattern) +) + +# [67] GroupOrUnionGraphPattern ::= GroupGraphPattern ( 'UNION' GroupGraphPattern )* +GroupOrUnionGraphPattern = Comp( + "GroupOrUnionGraphPattern", + ParamList("graph", GroupGraphPattern) + + ZeroOrMore(Keyword("UNION") + ParamList("graph", GroupGraphPattern)), +) + + +Expression = Forward() + +# [72] ExpressionList ::= NIL | '(' Expression ( ',' Expression )* ')' +ExpressionList = NIL | Group(Suppress("(") + DelimitedList(Expression) + Suppress(")")) + +# [122] RegexExpression ::= 'REGEX' '(' Expression ',' Expression ( ',' Expression )? ')' +RegexExpression = Comp( + "Builtin_REGEX", + Keyword("REGEX") + + "(" + + Param("text", Expression) + + "," + + Param("pattern", Expression) + + Optional("," + Param("flags", Expression)) + + ")", +) +RegexExpression.setEvalFn(op.Builtin_REGEX) + +# [123] SubstringExpression ::= 'SUBSTR' '(' Expression ',' Expression ( ',' Expression )? ')' +SubstringExpression = Comp( + "Builtin_SUBSTR", + Keyword("SUBSTR") + + "(" + + Param("arg", Expression) + + "," + + Param("start", Expression) + + Optional("," + Param("length", Expression)) + + ")", +).setEvalFn(op.Builtin_SUBSTR) + +# [124] StrReplaceExpression ::= 'REPLACE' '(' Expression ',' Expression ',' Expression ( ',' Expression )? ')' +StrReplaceExpression = Comp( + "Builtin_REPLACE", + Keyword("REPLACE") + + "(" + + Param("arg", Expression) + + "," + + Param("pattern", Expression) + + "," + + Param("replacement", Expression) + + Optional("," + Param("flags", Expression)) + + ")", +).setEvalFn(op.Builtin_REPLACE) + +# [125] ExistsFunc ::= 'EXISTS' GroupGraphPattern +ExistsFunc = Comp( + "Builtin_EXISTS", Keyword("EXISTS") + Param("graph", GroupGraphPattern) +).setEvalFn(op.Builtin_EXISTS) + +# [126] NotExistsFunc ::= 'NOT' 'EXISTS' GroupGraphPattern +NotExistsFunc = Comp( + "Builtin_NOTEXISTS", + Keyword("NOT") + Keyword("EXISTS") + Param("graph", GroupGraphPattern), +).setEvalFn(op.Builtin_EXISTS) + + +# [127] Aggregate ::= 'COUNT' '(' 'DISTINCT'? ( '*' | Expression ) ')' +# | 'SUM' '(' Optional('DISTINCT') Expression ')' +# | 'MIN' '(' Optional('DISTINCT') Expression ')' +# | 'MAX' '(' Optional('DISTINCT') Expression ')' +# | 'AVG' '(' Optional('DISTINCT') Expression ')' +# | 'SAMPLE' '(' Optional('DISTINCT') Expression ')' +# | 'GROUP_CONCAT' '(' Optional('DISTINCT') Expression ( ';' 'SEPARATOR' '=' String )? ')' + +_Distinct = Optional(Keyword("DISTINCT")) +_AggregateParams = "(" + Param("distinct", _Distinct) + Param("vars", Expression) + ")" + +Aggregate = ( + Comp( + "Aggregate_Count", + Keyword("COUNT") + + "(" + + Param("distinct", _Distinct) + + Param("vars", "*" | Expression) + + ")", + ) + | Comp("Aggregate_Sum", Keyword("SUM") + _AggregateParams) + | Comp("Aggregate_Min", Keyword("MIN") + _AggregateParams) + | Comp("Aggregate_Max", Keyword("MAX") + _AggregateParams) + | Comp("Aggregate_Avg", Keyword("AVG") + _AggregateParams) + | Comp("Aggregate_Sample", Keyword("SAMPLE") + _AggregateParams) + | Comp( + "Aggregate_GroupConcat", + Keyword("GROUP_CONCAT") + + "(" + + Param("distinct", _Distinct) + + Param("vars", Expression) + + Optional(";" + Keyword("SEPARATOR") + "=" + Param("separator", String)) + + ")", + ) +) + +# [121] BuiltInCall ::= Aggregate +# | 'STR' '(' + Expression + ')' +# | 'LANG' '(' + Expression + ')' +# | 'LANGMATCHES' '(' + Expression + ',' + Expression + ')' +# | 'DATATYPE' '(' + Expression + ')' +# | 'BOUND' '(' Var ')' +# | 'IRI' '(' + Expression + ')' +# | 'URI' '(' + Expression + ')' +# | 'BNODE' ( '(' + Expression + ')' | NIL ) +# | 'RAND' NIL +# | 'ABS' '(' + Expression + ')' +# | 'CEIL' '(' + Expression + ')' +# | 'FLOOR' '(' + Expression + ')' +# | 'ROUND' '(' + Expression + ')' +# | 'CONCAT' ExpressionList +# | SubstringExpression +# | 'STRLEN' '(' + Expression + ')' +# | StrReplaceExpression +# | 'UCASE' '(' + Expression + ')' +# | 'LCASE' '(' + Expression + ')' +# | 'ENCODE_FOR_URI' '(' + Expression + ')' +# | 'CONTAINS' '(' + Expression + ',' + Expression + ')' +# | 'STRSTARTS' '(' + Expression + ',' + Expression + ')' +# | 'STRENDS' '(' + Expression + ',' + Expression + ')' +# | 'STRBEFORE' '(' + Expression + ',' + Expression + ')' +# | 'STRAFTER' '(' + Expression + ',' + Expression + ')' +# | 'YEAR' '(' + Expression + ')' +# | 'MONTH' '(' + Expression + ')' +# | 'DAY' '(' + Expression + ')' +# | 'HOURS' '(' + Expression + ')' +# | 'MINUTES' '(' + Expression + ')' +# | 'SECONDS' '(' + Expression + ')' +# | 'TIMEZONE' '(' + Expression + ')' +# | 'TZ' '(' + Expression + ')' +# | 'NOW' NIL +# | 'UUID' NIL +# | 'STRUUID' NIL +# | 'MD5' '(' + Expression + ')' +# | 'SHA1' '(' + Expression + ')' +# | 'SHA256' '(' + Expression + ')' +# | 'SHA384' '(' + Expression + ')' +# | 'SHA512' '(' + Expression + ')' +# | 'COALESCE' ExpressionList +# | 'IF' '(' Expression ',' Expression ',' Expression ')' +# | 'STRLANG' '(' + Expression + ',' + Expression + ')' +# | 'STRDT' '(' + Expression + ',' + Expression + ')' +# | 'sameTerm' '(' + Expression + ',' + Expression + ')' +# | 'isIRI' '(' + Expression + ')' +# | 'isURI' '(' + Expression + ')' +# | 'isBLANK' '(' + Expression + ')' +# | 'isLITERAL' '(' + Expression + ')' +# | 'isNUMERIC' '(' + Expression + ')' +# | RegexExpression +# | ExistsFunc +# | NotExistsFunc + +BuiltInCall = ( + Aggregate + | Comp( + "Builtin_STR", Keyword("STR") + "(" + Param("arg", Expression) + ")" + ).setEvalFn(op.Builtin_STR) + | Comp( + "Builtin_LANG", Keyword("LANG") + "(" + Param("arg", Expression) + ")" + ).setEvalFn(op.Builtin_LANG) + | Comp( + "Builtin_LANGMATCHES", + Keyword("LANGMATCHES") + + "(" + + Param("arg1", Expression) + + "," + + Param("arg2", Expression) + + ")", + ).setEvalFn(op.Builtin_LANGMATCHES) + | Comp( + "Builtin_DATATYPE", Keyword("DATATYPE") + "(" + Param("arg", Expression) + ")" + ).setEvalFn(op.Builtin_DATATYPE) + | Comp("Builtin_BOUND", Keyword("BOUND") + "(" + Param("arg", Var) + ")").setEvalFn( + op.Builtin_BOUND + ) + | Comp( + "Builtin_IRI", Keyword("IRI") + "(" + Param("arg", Expression) + ")" + ).setEvalFn(op.Builtin_IRI) + | Comp( + "Builtin_URI", Keyword("URI") + "(" + Param("arg", Expression) + ")" + ).setEvalFn(op.Builtin_IRI) + | Comp( + "Builtin_BNODE", Keyword("BNODE") + ("(" + Param("arg", Expression) + ")" | NIL) + ).setEvalFn(op.Builtin_BNODE) + | Comp("Builtin_RAND", Keyword("RAND") + NIL).setEvalFn(op.Builtin_RAND) + | Comp( + "Builtin_ABS", Keyword("ABS") + "(" + Param("arg", Expression) + ")" + ).setEvalFn(op.Builtin_ABS) + | Comp( + "Builtin_CEIL", Keyword("CEIL") + "(" + Param("arg", Expression) + ")" + ).setEvalFn(op.Builtin_CEIL) + | Comp( + "Builtin_FLOOR", Keyword("FLOOR") + "(" + Param("arg", Expression) + ")" + ).setEvalFn(op.Builtin_FLOOR) + | Comp( + "Builtin_ROUND", Keyword("ROUND") + "(" + Param("arg", Expression) + ")" + ).setEvalFn(op.Builtin_ROUND) + | Comp( + "Builtin_CONCAT", Keyword("CONCAT") + Param("arg", ExpressionList) + ).setEvalFn(op.Builtin_CONCAT) + | SubstringExpression + | Comp( + "Builtin_STRLEN", Keyword("STRLEN") + "(" + Param("arg", Expression) + ")" + ).setEvalFn(op.Builtin_STRLEN) + | StrReplaceExpression + | Comp( + "Builtin_UCASE", Keyword("UCASE") + "(" + Param("arg", Expression) + ")" + ).setEvalFn(op.Builtin_UCASE) + | Comp( + "Builtin_LCASE", Keyword("LCASE") + "(" + Param("arg", Expression) + ")" + ).setEvalFn(op.Builtin_LCASE) + | Comp( + "Builtin_ENCODE_FOR_URI", + Keyword("ENCODE_FOR_URI") + "(" + Param("arg", Expression) + ")", + ).setEvalFn(op.Builtin_ENCODE_FOR_URI) + | Comp( + "Builtin_CONTAINS", + Keyword("CONTAINS") + + "(" + + Param("arg1", Expression) + + "," + + Param("arg2", Expression) + + ")", + ).setEvalFn(op.Builtin_CONTAINS) + | Comp( + "Builtin_STRSTARTS", + Keyword("STRSTARTS") + + "(" + + Param("arg1", Expression) + + "," + + Param("arg2", Expression) + + ")", + ).setEvalFn(op.Builtin_STRSTARTS) + | Comp( + "Builtin_STRENDS", + Keyword("STRENDS") + + "(" + + Param("arg1", Expression) + + "," + + Param("arg2", Expression) + + ")", + ).setEvalFn(op.Builtin_STRENDS) + | Comp( + "Builtin_STRBEFORE", + Keyword("STRBEFORE") + + "(" + + Param("arg1", Expression) + + "," + + Param("arg2", Expression) + + ")", + ).setEvalFn(op.Builtin_STRBEFORE) + | Comp( + "Builtin_STRAFTER", + Keyword("STRAFTER") + + "(" + + Param("arg1", Expression) + + "," + + Param("arg2", Expression) + + ")", + ).setEvalFn(op.Builtin_STRAFTER) + | Comp( + "Builtin_YEAR", Keyword("YEAR") + "(" + Param("arg", Expression) + ")" + ).setEvalFn(op.Builtin_YEAR) + | Comp( + "Builtin_MONTH", Keyword("MONTH") + "(" + Param("arg", Expression) + ")" + ).setEvalFn(op.Builtin_MONTH) + | Comp( + "Builtin_DAY", Keyword("DAY") + "(" + Param("arg", Expression) + ")" + ).setEvalFn(op.Builtin_DAY) + | Comp( + "Builtin_HOURS", Keyword("HOURS") + "(" + Param("arg", Expression) + ")" + ).setEvalFn(op.Builtin_HOURS) + | Comp( + "Builtin_MINUTES", Keyword("MINUTES") + "(" + Param("arg", Expression) + ")" + ).setEvalFn(op.Builtin_MINUTES) + | Comp( + "Builtin_SECONDS", Keyword("SECONDS") + "(" + Param("arg", Expression) + ")" + ).setEvalFn(op.Builtin_SECONDS) + | Comp( + "Builtin_TIMEZONE", Keyword("TIMEZONE") + "(" + Param("arg", Expression) + ")" + ).setEvalFn(op.Builtin_TIMEZONE) + | Comp( + "Builtin_TZ", Keyword("TZ") + "(" + Param("arg", Expression) + ")" + ).setEvalFn(op.Builtin_TZ) + | Comp("Builtin_NOW", Keyword("NOW") + NIL).setEvalFn(op.Builtin_NOW) + | Comp("Builtin_UUID", Keyword("UUID") + NIL).setEvalFn(op.Builtin_UUID) + | Comp("Builtin_STRUUID", Keyword("STRUUID") + NIL).setEvalFn(op.Builtin_STRUUID) + | Comp( + "Builtin_MD5", Keyword("MD5") + "(" + Param("arg", Expression) + ")" + ).setEvalFn(op.Builtin_MD5) + | Comp( + "Builtin_SHA1", Keyword("SHA1") + "(" + Param("arg", Expression) + ")" + ).setEvalFn(op.Builtin_SHA1) + | Comp( + "Builtin_SHA256", Keyword("SHA256") + "(" + Param("arg", Expression) + ")" + ).setEvalFn(op.Builtin_SHA256) + | Comp( + "Builtin_SHA384", Keyword("SHA384") + "(" + Param("arg", Expression) + ")" + ).setEvalFn(op.Builtin_SHA384) + | Comp( + "Builtin_SHA512", Keyword("SHA512") + "(" + Param("arg", Expression) + ")" + ).setEvalFn(op.Builtin_SHA512) + | Comp( + "Builtin_COALESCE", Keyword("COALESCE") + Param("arg", ExpressionList) + ).setEvalFn(op.Builtin_COALESCE) + | Comp( + "Builtin_IF", + Keyword("IF") + + "(" + + Param("arg1", Expression) + + "," + + Param("arg2", Expression) + + "," + + Param("arg3", Expression) + + ")", + ).setEvalFn(op.Builtin_IF) + | Comp( + "Builtin_STRLANG", + Keyword("STRLANG") + + "(" + + Param("arg1", Expression) + + "," + + Param("arg2", Expression) + + ")", + ).setEvalFn(op.Builtin_STRLANG) + | Comp( + "Builtin_STRDT", + Keyword("STRDT") + + "(" + + Param("arg1", Expression) + + "," + + Param("arg2", Expression) + + ")", + ).setEvalFn(op.Builtin_STRDT) + | Comp( + "Builtin_sameTerm", + Keyword("sameTerm") + + "(" + + Param("arg1", Expression) + + "," + + Param("arg2", Expression) + + ")", + ).setEvalFn(op.Builtin_sameTerm) + | Comp( + "Builtin_isIRI", Keyword("isIRI") + "(" + Param("arg", Expression) + ")" + ).setEvalFn(op.Builtin_isIRI) + | Comp( + "Builtin_isURI", Keyword("isURI") + "(" + Param("arg", Expression) + ")" + ).setEvalFn(op.Builtin_isIRI) + | Comp( + "Builtin_isBLANK", Keyword("isBLANK") + "(" + Param("arg", Expression) + ")" + ).setEvalFn(op.Builtin_isBLANK) + | Comp( + "Builtin_isLITERAL", Keyword("isLITERAL") + "(" + Param("arg", Expression) + ")" + ).setEvalFn(op.Builtin_isLITERAL) + | Comp( + "Builtin_isNUMERIC", Keyword("isNUMERIC") + "(" + Param("arg", Expression) + ")" + ).setEvalFn(op.Builtin_isNUMERIC) + | RegexExpression + | ExistsFunc + | NotExistsFunc +) + +# [71] ArgList ::= NIL | '(' 'DISTINCT'? Expression ( ',' Expression )* ')' +ArgList = ( + NIL + | "(" + + Param("distinct", _Distinct) + + DelimitedList(ParamList("expr", Expression)) + + ")" +) + +# [128] iriOrFunction ::= iri Optional(ArgList) +iriOrFunction = ( + Comp("Function", Param("iri", iri) + ArgList).setEvalFn(op.Function) +) | iri + +# [70] FunctionCall ::= iri ArgList +FunctionCall = Comp("Function", Param("iri", iri) + ArgList).setEvalFn(op.Function) + + +# [120] BrackettedExpression ::= '(' Expression ')' +BrackettedExpression = Suppress("(") + Expression + Suppress(")") + +# [119] PrimaryExpression ::= BrackettedExpression | BuiltInCall | iriOrFunction | RDFLiteral | NumericLiteral | BooleanLiteral | Var +PrimaryExpression = ( + BrackettedExpression + | BuiltInCall + | iriOrFunction + | RDFLiteral + | NumericLiteral + | BooleanLiteral + | Var +) + +# [118] UnaryExpression ::= '!' PrimaryExpression +# | '+' PrimaryExpression +# | '-' PrimaryExpression +# | PrimaryExpression +UnaryExpression = ( + Comp("UnaryNot", "!" + Param("expr", PrimaryExpression)).setEvalFn(op.UnaryNot) + | Comp("UnaryPlus", "+" + Param("expr", PrimaryExpression)).setEvalFn(op.UnaryPlus) + | Comp("UnaryMinus", "-" + Param("expr", PrimaryExpression)).setEvalFn( + op.UnaryMinus + ) + | PrimaryExpression +) + +# [117] MultiplicativeExpression ::= UnaryExpression ( '*' UnaryExpression | '/' UnaryExpression )* +MultiplicativeExpression = Comp( + "MultiplicativeExpression", + Param("expr", UnaryExpression) + + ZeroOrMore( + ParamList("op", "*") + ParamList("other", UnaryExpression) + | ParamList("op", "/") + ParamList("other", UnaryExpression) + ), +).setEvalFn(op.MultiplicativeExpression) + +# [116] AdditiveExpression ::= MultiplicativeExpression ( '+' MultiplicativeExpression | '-' MultiplicativeExpression | ( NumericLiteralPositive | NumericLiteralNegative ) ( ( '*' UnaryExpression ) | ( '/' UnaryExpression ) )* )* + +# NOTE: The second part of this production is there because: +# "In signed numbers, no white space is allowed between the sign and the number. The AdditiveExpression grammar rule allows for this by covering the two cases of an expression followed by a signed number. These produce an addition or subtraction of the unsigned number as appropriate." + +# Here (I think) this is not necessary since pyparsing doesn't separate +# tokenizing and parsing + + +AdditiveExpression = Comp( + "AdditiveExpression", + Param("expr", MultiplicativeExpression) + + ZeroOrMore( + ParamList("op", "+") + ParamList("other", MultiplicativeExpression) + | ParamList("op", "-") + ParamList("other", MultiplicativeExpression) + ), +).setEvalFn(op.AdditiveExpression) + + +# [115] NumericExpression ::= AdditiveExpression +NumericExpression = AdditiveExpression + +# [114] RelationalExpression ::= NumericExpression ( '=' NumericExpression | '!=' NumericExpression | '<' NumericExpression | '>' NumericExpression | '<=' NumericExpression | '>=' NumericExpression | 'IN' ExpressionList | 'NOT' 'IN' ExpressionList )? +RelationalExpression = Comp( + "RelationalExpression", + Param("expr", NumericExpression) + + Optional( + Param("op", "=") + Param("other", NumericExpression) + | Param("op", "!=") + Param("other", NumericExpression) + | Param("op", "<") + Param("other", NumericExpression) + | Param("op", ">") + Param("other", NumericExpression) + | Param("op", "<=") + Param("other", NumericExpression) + | Param("op", ">=") + Param("other", NumericExpression) + | Param("op", Keyword("IN")) + Param("other", ExpressionList) + | Param( + "op", + Combine( + Keyword("NOT") + Keyword("IN"), + adjacent=False, + **combine_join_kwargs(" "), + ), + ) + + Param("other", ExpressionList) + ), +).setEvalFn(op.RelationalExpression) + + +# [113] ValueLogical ::= RelationalExpression +ValueLogical = RelationalExpression + +# [112] ConditionalAndExpression ::= ValueLogical ( '&&' ValueLogical )* +ConditionalAndExpression = Comp( + "ConditionalAndExpression", + Param("expr", ValueLogical) + ZeroOrMore("&&" + ParamList("other", ValueLogical)), +).setEvalFn(op.ConditionalAndExpression) + +# [111] ConditionalOrExpression ::= ConditionalAndExpression ( '||' ConditionalAndExpression )* +ConditionalOrExpression = Comp( + "ConditionalOrExpression", + Param("expr", ConditionalAndExpression) + + ZeroOrMore("||" + ParamList("other", ConditionalAndExpression)), +).setEvalFn(op.ConditionalOrExpression) + +# [110] Expression ::= ConditionalOrExpression +Expression <<= ConditionalOrExpression + + +# [69] Constraint ::= BrackettedExpression | BuiltInCall | FunctionCall +Constraint = BrackettedExpression | BuiltInCall | FunctionCall + +# [68] Filter ::= 'FILTER' Constraint +Filter = Comp("Filter", Keyword("FILTER") + Param("expr", Constraint)) + + +# [16] SourceSelector ::= iri +SourceSelector = iri + +# [14] DefaultGraphClause ::= SourceSelector +DefaultGraphClause = SourceSelector + +# [15] NamedGraphClause ::= 'NAMED' SourceSelector +NamedGraphClause = Keyword("NAMED") + Param("named", SourceSelector) + +# [13] DatasetClause ::= 'FROM' ( DefaultGraphClause | NamedGraphClause ) +DatasetClause = Comp( + "DatasetClause", + Keyword("FROM") + (Param("default", DefaultGraphClause) | NamedGraphClause), +) + +# [20] GroupCondition ::= BuiltInCall | FunctionCall | '(' Expression ( 'AS' Var )? ')' | Var +GroupCondition = ( + BuiltInCall + | FunctionCall + | Comp( + "GroupAs", + "(" + + Param("expr", Expression) + + Optional(Keyword("AS") + Param("var", Var)) + + ")", + ) + | Var +) + +# [19] GroupClause ::= 'GROUP' 'BY' GroupCondition+ +GroupClause = Comp( + "GroupClause", + Keyword("GROUP") + + Keyword("BY") + + OneOrMore(ParamList("condition", GroupCondition)), +) + + +_Silent = Optional(Param("silent", Keyword("SILENT"))) + +# [31] Load ::= 'LOAD' 'SILENT'? iri ( 'INTO' GraphRef )? +Load = Comp( + "Load", + Keyword("LOAD") + + _Silent + + Param("iri", iri) + + Optional(Keyword("INTO") + GraphRef), +) + +# [32] Clear ::= 'CLEAR' 'SILENT'? GraphRefAll +Clear = Comp("Clear", Keyword("CLEAR") + _Silent + GraphRefAll) + +# [33] Drop ::= 'DROP' _Silent GraphRefAll +Drop = Comp("Drop", Keyword("DROP") + _Silent + GraphRefAll) + +# [34] Create ::= 'CREATE' _Silent GraphRef +Create = Comp("Create", Keyword("CREATE") + _Silent + GraphRef) + +# [35] Add ::= 'ADD' _Silent GraphOrDefault 'TO' GraphOrDefault +Add = Comp( + "Add", Keyword("ADD") + _Silent + GraphOrDefault + Keyword("TO") + GraphOrDefault +) + +# [36] Move ::= 'MOVE' _Silent GraphOrDefault 'TO' GraphOrDefault +Move = Comp( + "Move", Keyword("MOVE") + _Silent + GraphOrDefault + Keyword("TO") + GraphOrDefault +) + +# [37] Copy ::= 'COPY' _Silent GraphOrDefault 'TO' GraphOrDefault +Copy = Comp( + "Copy", Keyword("COPY") + _Silent + GraphOrDefault + Keyword("TO") + GraphOrDefault +) + +# [38] InsertData ::= 'INSERT DATA' QuadData +InsertData = Comp("InsertData", Keyword("INSERT") + Keyword("DATA") + QuadData) + +# [39] DeleteData ::= 'DELETE DATA' QuadData +DeleteData = Comp("DeleteData", Keyword("DELETE") + Keyword("DATA") + QuadData) + +# [40] DeleteWhere ::= 'DELETE WHERE' QuadPattern +DeleteWhere = Comp("DeleteWhere", Keyword("DELETE") + Keyword("WHERE") + QuadPattern) + +# [42] DeleteClause ::= 'DELETE' QuadPattern +DeleteClause = Comp("DeleteClause", Keyword("DELETE") + QuadPattern) + +# [43] InsertClause ::= 'INSERT' QuadPattern +InsertClause = Comp("InsertClause", Keyword("INSERT") + QuadPattern) + +# [44] UsingClause ::= 'USING' ( iri | 'NAMED' iri ) +UsingClause = Comp( + "UsingClause", + Keyword("USING") + (Param("default", iri) | Keyword("NAMED") + Param("named", iri)), +) + +# [41] Modify ::= ( 'WITH' iri )? ( DeleteClause Optional(InsertClause) | InsertClause ) ZeroOrMore(UsingClause) 'WHERE' GroupGraphPattern +Modify = Comp( + "Modify", + Optional(Keyword("WITH") + Param("withClause", iri)) + + ( + Param("delete", DeleteClause) + Optional(Param("insert", InsertClause)) + | Param("insert", InsertClause) + ) + + ZeroOrMore(ParamList("using", UsingClause)) + + Keyword("WHERE") + + Param("where", GroupGraphPattern), +) + + +# [30] Update1 ::= Load | Clear | Drop | Add | Move | Copy | Create | InsertData | DeleteData | DeleteWhere | Modify +Update1 = ( + Load + | Clear + | Drop + | Add + | Move + | Copy + | Create + | InsertData + | DeleteData + | DeleteWhere + | Modify +) + + +# [63] InlineDataOneVar ::= Var '{' ZeroOrMore(DataBlockValue) '}' +InlineDataOneVar = ( + ParamList("var", Var) + "{" + ZeroOrMore(ParamList("value", DataBlockValue)) + "}" +) + +# [64] InlineDataFull ::= ( NIL | '(' ZeroOrMore(Var) ')' ) '{' ( '(' ZeroOrMore(DataBlockValue) ')' | NIL )* '}' +InlineDataFull = ( + (NIL | "(" + ZeroOrMore(ParamList("var", Var)) + ")") + + "{" + + ZeroOrMore( + ParamList( + "value", + Group(Suppress("(") + ZeroOrMore(DataBlockValue) + Suppress(")") | NIL), + ) + ) + + "}" +) + +# [62] DataBlock ::= InlineDataOneVar | InlineDataFull +DataBlock = InlineDataOneVar | InlineDataFull + + +# [28] ValuesClause ::= ( 'VALUES' DataBlock )? +ValuesClause = Optional( + Param("valuesClause", Comp("ValuesClause", Keyword("VALUES") + DataBlock)) +) + + +# [74] ConstructTriples ::= TriplesSameSubject ( '.' Optional(ConstructTriples) )? +ConstructTriples = Forward() +ConstructTriples <<= ParamList("template", TriplesSameSubject) + Optional( + Suppress(".") + Optional(ConstructTriples) +) + +# [73] ConstructTemplate ::= '{' Optional(ConstructTriples) '}' +ConstructTemplate = Suppress("{") + Optional(ConstructTriples) + Suppress("}") + + +# [57] OptionalGraphPattern ::= 'OPTIONAL' GroupGraphPattern +OptionalGraphPattern = Comp( + "OptionalGraphPattern", Keyword("OPTIONAL") + Param("graph", GroupGraphPattern) +) + +# [58] GraphGraphPattern ::= 'GRAPH' VarOrIri GroupGraphPattern +GraphGraphPattern = Comp( + "GraphGraphPattern", + Keyword("GRAPH") + Param("term", VarOrIri) + Param("graph", GroupGraphPattern), +) + +# [59] ServiceGraphPattern ::= 'SERVICE' _Silent VarOrIri GroupGraphPattern +ServiceGraphPattern = Comp( + "ServiceGraphPattern", + Keyword("SERVICE") + + _Silent + + Param("term", VarOrIri) + + Param("graph", GroupGraphPattern), +) + +# [60] Bind ::= 'BIND' '(' Expression 'AS' Var ')' +Bind = Comp( + "Bind", + Keyword("BIND") + + "(" + + Param("expr", Expression) + + Keyword("AS") + + Param("var", Var) + + ")", +) + +# [61] InlineData ::= 'VALUES' DataBlock +InlineData = Comp("InlineData", Keyword("VALUES") + DataBlock) + +# [56] GraphPatternNotTriples ::= GroupOrUnionGraphPattern | OptionalGraphPattern | MinusGraphPattern | GraphGraphPattern | ServiceGraphPattern | Filter | Bind | InlineData +GraphPatternNotTriples = ( + GroupOrUnionGraphPattern + | OptionalGraphPattern + | MinusGraphPattern + | GraphGraphPattern + | ServiceGraphPattern + | Filter + | Bind + | InlineData +) + +# [54] GroupGraphPatternSub ::= Optional(TriplesBlock) ( GraphPatternNotTriples '.'? Optional(TriplesBlock) )* +GroupGraphPatternSub = Comp( + "GroupGraphPatternSub", + Optional(ParamList("part", Comp("TriplesBlock", TriplesBlock))) + + ZeroOrMore( + ParamList("part", GraphPatternNotTriples) + + Optional(".") + + Optional(ParamList("part", Comp("TriplesBlock", TriplesBlock))) + ), +) + + +# ---------------- +# [22] HavingCondition ::= Constraint +HavingCondition = Constraint + +# [21] HavingClause ::= 'HAVING' HavingCondition+ +HavingClause = Comp( + "HavingClause", + Keyword("HAVING") + OneOrMore(ParamList("condition", HavingCondition)), +) + +# [24] OrderCondition ::= ( ( 'ASC' | 'DESC' ) BrackettedExpression ) +# | ( Constraint | Var ) +OrderCondition = Comp( + "OrderCondition", + Param("order", Keyword("ASC") | Keyword("DESC")) + + Param("expr", BrackettedExpression) + | Param("expr", Constraint | Var), +) + +# [23] OrderClause ::= 'ORDER' 'BY' OneOrMore(OrderCondition) +OrderClause = Comp( + "OrderClause", + Keyword("ORDER") + + Keyword("BY") + + OneOrMore(ParamList("condition", OrderCondition)), +) + +# [26] LimitClause ::= 'LIMIT' INTEGER +LimitClause = Keyword("LIMIT") + Param("limit", INTEGER) + +# [27] OffsetClause ::= 'OFFSET' INTEGER +OffsetClause = Keyword("OFFSET") + Param("offset", INTEGER) + +# [25] LimitOffsetClauses ::= LimitClause Optional(OffsetClause) | OffsetClause Optional(LimitClause) +LimitOffsetClauses = Comp( + "LimitOffsetClauses", + LimitClause + Optional(OffsetClause) | OffsetClause + Optional(LimitClause), +) + +# [18] SolutionModifier ::= GroupClause? HavingClause? OrderClause? LimitOffsetClauses? +SolutionModifier = ( + Optional(Param("groupby", GroupClause)) + + Optional(Param("having", HavingClause)) + + Optional(Param("orderby", OrderClause)) + + Optional(Param("limitoffset", LimitOffsetClauses)) +) + + +# [9] SelectClause ::= 'SELECT' ( 'DISTINCT' | 'REDUCED' )? ( ( Var | ( '(' Expression 'AS' Var ')' ) )+ | '*' ) +SelectClause = ( + Keyword("SELECT") + + Optional(Param("modifier", Keyword("DISTINCT") | Keyword("REDUCED"))) + + ( + OneOrMore( + ParamList( + "projection", + Comp( + "vars", + Param("var", Var) + | ( + Literal("(") + + Param("expr", Expression) + + Keyword("AS") + + Param("evar", Var) + + ")" + ), + ), + ) + ) + | "*" + ) +) + +# [17] WhereClause ::= 'WHERE'? GroupGraphPattern +WhereClause = Optional(Keyword("WHERE")) + Param("where", GroupGraphPattern) + +# [8] SubSelect ::= SelectClause WhereClause SolutionModifier ValuesClause +SubSelect = Comp( + "SubSelect", SelectClause + WhereClause + SolutionModifier + ValuesClause +) + +# [53] GroupGraphPattern ::= '{' ( SubSelect | GroupGraphPatternSub ) '}' +GroupGraphPattern <<= Suppress("{") + (SubSelect | GroupGraphPatternSub) + Suppress("}") + +# [7] SelectQuery ::= SelectClause DatasetClause* WhereClause SolutionModifier +SelectQuery = Comp( + "SelectQuery", + SelectClause + + ZeroOrMore(ParamList("datasetClause", DatasetClause)) + + WhereClause + + SolutionModifier + + ValuesClause, +) + +# [10] ConstructQuery ::= 'CONSTRUCT' ( ConstructTemplate DatasetClause* WhereClause SolutionModifier | DatasetClause* 'WHERE' '{' TriplesTemplate? '}' SolutionModifier ) +# NOTE: The CONSTRUCT WHERE alternative has unnecessarily many Comp/Param pairs +# to allow it to through the same algebra translation process +ConstructQuery = Comp( + "ConstructQuery", + Keyword("CONSTRUCT") + + ( + ConstructTemplate + + ZeroOrMore(ParamList("datasetClause", DatasetClause)) + + WhereClause + + SolutionModifier + + ValuesClause + | ZeroOrMore(ParamList("datasetClause", DatasetClause)) + + Keyword("WHERE") + + "{" + + Optional( + Param( + "where", + Comp( + "FakeGroupGraphPatten", + ParamList("part", Comp("TriplesBlock", TriplesTemplate)), + ), + ) + ) + + "}" + + SolutionModifier + + ValuesClause + ), +) + +# [12] AskQuery ::= 'ASK' DatasetClause* WhereClause SolutionModifier +AskQuery = Comp( + "AskQuery", + Keyword("ASK") + + ZeroOrMore(ParamList("datasetClause", DatasetClause)) + + WhereClause + + SolutionModifier + + ValuesClause, +) + +# [11] DescribeQuery ::= 'DESCRIBE' ( VarOrIri+ | '*' ) DatasetClause* WhereClause? SolutionModifier +DescribeQuery = Comp( + "DescribeQuery", + Keyword("DESCRIBE") + + (OneOrMore(ParamList("var", VarOrIri)) | "*") + + ZeroOrMore(ParamList("datasetClause", DatasetClause)) + + Optional(WhereClause) + + SolutionModifier + + ValuesClause, +) + +# [29] Update ::= Prologue ( Update1 ( ';' Update )? )? +Update = Forward() +Update <<= ParamList("prologue", Prologue) + Optional( + ParamList("request", Update1) + Optional(";" + Update) +) + + +# [2] Query ::= Prologue +# ( SelectQuery | ConstructQuery | DescribeQuery | AskQuery ) +# ValuesClause +# NOTE: ValuesClause was moved to individual queries +Query = Prologue + (SelectQuery | ConstructQuery | DescribeQuery | AskQuery) + +# [3] UpdateUnit ::= Update +UpdateUnit = Comp("Update", Update) + +# [1] QueryUnit ::= Query +QueryUnit = Query + +QueryUnit.ignore("#" + rest_of_line) +UpdateUnit.ignore("#" + rest_of_line) + + +expandUnicodeEscapes_re: re.Pattern = re.compile( + r"\\u([0-9a-f]{4}(?:[0-9a-f]{4})?)", flags=re.I +) + + +def expandUnicodeEscapes(q: str) -> str: + r""" + The syntax of the SPARQL Query Language is expressed over code points in Unicode [UNICODE]. The encoding is always UTF-8 [RFC3629]. + Unicode code points may also be expressed using an \ uXXXX (U+0 to U+FFFF) or \ UXXXXXXXX syntax (for U+10000 onwards) where X is a hexadecimal digit [0-9A-F] + """ + + def expand(m: re.Match) -> str: + try: + return chr(int(m.group(1), 16)) + except (ValueError, OverflowError) as e: + raise ValueError("Invalid unicode code point: " + m.group(1)) from e + + return expandUnicodeEscapes_re.sub(expand, q) + + +def parseQuery(q: Union[str, bytes, TextIO, BinaryIO]) -> ParseResults: + if hasattr(q, "read"): + q = q.read() + if isinstance(q, bytes): + q = q.decode("utf-8") + + q = expandUnicodeEscapes(q) + return Query.parse_string(q, parse_all=True) + + +def parseUpdate(q: Union[str, bytes, TextIO, BinaryIO]) -> CompValue: + if hasattr(q, "read"): + q = q.read() + + if isinstance(q, bytes): + q = q.decode("utf-8") + + q = expandUnicodeEscapes(q) + return UpdateUnit.parse_string(q, parse_all=True)[0] diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/parserutils.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/parserutils.py new file mode 100644 index 0000000000000000000000000000000000000000..9b6be93a6a47862d60a61ab48af99fc186664708 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/parserutils.py @@ -0,0 +1,313 @@ +""" + +NOTE: PyParsing setResultName/__call__ provides a very similar solution to this +I didn't realise at the time of writing and I will remove a +lot of this code at some point + +Utility classes for creating an abstract-syntax tree out with pyparsing actions + +Lets you label and group parts of parser production rules + +For example: + +# [5] BaseDecl ::= 'BASE' IRIREF +BaseDecl = Comp('Base', Keyword('BASE') + Param('iri',IRIREF)) + +After parsing, this gives you back an CompValue object, +which is a dict/object with the parameters specified. +So you can access the parameters are attributes or as keys: + +baseDecl.iri + +Comp lets you set an evalFn that is bound to the eval method of +the resulting CompValue +""" + +from __future__ import annotations + +from collections import OrderedDict +from types import MethodType +from typing import ( + TYPE_CHECKING, + Any, + Callable, + List, + Mapping, + Optional, + Tuple, + TypeVar, + Union, +) + +from pyparsing import ParserElement, ParseResults, TokenConverter + +from rdflib.term import BNode, Identifier, Variable + +from .pyparsing_compat import original_text_for + +if TYPE_CHECKING: + from rdflib.plugins.sparql.sparql import FrozenBindings + + +# This is an alternative + +# Comp('Sum')( Param('x')(Number) + '+' + Param('y')(Number) ) + + +def value( + ctx: FrozenBindings, + val: Any, + variables: bool = False, + errors: bool = False, +) -> Any: + """Utility function for evaluating something... + + Variables will be looked up in the context + Normally, non-bound vars is an error, + set variables=True to return unbound vars + + Normally, an error raises the error, + set errors=True to return error + """ + + if isinstance(val, Expr): + return val.eval(ctx) # recurse? + elif isinstance(val, CompValue): + raise Exception("What do I do with this CompValue? %s" % val) + + elif isinstance(val, list): + return [value(ctx, x, variables, errors) for x in val] + + elif isinstance(val, (BNode, Variable)): + r = ctx.get(val) + if isinstance(r, SPARQLError) and not errors: + raise r + if r is not None: + return r + + # not bound + if variables: + return val + else: + raise NotBoundError + + elif isinstance(val, ParseResults) and len(val) == 1: + return value(ctx, val[0], variables, errors) + else: + return val + + +class ParamValue: + """ + The result of parsing a Param + This just keeps the name/value + All cleverness is in the CompValue + """ + + def __init__( + self, name: str, tokenList: Union[List[Any], ParseResults], isList: bool + ): + self.isList = isList + self.name = name + if isinstance(tokenList, (list, ParseResults)) and len(tokenList) == 1: + tokenList = tokenList[0] + + self.tokenList = tokenList + + def __str__(self) -> str: + return "Param(%s, %s)" % (self.name, self.tokenList) + + +class Param(TokenConverter): + """ + A pyparsing token for labelling a part of the parse-tree + if isList is true repeat occurrences of ParamList have + their values merged in a list + """ + + def __init__(self, name: str, expr, isList: bool = False): + self.isList = isList + TokenConverter.__init__(self, expr) + self.set_name(name) + self.add_parse_action(self.postParse2) + + def postParse2(self, tokenList: Union[List[Any], ParseResults]) -> ParamValue: + return ParamValue(self.name, tokenList, self.isList) + + +class ParamList(Param): + """ + A shortcut for a Param with isList=True + """ + + def __init__(self, name: str, expr): + Param.__init__(self, name, expr, True) + + +_ValT = TypeVar("_ValT") + + +class CompValue(OrderedDict): + """ + The result of parsing a Comp + Any included Params are available as Dict keys + or as attributes + """ + + def __init__(self, name: str, **values): + OrderedDict.__init__(self) + self.name = name + self.update(values) + + def clone(self) -> CompValue: + return CompValue(self.name, **self) + + def __str__(self) -> str: + return self.name + "_" + OrderedDict.__str__(self) + + def __repr__(self) -> str: + return self.name + "_" + dict.__repr__(self) + + def _value( + self, val: _ValT, variables: bool = False, errors: bool = False + ) -> Union[_ValT, Any]: + if self.ctx is not None: + return value(self.ctx, val, variables) + else: + return val + + def __getitem__(self, a): + return self._value(OrderedDict.__getitem__(self, a)) + + # type error: Signature of "get" incompatible with supertype "dict" + # type error: Signature of "get" incompatible with supertype "Mapping" [override] + def get(self, a, variables: bool = False, errors: bool = False): # type: ignore[override] + return self._value(OrderedDict.get(self, a, a), variables, errors) + + def __getattr__(self, a: str) -> Any: + # Hack hack: OrderedDict relies on this + if a in ("_OrderedDict__root", "_OrderedDict__end"): + raise AttributeError() + try: + return self[a] + except KeyError: + # raise AttributeError('no such attribute '+a) + return None + + if TYPE_CHECKING: + # this is here because properties are dynamically set on CompValue + def __setattr__(self, __name: str, __value: Any) -> None: ... + + +class Expr(CompValue): + """ + A CompValue that is evaluatable + """ + + def __init__( + self, + name: str, + evalfn: Optional[Callable[[Any, Any], Any]] = None, + **values, + ): + super(Expr, self).__init__(name, **values) + + self._evalfn = None + if evalfn: + self._evalfn = MethodType(evalfn, self) + + def eval(self, ctx: Any = {}) -> Union[SPARQLError, Any]: + try: + self.ctx: Optional[Union[Mapping, FrozenBindings]] = ctx + # type error: "None" not callable + return self._evalfn(ctx) # type: ignore[misc] + except SPARQLError as e: + return e + finally: + self.ctx = None + + +class Comp(TokenConverter): + """ + A pyparsing token for grouping together things with a label + Any sub-tokens that are not Params will be ignored. + + Returns CompValue / Expr objects - depending on whether evalFn is set. + """ + + def __init__(self, name: str, expr: ParserElement): + self.expr = expr + TokenConverter.__init__(self, expr) + self.set_name(name) + self.evalfn: Optional[Callable[[Any, Any], Any]] = None + + def postParse( + self, instring: str, loc: int, tokenList: ParseResults + ) -> Union[Expr, CompValue]: + res: Union[Expr, CompValue] + if self.evalfn: + res = Expr(self.name) + res._evalfn = MethodType(self.evalfn, res) + else: + res = CompValue(self.name) + if self.name == "ServiceGraphPattern": + # Then this must be a service graph pattern and have + # already matched. + # lets assume there is one, for now, then test for two later. + sgp = original_text_for(self.expr) + service_string = sgp.search_string(instring)[0][0] + res["service_string"] = service_string + + for t in tokenList: + if isinstance(t, ParamValue): + if t.isList: + if t.name not in res: + res[t.name] = [] + res[t.name].append(t.tokenList) + else: + res[t.name] = t.tokenList + # res.append(t.tokenList) + # if isinstance(t,CompValue): + # res.update(t) + return res + + def setEvalFn(self, evalfn: Callable[[Any, Any], Any]) -> Comp: + self.evalfn = evalfn + return self + + +def prettify_parsetree(t: ParseResults, indent: str = "", depth: int = 0) -> str: + out: List[str] = [] + for e in t.as_list(): + out.append(_prettify_sub_parsetree(e, indent, depth + 1)) + for k, v in sorted(t.items()): + out.append("%s%s- %s:\n" % (indent, " " * depth, k)) + out.append(_prettify_sub_parsetree(v, indent, depth + 1)) + return "".join(out) + + +def _prettify_sub_parsetree( + t: Union[Identifier, CompValue, set, list, dict, Tuple, bool, None], + indent: str = "", + depth: int = 0, +) -> str: + out: List[str] = [] + if isinstance(t, CompValue): + out.append("%s%s> %s:\n" % (indent, " " * depth, t.name)) + for k, v in t.items(): + out.append("%s%s- %s:\n" % (indent, " " * (depth + 1), k)) + out.append(_prettify_sub_parsetree(v, indent, depth + 2)) + elif isinstance(t, dict): + for k, v in t.items(): + out.append("%s%s- %s:\n" % (indent, " " * (depth + 1), k)) + out.append(_prettify_sub_parsetree(v, indent, depth + 2)) + elif isinstance(t, list): + for e in t: + out.append(_prettify_sub_parsetree(e, indent, depth + 1)) + else: + out.append("%s%s- %r\n" % (indent, " " * depth, t)) + return "".join(out) + + +# hurrah for circular imports +from rdflib.plugins.sparql.sparql import NotBoundError, SPARQLError # noqa: E402 diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/processor.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/processor.py new file mode 100644 index 0000000000000000000000000000000000000000..976598ca54ba11e82f22a0aae1514a24d42afe36 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/processor.py @@ -0,0 +1,146 @@ +""" +Code for tying SPARQL Engine into RDFLib + +These should be automatically registered with RDFLib +""" + +from __future__ import annotations + +from typing import Any, Mapping, Optional, Union + +from rdflib.graph import Graph +from rdflib.plugins.sparql.algebra import translateQuery, translateUpdate +from rdflib.plugins.sparql.evaluate import evalQuery +from rdflib.plugins.sparql.parser import parseQuery, parseUpdate +from rdflib.plugins.sparql.sparql import Query, Update +from rdflib.plugins.sparql.update import evalUpdate +from rdflib.query import Processor, Result, UpdateProcessor +from rdflib.term import Identifier + + +def prepareQuery( + queryString: str, + initNs: Optional[Mapping[str, Any]] = None, + base: Optional[str] = None, +) -> Query: + """ + Parse and translate a SPARQL Query + """ + if initNs is None: + initNs = {} + ret = translateQuery(parseQuery(queryString), base, initNs) + ret._original_args = (queryString, initNs, base) + return ret + + +def prepareUpdate( + updateString: str, + initNs: Optional[Mapping[str, Any]] = None, + base: Optional[str] = None, +) -> Update: + """ + Parse and translate a SPARQL Update + """ + if initNs is None: + initNs = {} + ret = translateUpdate(parseUpdate(updateString), base, initNs) + ret._original_args = (updateString, initNs, base) + return ret + + +def processUpdate( + graph: Graph, + updateString: str, + initBindings: Optional[Mapping[str, Identifier]] = None, + initNs: Optional[Mapping[str, Any]] = None, + base: Optional[str] = None, +) -> None: + """ + Process a SPARQL Update Request + returns Nothing on success or raises Exceptions on error + """ + evalUpdate( + graph, translateUpdate(parseUpdate(updateString), base, initNs), initBindings + ) + + +class SPARQLResult(Result): + def __init__(self, res: Mapping[str, Any]): + Result.__init__(self, res["type_"]) + self.vars = res.get("vars_") + # type error: Incompatible types in assignment (expression has type "Optional[Any]", variable has type "MutableSequence[Mapping[Variable, Identifier]]") + self.bindings = res.get("bindings") # type: ignore[assignment] + self.askAnswer = res.get("askAnswer") + self.graph = res.get("graph") + + +class SPARQLUpdateProcessor(UpdateProcessor): + def __init__(self, graph): + self.graph = graph + + def update( + self, + strOrQuery: Union[str, Update], + initBindings: Optional[Mapping[str, Identifier]] = None, + initNs: Optional[Mapping[str, Any]] = None, + ) -> None: + """ + !!! warning "Caution" + + This method can access indirectly requested network endpoints, for + example, query processing will attempt to access network endpoints + specified in `SERVICE` directives. + + When processing untrusted or potentially malicious queries, measures + should be taken to restrict network and file access. + + For information on available security measures, see the RDFLib + [Security Considerations](../security_considerations.md) + documentation. + """ + + if isinstance(strOrQuery, str): + strOrQuery = translateUpdate(parseUpdate(strOrQuery), initNs=initNs) + + return evalUpdate(self.graph, strOrQuery, initBindings) + + +class SPARQLProcessor(Processor): + def __init__(self, graph): + self.graph = graph + + # NOTE on type error: this is because the super type constructor does not + # accept base argument and thie position of the DEBUG argument is + # different. + # type error: Signature of "query" incompatible with supertype "Processor" + def query( # type: ignore[override] + self, + strOrQuery: Union[str, Query], + initBindings: Optional[Mapping[str, Identifier]] = None, + initNs: Optional[Mapping[str, Any]] = None, + base: Optional[str] = None, + DEBUG: bool = False, + ) -> Mapping[str, Any]: + """ + Evaluate a query with the given initial bindings, and initial + namespaces. The given base is used to resolve relative URIs in + the query and will be overridden by any BASE given in the query. + + !!! warning "Caution" + + This method can access indirectly requested network endpoints, for + example, query processing will attempt to access network endpoints + specified in `SERVICE` directives. + + When processing untrusted or potentially malicious queries, measures + should be taken to restrict network and file access. + + For information on available security measures, see the RDFLib + [Security Considerations](../security_considerations.md) + documentation. + """ + + if isinstance(strOrQuery, str): + strOrQuery = translateQuery(parseQuery(strOrQuery), base, initNs) + + return evalQuery(self.graph, strOrQuery, initBindings, base) diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/pyparsing_compat.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/pyparsing_compat.py new file mode 100644 index 0000000000000000000000000000000000000000..91a0c737d54e67a50addc212cb3f40f20c22e3d9 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/pyparsing_compat.py @@ -0,0 +1,100 @@ +""" +Compatibility helpers for supporting pyparsing v2 and v3 APIs. +""" + +from __future__ import annotations + +from typing import Callable, Dict, Type, cast + +import pyparsing + +ParseResults = pyparsing.ParseResults +ParserElement = pyparsing.ParserElement + + +_RAW_VERSION = getattr(pyparsing, "__version__", "0") +try: + PYPARSING_MAJOR_VERSION = int(_RAW_VERSION.split(".", 1)[0]) +except (TypeError, ValueError): + PYPARSING_MAJOR_VERSION = 0 + +PYPARSING_V3 = PYPARSING_MAJOR_VERSION >= 3 + +_ParserFactory = Callable[..., ParserElement] +_ParserTransform = Callable[..., ParserElement] + +DelimitedList: _ParserFactory +original_text_for: _ParserTransform +rest_of_line: ParserElement + +if PYPARSING_V3: + DelimitedList = pyparsing.DelimitedList + original_text_for = pyparsing.original_text_for + rest_of_line = pyparsing.rest_of_line +else: + DelimitedList = pyparsing.delimitedList + original_text_for = pyparsing.originalTextFor + rest_of_line = pyparsing.restOfLine + + +def _alias_instance_method(klass: Type[object], new_name: str, old_name: str) -> None: + if hasattr(klass, new_name) or not hasattr(klass, old_name): + return + + def _method(self: object, *args: object, **kwargs: object) -> object: + # Resolve old_name on self so subclass overrides are preserved. + method = cast(Callable[..., object], getattr(self, old_name)) + return method(*args, **kwargs) + + setattr(klass, new_name, _method) + + +def _alias_static_method(klass: Type[object], new_name: str, old_name: str) -> None: + if hasattr(klass, new_name) or not hasattr(klass, old_name): + return + + old_method = cast(Callable[..., object], getattr(klass, old_name)) + + def _method(*args: object, **kwargs: object) -> object: + return old_method(*args, **kwargs) + + setattr(klass, new_name, staticmethod(_method)) + + +_alias_instance_method(ParserElement, "set_parse_action", "setParseAction") +_alias_instance_method(ParserElement, "add_parse_action", "addParseAction") +_alias_instance_method(ParserElement, "leave_whitespace", "leaveWhitespace") +_alias_instance_method(ParserElement, "set_name", "setName") +_alias_instance_method(ParserElement, "set_results_name", "setResultsName") +_alias_instance_method(ParserElement, "parse_with_tabs", "parseWithTabs") +_alias_instance_method(ParserElement, "search_string", "searchString") +_alias_static_method( + ParserElement, + "set_default_whitespace_chars", + "setDefaultWhitespaceChars", +) + +if not hasattr(ParserElement, "parse_string"): + + def _parse_string( + self: ParserElement, + instring: str, + parse_all: bool = False, + *, + parseAll: bool = False, + ) -> ParseResults: + if parseAll: + parse_all = parseAll + parser = cast(Callable[..., ParseResults], getattr(self, "parseString")) + return parser(instring, parseAll=parse_all) + + setattr(ParserElement, "parse_string", _parse_string) + + +_alias_instance_method(ParseResults, "as_list", "asList") + + +def combine_join_kwargs(value: str) -> Dict[str, str]: + if PYPARSING_V3: + return {"join_string": value} + return {"joinString": value} diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/__init__.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5a78c3e88a6a128bc80d9b824d4df6ef3b843144 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/__init__.py @@ -0,0 +1,21 @@ +"""Parsers and serializers for SPARQL Result formats + +All builtin [SPARQL result serializers][rdflib.query.ResultSerializer] available +after [a query][rdflib.graph.Graph.query] are listed here. +The serializer can be chosen during [serialization of a result][rdflib.query.Result.serialize]. + +``` +import rdflib + +result : rdflib.query.Result +g = rdflib.Graph().parse(format="ttl", data=\"\"\" + @base . + a . +\"\"\") +result = g.query("SELECT ?x ?cls WHERE {?x a ?cls}") +print(result.serialize(format="txt").decode("utf8")) +``` + +Registration of builtin and external plugins +is described in [`rdflib.plugin`][rdflib.plugin]. +""" diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/__pycache__/__init__.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b6d5b8b34a9ac6ef8b20ffe895612a4beb981133 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/__pycache__/__init__.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/__pycache__/csvresults.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/__pycache__/csvresults.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..da93056f62bdb9166a07484cebf4dfcc302cfbc1 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/__pycache__/csvresults.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/__pycache__/graph.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/__pycache__/graph.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5f61a7127c837c3e223cb9a5cbf3a3f7fbb370d9 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/__pycache__/graph.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/__pycache__/jsonresults.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/__pycache__/jsonresults.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c2de494df2b1782ffd57268e6a5d51e6449d824e Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/__pycache__/jsonresults.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/__pycache__/rdfresults.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/__pycache__/rdfresults.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a5bf90f7f1b1106324ede9059a473fec2af13292 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/__pycache__/rdfresults.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/__pycache__/tsvresults.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/__pycache__/tsvresults.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..eeaa91f96e362e6282adfa4ea4930a44e44b88b5 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/__pycache__/tsvresults.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/__pycache__/txtresults.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/__pycache__/txtresults.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..664f9141e34cf30b79acdd26fec441e33e1b88d5 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/__pycache__/txtresults.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/__pycache__/xmlresults.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/__pycache__/xmlresults.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fa6585904ffeab254c380c3efec8d639119ba106 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/__pycache__/xmlresults.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/csvresults.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/csvresults.py new file mode 100644 index 0000000000000000000000000000000000000000..c75da0232caa695a3d27552ae28b478aa19d3558 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/csvresults.py @@ -0,0 +1,106 @@ +""" +This module implements a parser and serializer for the CSV SPARQL result +formats + +http://www.w3.org/TR/sparql11-results-csv-tsv/ +""" + +from __future__ import annotations + +import codecs +import csv +from io import BufferedIOBase, TextIOBase +from typing import IO, Dict, List, Optional, Union, cast + +from rdflib.plugins.sparql.processor import SPARQLResult +from rdflib.query import Result, ResultParser, ResultSerializer +from rdflib.term import BNode, Identifier, Literal, URIRef, Variable + + +class CSVResultParser(ResultParser): + """Parses SPARQL CSV results into a Result object.""" + + def __init__(self): + self.delim = "," + + # type error: Signature of "parse" incompatible with supertype "ResultParser" + def parse(self, source: IO, content_type: Optional[str] = None) -> Result: # type: ignore[override] + r = Result("SELECT") + + # type error: Incompatible types in assignment (expression has type "StreamReader", variable has type "IO[Any]") + if isinstance(source.read(0), bytes): + # if reading from source returns bytes do utf-8 decoding + # type error: Incompatible types in assignment (expression has type "StreamReader", variable has type "IO[Any]") + source = codecs.getreader("utf-8")(source) # type: ignore[assignment] + + reader = csv.reader(source, delimiter=self.delim) + r.vars = [Variable(x) for x in next(reader)] + r.bindings = [] + + for row in reader: + r.bindings.append(self.parseRow(row, r.vars)) + + return r + + def parseRow( + self, row: List[str], v: List[Variable] + ) -> Dict[Variable, Union[BNode, URIRef, Literal]]: + return dict( + (var, val) + for var, val in zip(v, [self.convertTerm(t) for t in row]) + if val is not None + ) + + def convertTerm(self, t: str) -> Optional[Union[BNode, URIRef, Literal]]: + if t == "": + return None + if t.startswith("_:"): + return BNode(t) # or generate new IDs? + if t.startswith("http://") or t.startswith("https://"): # TODO: more? + return URIRef(t) + return Literal(t) + + +class CSVResultSerializer(ResultSerializer): + """Serializes SPARQL results into CSV format.""" + + def __init__(self, result: SPARQLResult): + ResultSerializer.__init__(self, result) + + self.delim = "," + if result.type != "SELECT": + raise Exception("CSVSerializer can only serialize select query results") + + def serialize(self, stream: IO, encoding: str = "utf-8", **kwargs) -> None: + # the serialiser writes bytes in the given encoding + # in py3 csv.writer is unicode aware and writes STRINGS, + # so we encode afterward + + import codecs + + # TODO: Find a better solution for all this casting + writable_stream = cast(Union[TextIOBase, BufferedIOBase], stream) + if isinstance(writable_stream, TextIOBase): + string_stream: TextIOBase = writable_stream + else: + byte_stream = cast(BufferedIOBase, writable_stream) + string_stream = cast(TextIOBase, codecs.getwriter(encoding)(byte_stream)) + + out = csv.writer(string_stream, delimiter=self.delim) + + vs = [self.serializeTerm(v, encoding) for v in self.result.vars] # type: ignore[union-attr] + out.writerow(vs) + for row in self.result.bindings: + out.writerow( + [self.serializeTerm(row.get(v), encoding) for v in self.result.vars] # type: ignore[union-attr] + ) + + def serializeTerm( + self, term: Optional[Identifier], encoding: str + ) -> Union[str, Identifier]: + if term is None: + return "" + elif isinstance(term, BNode): + return f"_:{term}" + else: + return term diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/graph.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/graph.py new file mode 100644 index 0000000000000000000000000000000000000000..bfd03c00c005c4480b7d3d0f26e069df87cac227 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/graph.py @@ -0,0 +1,16 @@ +from __future__ import annotations + +from typing import IO, Optional + +from rdflib.graph import Graph +from rdflib.query import Result, ResultParser + + +class GraphResultParser(ResultParser): + # type error: Signature of "parse" incompatible with supertype "ResultParser" + def parse(self, source: IO, content_type: Optional[str]) -> Result: # type: ignore[override] + res = Result("CONSTRUCT") # hmm - or describe?type_) + res.graph = Graph() + res.graph.parse(source, format=content_type) + + return res diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/jsonresults.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/jsonresults.py new file mode 100644 index 0000000000000000000000000000000000000000..20f08405b1411f2777bb33a8b95d5cb7a34b0af8 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/jsonresults.py @@ -0,0 +1,170 @@ +"""A Serializer for SPARQL results in JSON: + +http://www.w3.org/TR/rdf-sparql-json-res/ + +Bits and pieces borrowed from: +http://projects.bigasterisk.com/sparqlhttp/ + +Authors: Drew Perttula, Gunnar Aastrand Grimnes +""" + +from __future__ import annotations + +import json +from typing import IO, Any, Dict, Mapping, MutableSequence, Optional + +from rdflib.query import Result, ResultException, ResultParser, ResultSerializer +from rdflib.term import BNode, Identifier, Literal, URIRef, Variable + +try: + import orjson + + _HAS_ORJSON = True +except ImportError: + orjson = None # type: ignore[assignment, unused-ignore] + _HAS_ORJSON = False + + +class JSONResultParser(ResultParser): + """Parses SPARQL JSON results into a Result object.""" + + # type error: Signature of "parse" incompatible with supertype "ResultParser" + def parse(self, source: IO, content_type: Optional[str] = None) -> Result: # type: ignore[override] + inp = source.read() + if _HAS_ORJSON: + try: + loaded = orjson.loads(inp) + except Exception as e: + raise ResultException(f"Failed to parse result: {e}") + else: + if isinstance(inp, bytes): + inp = inp.decode("utf-8") + loaded = json.loads(inp) + return JSONResult(loaded) + + +class JSONResultSerializer(ResultSerializer): + """Serializes SPARQL results to JSON format.""" + + def __init__(self, result: Result): + ResultSerializer.__init__(self, result) + + # type error: Signature of "serialize" incompatible with supertype "ResultSerializer" + def serialize(self, stream: IO, encoding: str = None) -> None: # type: ignore[override] + res: Dict[str, Any] = {} + if self.result.type == "ASK": + res["head"] = {} + res["boolean"] = self.result.askAnswer + else: + # select + res["results"] = {} + res["head"] = {} + res["head"]["vars"] = self.result.vars + res["results"]["bindings"] = [ + self._bindingToJSON(x) for x in self.result.bindings + ] + if _HAS_ORJSON: + try: + r_bytes = orjson.dumps(res, option=orjson.OPT_NON_STR_KEYS) + except Exception as e: + raise ResultException(f"Failed to serialize result: {e}") + if encoding is not None: + # Note, orjson will always write utf-8 even if + # encoding is specified as something else. + try: + stream.write(r_bytes) + except (TypeError, ValueError): + stream.write(r_bytes.decode("utf-8")) + else: + stream.write(r_bytes.decode("utf-8")) + else: + r_str = json.dumps(res, allow_nan=False, ensure_ascii=False) + if encoding is not None: + try: + stream.write(r_str.encode(encoding)) + except (TypeError, ValueError): + stream.write(r_str) + else: + stream.write(r_str) + + def _bindingToJSON(self, b: Mapping[Variable, Identifier]) -> Dict[Variable, Any]: + res = {} + for var in b: + j = termToJSON(self, b[var]) + if j is not None: + res[var] = termToJSON(self, b[var]) + return res + + +class JSONResult(Result): + def __init__(self, json: Dict[str, Any]): + self.json = json + if "boolean" in json: + type_ = "ASK" + elif "results" in json: + type_ = "SELECT" + else: + raise ResultException("No boolean or results in json!") + + Result.__init__(self, type_) + + if type_ == "ASK": + self.askAnswer = bool(json["boolean"]) + else: + self.bindings = self._get_bindings() + self.vars = [Variable(x) for x in json["head"]["vars"]] + + def _get_bindings(self) -> MutableSequence[Mapping[Variable, Identifier]]: + ret: MutableSequence[Mapping[Variable, Identifier]] = [] + for row in self.json["results"]["bindings"]: + outRow: Dict[Variable, Identifier] = {} + for k, v in row.items(): + outRow[Variable(k)] = parseJsonTerm(v) + ret.append(outRow) + return ret + + +def parseJsonTerm(d: Dict[str, str]) -> Identifier: + """rdflib object (Literal, URIRef, BNode) for the given json-format dict. + + input is like: + + ```json + { 'type': 'uri', 'value': 'http://famegame.com/2006/01/username' } + { 'type': 'literal', 'value': 'drewp' } + ``` + """ + + t = d["type"] + if t == "uri": + return URIRef(d["value"]) + elif t == "literal": + return Literal(d["value"], datatype=d.get("datatype"), lang=d.get("xml:lang")) + elif t == "typed-literal": + return Literal(d["value"], datatype=URIRef(d["datatype"])) + elif t == "bnode": + return BNode(d["value"]) + else: + raise NotImplementedError("json term type %r" % t) + + +def termToJSON( + self: JSONResultSerializer, term: Optional[Identifier] +) -> Optional[Dict[str, str]]: + if isinstance(term, URIRef): + return {"type": "uri", "value": str(term)} + elif isinstance(term, Literal): + r = {"type": "literal", "value": str(term)} + + if term.datatype is not None: + r["datatype"] = str(term.datatype) + if term.language is not None: + r["xml:lang"] = term.language + return r + + elif isinstance(term, BNode): + return {"type": "bnode", "value": str(term)} + elif term is None: + return None + else: + raise ResultException("Unknown term type: %s (%s)" % (term, type(term))) diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/rdfresults.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/rdfresults.py new file mode 100644 index 0000000000000000000000000000000000000000..c59a40c144d83b0bafbb4db4fa4082fd4c31a3c1 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/rdfresults.py @@ -0,0 +1,70 @@ +from __future__ import annotations + +from typing import IO, Any, MutableMapping, Optional, Union + +from rdflib.graph import Graph +from rdflib.namespace import RDF, Namespace +from rdflib.query import Result, ResultParser +from rdflib.term import Node, Variable + +RS = Namespace("http://www.w3.org/2001/sw/DataAccess/tests/result-set#") + + +class RDFResultParser(ResultParser): + def parse(self, source: Union[IO, Graph], **kwargs: Any) -> Result: + return RDFResult(source, **kwargs) + + +class RDFResult(Result): + def __init__(self, source: Union[IO, Graph], **kwargs: Any): + if not isinstance(source, Graph): + graph = Graph() + graph.parse(source, **kwargs) + else: + graph = source + + rs = graph.value(predicate=RDF.type, object=RS.ResultSet) + # there better be only one :) + + if rs is None: + type_ = "CONSTRUCT" + + # use a new graph + g = Graph() + g += graph + + else: + askAnswer = graph.value(rs, RS.boolean) + + if askAnswer is not None: + type_ = "ASK" + else: + type_ = "SELECT" + + Result.__init__(self, type_) + + if type_ == "SELECT": + # type error: Argument 1 to "Variable" has incompatible type "Node"; expected "str" + self.vars = [Variable(v) for v in graph.objects(rs, RS.resultVariable)] # type: ignore[arg-type] + + self.bindings = [] + + for s in graph.objects(rs, RS.solution): + sol: MutableMapping[Variable, Optional[Node]] = {} + for b in graph.objects(s, RS.binding): + # type error: Argument 1 to "Variable" has incompatible type "Optional[Node]"; expected "str" + sol[Variable(graph.value(b, RS.variable))] = graph.value( # type: ignore[arg-type] + b, RS.value + ) + # error: Argument 1 to "append" of "list" has incompatible type "MutableMapping[Variable, Optional[Node]]"; expected "Mapping[Variable, Identifier]" + self.bindings.append(sol) # type: ignore[arg-type] + elif type_ == "ASK": + # type error: Item "Node" of "Optional[Node]" has no attribute "value" + # type error: Item "None" of "Optional[Node]" has no attribute "value" + self.askAnswer = askAnswer.value # type: ignore[union-attr] + # type error: Item "Node" of "Optional[Node]" has no attribute "value" + # type error: Item "None" of "Optional[Node]" has no attribute "value" + if askAnswer.value is None: # type: ignore[union-attr] + raise Exception("Malformed boolean in ask answer!") + elif type_ == "CONSTRUCT": + self.graph = g diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/tsvresults.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/tsvresults.py new file mode 100644 index 0000000000000000000000000000000000000000..54d8ee16e6e232968c362618877c83ee0d1beb96 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/tsvresults.py @@ -0,0 +1,116 @@ +""" +This implements the Tab Separated SPARQL Result Format + +It is implemented with pyparsing, reusing the elements from the SPARQL Parser +""" + +from __future__ import annotations + +import codecs +import typing +from typing import IO, Union + +from pyparsing import ( + FollowedBy, + LineEnd, + Literal, + Optional, + ParserElement, + Suppress, + ZeroOrMore, +) + +from rdflib.plugins.sparql.parser import ( + BLANK_NODE_LABEL, + IRIREF, + LANGTAG, + STRING_LITERAL1, + STRING_LITERAL2, + BooleanLiteral, + NumericLiteral, + Var, +) +from rdflib.plugins.sparql.parserutils import Comp, CompValue, Param +from rdflib.query import Result, ResultParser +from rdflib.term import BNode, Identifier, URIRef +from rdflib.term import Literal as RDFLiteral + +ParserElement.set_default_whitespace_chars(" \n") + + +String = STRING_LITERAL1 | STRING_LITERAL2 + +RDFLITERAL = Comp( + "literal", + Param("string", String) + + Optional( + Param("lang", LANGTAG.leave_whitespace()) + | Literal("^^").leave_whitespace() + + Param("datatype", IRIREF).leave_whitespace() + ), +) + +NONE_VALUE = object() + +EMPTY = FollowedBy(LineEnd()) | FollowedBy("\t") +EMPTY.set_parse_action(lambda x: NONE_VALUE) + +TERM = RDFLITERAL | IRIREF | BLANK_NODE_LABEL | NumericLiteral | BooleanLiteral + +ROW = (EMPTY | TERM) + ZeroOrMore(Suppress("\t") + (EMPTY | TERM)) +ROW.parse_with_tabs() + +HEADER = Var + ZeroOrMore(Suppress("\t") + Var) +HEADER.parse_with_tabs() + + +class TSVResultParser(ResultParser): + """Parses SPARQL TSV results into a Result object.""" + + # type error: Signature of "parse" incompatible with supertype "ResultParser" [override] + def parse(self, source: IO, content_type: typing.Optional[str] = None) -> Result: # type: ignore[override] + if isinstance(source.read(0), bytes): + # if reading from source returns bytes do utf-8 decoding + # type error: Incompatible types in assignment (expression has type "StreamReader", variable has type "IO[Any]") + source = codecs.getreader("utf-8")(source) # type: ignore[assignment] + + r = Result("SELECT") + + header = source.readline() + + r.vars = list(HEADER.parse_string(header.strip(), parse_all=True)) + r.bindings = [] + while True: + line = source.readline() + if not line: + break + line = line.strip("\n") + if line == "": + continue + + row = ROW.parse_string(line, parse_all=True) + this_row_dict = {} + for var, val_read in zip(r.vars, row): + val = self.convertTerm(val_read) + if val is None: + # Skip unbound vars + continue + this_row_dict[var] = val + # Preserve solution row cardinality, including fully-unbound rows. + r.bindings.append(this_row_dict) + return r + + def convertTerm( + self, t: Union[object, RDFLiteral, BNode, CompValue, URIRef] + ) -> typing.Optional[Identifier]: + if t is NONE_VALUE: + return None + if isinstance(t, CompValue): + if t.name == "literal": + return RDFLiteral(t.string, lang=t.lang, datatype=t.datatype) + else: + raise Exception("I dont know how to handle this: %s" % (t,)) + elif isinstance(t, (RDFLiteral, BNode, URIRef)): + return t + else: + raise ValueError(f"Unexpected type {type(t)} found in TSV result") diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/txtresults.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/txtresults.py new file mode 100644 index 0000000000000000000000000000000000000000..86d8933e34d1cfdd1233f69626b14c25d1e737c7 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/txtresults.py @@ -0,0 +1,86 @@ +from __future__ import annotations + +from io import StringIO +from typing import IO, List, Optional, Union + +from rdflib.namespace import NamespaceManager +from rdflib.query import ResultSerializer +from rdflib.term import BNode, Literal, URIRef, Variable + + +def _termString( + t: Optional[Union[URIRef, Literal, BNode]], + namespace_manager: Optional[NamespaceManager], +) -> str: + if t is None: + return "-" + if namespace_manager: + if isinstance(t, URIRef): + return namespace_manager.normalizeUri(t) + elif isinstance(t, BNode): + return t.n3() + elif isinstance(t, Literal): + return t._literal_n3(qname_callback=namespace_manager.normalizeUri) + else: + return t.n3() + + +class TXTResultSerializer(ResultSerializer): + """ + A write-only QueryResult serializer for text/ascii tables + """ + + def serialize( + self, + stream: IO, + encoding: str = "utf-8", + *, + namespace_manager: Optional[NamespaceManager] = None, + **kwargs, + ) -> None: + """ + return a text table of query results + """ + + def c(s, w): + """ + center the string s in w wide string + """ + w -= len(s) + h1 = h2 = w // 2 + if w % 2: + h2 += 1 + return " " * h1 + s + " " * h2 + + if self.result.type != "SELECT": + raise Exception("Can only pretty print SELECT results!") + string_stream = StringIO() + if not self.result: + string_stream.write("(no results)\n") + else: + keys: List[Variable] = self.result.vars # type: ignore[assignment] + maxlen = [0] * len(keys) + b = [ + # type error: Value of type "Union[Tuple[Node, Node, Node], bool, ResultRow]" is not indexable + # type error: Argument 1 to "_termString" has incompatible type "Union[Node, Any]"; expected "Union[URIRef, Literal, BNode, None]" [arg-type] + # type error: No overload variant of "__getitem__" of "tuple" matches argument type "Variable" + # NOTE on type error: The problem here is that r can be more types than _termString expects because result can be a result of multiple types. + [_termString(r[k], namespace_manager) for k in keys] # type: ignore[index, arg-type, call-overload] + for r in self.result + ] + for r in b: + for i in range(len(keys)): + maxlen[i] = max(maxlen[i], len(r[i])) + string_stream.write( + "|".join([c(k, maxlen[i]) for i, k in enumerate(keys)]) + "\n" + ) + string_stream.write("-" * (len(maxlen) + sum(maxlen)) + "\n") + for r in sorted(b): + string_stream.write( + "|".join([t + " " * (i - len(t)) for i, t in zip(maxlen, r)]) + "\n" + ) + text_val = string_stream.getvalue() + try: + stream.write(text_val.encode(encoding)) + except (TypeError, ValueError): + stream.write(text_val) diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/xmlresults.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/xmlresults.py new file mode 100644 index 0000000000000000000000000000000000000000..b02c171a055d4041dbf78e837aa341d2b0146515 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/results/xmlresults.py @@ -0,0 +1,305 @@ +"""A Parser for SPARQL results in XML: + +http://www.w3.org/TR/rdf-sparql-XMLres/ + +Bits and pieces borrowed from: +http://projects.bigasterisk.com/sparqlhttp/ + +Authors: Drew Perttula, Gunnar Aastrand Grimnes +""" + +from __future__ import annotations + +import logging +import xml.etree.ElementTree as xml_etree # noqa: N813 +from io import BytesIO +from typing import ( + IO, + TYPE_CHECKING, + Any, + BinaryIO, + Dict, + Optional, + Sequence, + TextIO, + Tuple, + Union, + cast, +) +from xml.dom import XML_NAMESPACE +from xml.sax.saxutils import XMLGenerator +from xml.sax.xmlreader import AttributesNSImpl + +from rdflib.query import Result, ResultException, ResultParser, ResultSerializer +from rdflib.term import BNode, Identifier, Literal, URIRef, Variable + +try: + # https://adamj.eu/tech/2021/12/29/python-type-hints-optional-imports/ + import lxml.etree as lxml_etree + + FOUND_LXML = True +except ImportError: + FOUND_LXML = False + +SPARQL_XML_NAMESPACE = "http://www.w3.org/2005/sparql-results#" +RESULTS_NS_ET = "{%s}" % SPARQL_XML_NAMESPACE + +log = logging.getLogger(__name__) + + +class XMLResultParser(ResultParser): + """A Parser for SPARQL results in XML.""" + + # TODO FIXME: content_type should be a keyword only arg. + def parse(self, source: IO, content_type: Optional[str] = None) -> Result: # type: ignore[override] + return XMLResult(source) + + +class XMLResult(Result): + def __init__(self, source: IO, content_type: Optional[str] = None): + parser_encoding: Optional[str] = None + if hasattr(source, "encoding"): + if TYPE_CHECKING: + assert isinstance(source, TextIO) + parser_encoding = "utf-8" + source_str = source.read() + source = BytesIO(source_str.encode(parser_encoding)) + else: + if TYPE_CHECKING: + assert isinstance(source, BinaryIO) + + if FOUND_LXML: + lxml_parser = lxml_etree.XMLParser(huge_tree=True, encoding=parser_encoding) + tree = cast( + xml_etree.ElementTree, + lxml_etree.parse(source, parser=lxml_parser), + ) + else: + xml_parser = xml_etree.XMLParser(encoding=parser_encoding) + tree = xml_etree.parse(source, parser=xml_parser) + + boolean = tree.find(RESULTS_NS_ET + "boolean") + results = tree.find(RESULTS_NS_ET + "results") + + if boolean is not None: + type_ = "ASK" + elif results is not None: + type_ = "SELECT" + else: + raise ResultException("No RDF result-bindings or boolean answer found!") + + Result.__init__(self, type_) + + if type_ == "SELECT": + self.bindings = [] + for result in results: # type: ignore[union-attr] + if result.tag != f"{RESULTS_NS_ET}result": + # This is here because with lxml this also gets comments, + # not just elements. Also this should not operate on non + # "result" elements. + continue + r = {} + for binding in result: + if binding.tag != f"{RESULTS_NS_ET}binding": + # This is here because with lxml this also gets + # comments, not just elements. Also this should not + # operate on non "binding" elements. + continue + # type error: error: Argument 1 to "Variable" has incompatible type "Union[str, None, Any]"; expected "str" + # NOTE on type error: Element.get() can return None, and + # this will invariably fail if passed into Variable + # constructor as value + r[Variable(binding.get("name"))] = parseTerm(binding[0]) # type: ignore[arg-type] # FIXME + self.bindings.append(r) + + self.vars = [ + # type error: Argument 1 to "Variable" has incompatible type "Optional[str]"; expected "str" + # NOTE on type error: Element.get() can return None, and this + # will invariably fail if passed into Variable constructor as + # value + Variable(x.get("name")) # type: ignore[arg-type] # FIXME + for x in tree.findall( + "./%shead/%svariable" % (RESULTS_NS_ET, RESULTS_NS_ET) + ) + ] + + else: + self.askAnswer = boolean.text.lower().strip() == "true" # type: ignore[union-attr] + + +def parseTerm(element: xml_etree.Element) -> Union[URIRef, Literal, BNode]: + """rdflib object (Literal, URIRef, BNode) for the given + elementtree element""" + tag, text = element.tag, element.text + if tag == RESULTS_NS_ET + "literal": + if text is None: + text = "" + datatype = None + lang = None + if element.get("datatype", None): + # type error: Argument 1 to "URIRef" has incompatible type "Optional[str]"; expected "str" + datatype = URIRef(element.get("datatype")) # type: ignore[arg-type] + elif element.get("{%s}lang" % XML_NAMESPACE, None): + lang = element.get("{%s}lang" % XML_NAMESPACE) + + ret = Literal(text, datatype=datatype, lang=lang) + + return ret + elif tag == RESULTS_NS_ET + "uri": + # type error: Argument 1 to "URIRef" has incompatible type "Optional[str]"; expected "str" + return URIRef(text) # type: ignore[arg-type] + elif tag == RESULTS_NS_ET + "bnode": + return BNode(text) + else: + raise TypeError("unknown binding type %r" % element) + + +class XMLResultSerializer(ResultSerializer): + """Serializes SPARQL results into XML format.""" + + def __init__(self, result: Result): + ResultSerializer.__init__(self, result) + + def serialize(self, stream: IO, encoding: str = "utf-8", **kwargs: Any) -> None: + writer = SPARQLXMLWriter(stream, encoding) + if self.result.type == "ASK": + writer.write_header([]) + # type error: Argument 1 to "write_ask" of "SPARQLXMLWriter" has incompatible type "Optional[bool]"; expected "bool" + writer.write_ask(self.result.askAnswer) # type: ignore[arg-type] + else: + # type error: Argument 1 to "write_header" of "SPARQLXMLWriter" has incompatible type "Optional[List[Variable]]"; expected "Sequence[Variable]" + writer.write_header(self.result.vars) # type: ignore[arg-type] + writer.write_results_header() + for b in self.result.bindings: + writer.write_start_result() + for key, val in b.items(): + writer.write_binding(key, val) + + writer.write_end_result() + + writer.close() + + +# TODO: Rewrite with ElementTree? +class SPARQLXMLWriter: + """ + Python saxutils-based SPARQL XML Writer + """ + + def __init__(self, output: IO, encoding: str = "utf-8"): + writer = XMLGenerator(output, encoding) + writer.startDocument() + writer.startPrefixMapping("", SPARQL_XML_NAMESPACE) + writer.startPrefixMapping("xml", XML_NAMESPACE) + writer.startElementNS( + (SPARQL_XML_NAMESPACE, "sparql"), "sparql", AttributesNSImpl({}, {}) + ) + self.writer = writer + self._output = output + self._encoding = encoding + self._results = False + + def write_header(self, allvarsL: Sequence[Variable]) -> None: + self.writer.startElementNS( + (SPARQL_XML_NAMESPACE, "head"), "head", AttributesNSImpl({}, {}) + ) + for i in range(0, len(allvarsL)): + attr_vals = { + (None, "name"): str(allvarsL[i]), + } + attr_qnames = { + (None, "name"): "name", + } + self.writer.startElementNS( + (SPARQL_XML_NAMESPACE, "variable"), + "variable", + # type error: Argument 1 to "AttributesNSImpl" has incompatible type "Dict[Tuple[None, str], str]"; expected "Mapping[Tuple[str, str], str]" + # type error: Argument 2 to "AttributesNSImpl" has incompatible type "Dict[Tuple[None, str], str]"; expected "Mapping[Tuple[str, str], str]" [arg-type] + AttributesNSImpl(attr_vals, attr_qnames), # type: ignore[arg-type] + ) + self.writer.endElementNS((SPARQL_XML_NAMESPACE, "variable"), "variable") + self.writer.endElementNS((SPARQL_XML_NAMESPACE, "head"), "head") + + def write_ask(self, val: bool) -> None: + self.writer.startElementNS( + (SPARQL_XML_NAMESPACE, "boolean"), "boolean", AttributesNSImpl({}, {}) + ) + self.writer.characters(str(val).lower()) + self.writer.endElementNS((SPARQL_XML_NAMESPACE, "boolean"), "boolean") + + def write_results_header(self) -> None: + self.writer.startElementNS( + (SPARQL_XML_NAMESPACE, "results"), "results", AttributesNSImpl({}, {}) + ) + self._results = True + + def write_start_result(self) -> None: + self.writer.startElementNS( + (SPARQL_XML_NAMESPACE, "result"), "result", AttributesNSImpl({}, {}) + ) + self._resultStarted = True + + def write_end_result(self) -> None: + assert self._resultStarted + self.writer.endElementNS((SPARQL_XML_NAMESPACE, "result"), "result") + self._resultStarted = False + + def write_binding(self, name: Variable, val: Identifier) -> None: + assert self._resultStarted + + attr_vals: Dict[Tuple[Optional[str], str], str] = { + (None, "name"): str(name), + } + attr_qnames: Dict[Tuple[Optional[str], str], str] = { + (None, "name"): "name", + } + self.writer.startElementNS( + (SPARQL_XML_NAMESPACE, "binding"), + "binding", + # type error: Argument 1 to "AttributesNSImpl" has incompatible type "Dict[Tuple[None, str], str]"; expected "Mapping[Tuple[str, str], str]" + # type error: Argument 2 to "AttributesNSImpl" has incompatible type "Dict[Tuple[None, str], str]"; expected "Mapping[Tuple[str, str], str]" + AttributesNSImpl(attr_vals, attr_qnames), # type: ignore[arg-type, unused-ignore] + ) + + if isinstance(val, URIRef): + self.writer.startElementNS( + (SPARQL_XML_NAMESPACE, "uri"), "uri", AttributesNSImpl({}, {}) + ) + self.writer.characters(val) + self.writer.endElementNS((SPARQL_XML_NAMESPACE, "uri"), "uri") + elif isinstance(val, BNode): + self.writer.startElementNS( + (SPARQL_XML_NAMESPACE, "bnode"), "bnode", AttributesNSImpl({}, {}) + ) + self.writer.characters(val) + self.writer.endElementNS((SPARQL_XML_NAMESPACE, "bnode"), "bnode") + elif isinstance(val, Literal): + attr_vals = {} + attr_qnames = {} + if val.language: + attr_vals[(XML_NAMESPACE, "lang")] = val.language + attr_qnames[(XML_NAMESPACE, "lang")] = "xml:lang" + elif val.datatype: + attr_vals[(None, "datatype")] = val.datatype + attr_qnames[(None, "datatype")] = "datatype" + + self.writer.startElementNS( + (SPARQL_XML_NAMESPACE, "literal"), + "literal", + # type error: Argument 1 to "AttributesNSImpl" has incompatible type "Dict[Tuple[Optional[str], str], str]"; expected "Mapping[Tuple[str, str], str]" + # type error: Argument 2 to "AttributesNSImpl" has incompatible type "Dict[Tuple[Optional[str], str], str]"; expected "Mapping[Tuple[str, str], str]" + AttributesNSImpl(attr_vals, attr_qnames), # type: ignore[arg-type, unused-ignore] + ) + self.writer.characters(val) + self.writer.endElementNS((SPARQL_XML_NAMESPACE, "literal"), "literal") + + else: + raise Exception("Unsupported RDF term: %s" % val) + + self.writer.endElementNS((SPARQL_XML_NAMESPACE, "binding"), "binding") + + def close(self) -> None: + if self._results: + self.writer.endElementNS((SPARQL_XML_NAMESPACE, "results"), "results") + self.writer.endElementNS((SPARQL_XML_NAMESPACE, "sparql"), "sparql") + self.writer.endDocument() diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/sparql.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/sparql.py new file mode 100644 index 0000000000000000000000000000000000000000..518d8fcd870db296c2ae650c090d9c4a6f30f575 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/sparql.py @@ -0,0 +1,500 @@ +from __future__ import annotations + +import collections +import datetime +import itertools +import typing as t +from collections.abc import Mapping, MutableMapping +from typing import ( + TYPE_CHECKING, + Any, + Container, + Dict, + Generator, + Iterable, + List, + Optional, + Tuple, + TypeVar, + Union, +) + +import rdflib.plugins.sparql +from rdflib.graph import ConjunctiveGraph, Dataset, Graph +from rdflib.namespace import NamespaceManager +from rdflib.plugins.sparql.parserutils import CompValue +from rdflib.term import BNode, Identifier, Literal, Node, URIRef, Variable + +if TYPE_CHECKING: + from rdflib.paths import Path + + +_AnyT = TypeVar("_AnyT") + + +class SPARQLError(Exception): + def __init__(self, msg: Optional[str] = None): + Exception.__init__(self, msg) + + +class NotBoundError(SPARQLError): + def __init__(self, msg: Optional[str] = None): + SPARQLError.__init__(self, msg) + + +class AlreadyBound(SPARQLError): # noqa: N818 + """Raised when trying to bind a variable that is already bound!""" + + def __init__(self): + SPARQLError.__init__(self) + + +class SPARQLTypeError(SPARQLError): + def __init__(self, msg: Optional[str]): + SPARQLError.__init__(self, msg) + + +class Bindings(MutableMapping): + """ + + A single level of a stack of variable-value bindings. + Each dict keeps a reference to the dict below it, + any failed lookup is propegated back + + In python 3.3 this could be a collections.ChainMap + """ + + def __init__(self, outer: Optional[Bindings] = None, d=[]): + self._d: Dict[str, str] = dict(d) + self.outer = outer + + def __getitem__(self, key: str) -> str: + if key in self._d: + return self._d[key] + + if not self.outer: + raise KeyError() + return self.outer[key] + + def __contains__(self, key: Any) -> bool: + try: + self[key] + return True + except KeyError: + return False + + def __setitem__(self, key: str, value: Any) -> None: + self._d[key] = value + + def __delitem__(self, key: str) -> None: + raise Exception("DelItem is not implemented!") + + def __len__(self) -> int: + i = 0 + d: Optional[Bindings] = self + while d is not None: + i += len(d._d) + d = d.outer + return i + + def __iter__(self) -> Generator[str, None, None]: + d: Optional[Bindings] = self + while d is not None: + yield from d._d + d = d.outer + + def __str__(self) -> str: + # type error: Generator has incompatible item type "Tuple[Any, str]"; expected "str" + return "Bindings({" + ", ".join((k, self[k]) for k in self) + "})" # type: ignore[misc] + + def __repr__(self) -> str: + return str(self) + + +class FrozenDict(Mapping): + """ + An immutable hashable dict + + Taken from http://stackoverflow.com/a/2704866/81121 + + """ + + def __init__(self, *args: Any, **kwargs: Any): + self._d: Dict[Identifier, Identifier] = dict(*args, **kwargs) + self._hash: Optional[int] = None + + def __iter__(self): + return iter(self._d) + + def __len__(self) -> int: + return len(self._d) + + def __getitem__(self, key: Identifier) -> Identifier: + return self._d[key] + + def __hash__(self) -> int: + # It would have been simpler and maybe more obvious to + # use hash(tuple(sorted(self._d.items()))) from this discussion + # so far, but this solution is O(n). I don't know what kind of + # n we are going to run into, but sometimes it's hard to resist the + # urge to optimize when it will gain improved algorithmic performance. + if self._hash is None: + self._hash = 0 + for key, value in self.items(): + self._hash ^= hash(key) + self._hash ^= hash(value) + return self._hash + + def project(self, vars: Container[Variable]) -> FrozenDict: + return FrozenDict(x for x in self.items() if x[0] in vars) + + def disjointDomain(self, other: t.Mapping[Identifier, Identifier]) -> bool: + return not bool(set(self).intersection(other)) + + def compatible(self, other: t.Mapping[Identifier, Identifier]) -> bool: + for k in self: + try: + if self[k] != other[k]: + return False + except KeyError: + pass + + return True + + def merge(self, other: t.Mapping[Identifier, Identifier]) -> FrozenDict: + res = FrozenDict(itertools.chain(self.items(), other.items())) + + return res + + def __str__(self) -> str: + return str(self._d) + + def __repr__(self) -> str: + return repr(self._d) + + +class FrozenBindings(FrozenDict): + def __init__(self, ctx: QueryContext, *args, **kwargs): + FrozenDict.__init__(self, *args, **kwargs) + self.ctx = ctx + + def __getitem__(self, key: Union[Identifier, str]) -> Identifier: + if not isinstance(key, Node): + key = Variable(key) + + if not isinstance(key, (BNode, Variable)): + return key + + if key not in self._d: + # type error: Value of type "Optional[Dict[Variable, Identifier]]" is not indexable + # type error: Invalid index type "Union[BNode, Variable]" for "Optional[Dict[Variable, Identifier]]"; expected type "Variable" + return self.ctx.initBindings[key] # type: ignore[index] + else: + return self._d[key] + + def project(self, vars: Container[Variable]) -> FrozenBindings: + return FrozenBindings(self.ctx, (x for x in self.items() if x[0] in vars)) + + def merge(self, other: t.Mapping[Identifier, Identifier]) -> FrozenBindings: + res = FrozenBindings(self.ctx, itertools.chain(self.items(), other.items())) + return res + + @property + def now(self) -> datetime.datetime: + return self.ctx.now + + @property + def bnodes(self) -> t.Mapping[Identifier, BNode]: + return self.ctx.bnodes + + @property + def prologue(self) -> Optional[Prologue]: + return self.ctx.prologue + + def forget( + self, before: QueryContext, _except: Optional[Container[Variable]] = None + ) -> FrozenBindings: + """ + return a frozen dict only of bindings made in self + since before + """ + if not _except: + _except = [] + + # bindings from initBindings are newer forgotten + return FrozenBindings( + self.ctx, + ( + x + for x in self.items() + if ( + x[0] in _except + # type error: Unsupported right operand type for in ("Optional[Dict[Variable, Identifier]]") + or x[0] in self.ctx.initBindings # type: ignore[operator] + or before[x[0]] is None + ) + ), + ) + + def remember(self, these) -> FrozenBindings: + """ + return a frozen dict only of bindings in these + """ + return FrozenBindings(self.ctx, (x for x in self.items() if x[0] in these)) + + +class QueryContext: + """ + Query context - passed along when evaluating the query + """ + + def __init__( + self, + graph: Optional[Graph] = None, + bindings: Optional[Union[Bindings, FrozenBindings, List[Any]]] = None, + initBindings: Optional[Mapping[str, Identifier]] = None, + datasetClause=None, + ): + self.initBindings = initBindings + self.bindings = Bindings(d=bindings or []) + if initBindings: + self.bindings.update(initBindings) + + self.graph: Optional[Graph] + self._dataset: Optional[Union[Dataset, ConjunctiveGraph]] + if isinstance(graph, (Dataset, ConjunctiveGraph)): + if datasetClause: + self._dataset = Dataset() + self.graph = Graph() + for d in datasetClause: + if d.default: + from_graph = graph.get_context(d.default) + self.graph += from_graph + if not from_graph: + self.load(d.default, default=True) + elif d.named: + namedGraphs = Graph( + store=self.dataset.store, identifier=d.named + ) + from_named_graphs = graph.get_context(d.named) + namedGraphs += from_named_graphs + if not from_named_graphs: + self.load(d.named, default=False) + else: + self._dataset = graph + if rdflib.plugins.sparql.SPARQL_DEFAULT_GRAPH_UNION: + self.graph = self.dataset + else: + self.graph = self.dataset.default_context + else: + self._dataset = None + self.graph = graph + + self.prologue: Optional[Prologue] = None + self._now: Optional[datetime.datetime] = None + + self.bnodes: t.MutableMapping[Identifier, BNode] = collections.defaultdict( + BNode + ) + + @property + def now(self) -> datetime.datetime: + if self._now is None: + self._now = datetime.datetime.now(datetime.timezone.utc) + return self._now + + def clone( + self, bindings: Optional[Union[FrozenBindings, Bindings, List[Any]]] = None + ) -> QueryContext: + r = QueryContext( + self._dataset if self._dataset is not None else self.graph, + bindings or self.bindings, + initBindings=self.initBindings, + ) + r.prologue = self.prologue + r.graph = self.graph + r.bnodes = self.bnodes + return r + + @property + def dataset(self) -> ConjunctiveGraph: + """ "current dataset""" + if self._dataset is None: + raise Exception( + "You performed a query operation requiring " + + "a dataset (i.e. ConjunctiveGraph), but " + + "operating currently on a single graph." + ) + return self._dataset + + def load( + self, + source: URIRef, + default: bool = False, + into: Optional[Identifier] = None, + **kwargs: Any, + ) -> None: + """ + Load data from the source into the query context's. + + Args: + source: The source to load from. + default: If `True`, triples from the source will be added + to the default graph, otherwise it will be loaded into a + graph with `source` URI as its name. + into: The name of the graph to load the data into. If + `None`, the source URI will be used as as the name of the + graph. + **kwargs: Keyword arguments to pass to + [`parse`][rdflib.graph.Graph.parse]. + """ + + def _load(graph, source): + try: + return graph.parse(source, format="turtle", **kwargs) + except Exception: + pass + try: + return graph.parse(source, format="xml", **kwargs) + except Exception: + pass + try: + return graph.parse(source, format="n3", **kwargs) + except Exception: + pass + try: + return graph.parse(source, format="nt", **kwargs) + except Exception: + raise Exception( + "Could not load %s as either RDF/XML, N3 or NTriples" % source + ) + + if not rdflib.plugins.sparql.SPARQL_LOAD_GRAPHS: + # we are not loading - if we already know the graph + # being "loaded", just add it to the default-graph + if default: + # Unsupported left operand type for + ("None") + self.graph += self.dataset.get_context(source) # type: ignore[operator] + else: + if default: + _load(self.graph, source) + else: + if into is None: + into = source + _load(self.dataset.get_context(into), source) + + def __getitem__(self, key: Union[str, Path]) -> Optional[Union[str, Path]]: + # in SPARQL BNodes are just labels + if not isinstance(key, (BNode, Variable)): + return key + try: + return self.bindings[key] + except KeyError: + return None + + def get(self, key: str, default: Optional[Any] = None) -> Any: + try: + return self[key] + except KeyError: + return default + + def solution(self, vars: Optional[Iterable[Variable]] = None) -> FrozenBindings: + """ + Return a static copy of the current variable bindings as dict + """ + if vars: + return FrozenBindings( + self, ((k, v) for k, v in self.bindings.items() if k in vars) + ) + else: + return FrozenBindings(self, self.bindings.items()) + + def __setitem__(self, key: str, value: str) -> None: + if key in self.bindings and self.bindings[key] != value: + raise AlreadyBound() + + self.bindings[key] = value + + def pushGraph(self, graph: Optional[Graph]) -> QueryContext: + r = self.clone() + r.graph = graph + return r + + def push(self) -> QueryContext: + r = self.clone(Bindings(self.bindings)) + return r + + def clean(self) -> QueryContext: + return self.clone([]) + + def thaw(self, frozenbindings: FrozenBindings) -> QueryContext: + """ + Create a new read/write query context from the given solution + """ + c = self.clone(frozenbindings) + + return c + + +class Prologue: + """ + A class for holding prefixing bindings and base URI information + """ + + def __init__(self) -> None: + self.base: Optional[str] = None + self.namespace_manager = NamespaceManager(Graph()) # ns man needs a store + + def resolvePName(self, prefix: Optional[str], localname: Optional[str]) -> URIRef: + ns = self.namespace_manager.store.namespace(prefix or "") + if ns is None: + raise Exception("Unknown namespace prefix : %s" % prefix) + return URIRef(ns + (localname or "")) + + def bind(self, prefix: Optional[str], uri: Any) -> None: + self.namespace_manager.bind(prefix, uri, replace=True) + + def absolutize( + self, iri: Optional[Union[CompValue, str]] + ) -> Optional[Union[CompValue, str]]: + """ + Apply BASE / PREFIXes to URIs + (and to datatypes in Literals) + + TODO: Move resolving URIs to pre-processing + """ + + if isinstance(iri, CompValue): + if iri.name == "pname": + return self.resolvePName(iri.prefix, iri.localname) + if iri.name == "literal": + # type error: Argument "datatype" to "Literal" has incompatible type "Union[CompValue, Identifier, None]"; expected "Optional[str]" + return Literal( + iri.string, lang=iri.lang, datatype=self.absolutize(iri.datatype) # type: ignore[arg-type] + ) + elif isinstance(iri, URIRef) and not ":" in iri: # noqa: E713 + return URIRef(iri, base=self.base) + + return iri + + +class Query: + """ + A parsed and translated query + """ + + def __init__(self, prologue: Prologue, algebra: CompValue): + self.prologue = prologue + self.algebra = algebra + self._original_args: Tuple[str, Mapping[str, str], Optional[str]] + + +class Update: + """ + A parsed and translated update + """ + + def __init__(self, prologue: Prologue, algebra: List[CompValue]): + self.prologue = prologue + self.algebra = algebra + self._original_args: Tuple[str, Mapping[str, str], Optional[str]] diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/update.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/update.py new file mode 100644 index 0000000000000000000000000000000000000000..5ec1e283e299de47e1366db45cbedd783cc8c828 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/sparql/update.py @@ -0,0 +1,352 @@ +""" +Code for carrying out Update Operations +""" + +from __future__ import annotations + +from typing import TYPE_CHECKING, Iterator, Mapping, Optional, Sequence + +from rdflib.graph import Graph +from rdflib.plugins.sparql.evaluate import evalBGP, evalPart +from rdflib.plugins.sparql.evalutils import _fillTemplate, _join +from rdflib.plugins.sparql.parserutils import CompValue +from rdflib.plugins.sparql.sparql import FrozenDict, QueryContext, Update +from rdflib.term import Identifier, URIRef, Variable + + +def _graphOrDefault(ctx: QueryContext, g: str) -> Optional[Graph]: + if g == "DEFAULT": + return ctx.graph + else: + return ctx.dataset.get_context(g) + + +def _graphAll(ctx: QueryContext, g: str) -> Sequence[Graph]: + """ + return a list of graphs + """ + if g == "DEFAULT": + # type error: List item 0 has incompatible type "Optional[Graph]"; expected "Graph" + return [ctx.graph] # type: ignore[list-item] + elif g == "NAMED": + return [ + # type error: Item "None" of "Optional[Graph]" has no attribute "identifier" + c + for c in ctx.dataset.contexts() + if c.identifier != ctx.graph.identifier # type: ignore[union-attr] + ] + elif g == "ALL": + return list(ctx.dataset.contexts()) + else: + return [ctx.dataset.get_context(g)] + + +def evalLoad(ctx: QueryContext, u: CompValue) -> None: + """ + http://www.w3.org/TR/sparql11-update/#load + """ + + if TYPE_CHECKING: + assert isinstance(u.iri, URIRef) + + if u.graphiri: + ctx.load(u.iri, default=False, into=u.graphiri) + else: + ctx.load(u.iri, default=True) + + +def evalCreate(ctx: QueryContext, u: CompValue) -> None: + """ + http://www.w3.org/TR/sparql11-update/#create + """ + g = ctx.dataset.get_context(u.graphiri) + if len(g) > 0: + raise Exception("Graph %s already exists." % g.identifier) + raise Exception("Create not implemented!") + + +def evalClear(ctx: QueryContext, u: CompValue) -> None: + """ + http://www.w3.org/TR/sparql11-update/#clear + """ + for g in _graphAll(ctx, u.graphiri): + g.remove((None, None, None)) + + +def evalDrop(ctx: QueryContext, u: CompValue) -> None: + """ + http://www.w3.org/TR/sparql11-update/#drop + """ + if ctx.dataset.store.graph_aware: + for g in _graphAll(ctx, u.graphiri): + ctx.dataset.store.remove_graph(g) + else: + evalClear(ctx, u) + + +def evalInsertData(ctx: QueryContext, u: CompValue) -> None: + """ + http://www.w3.org/TR/sparql11-update/#insertData + """ + # add triples + g = ctx.graph + g += u.triples + # add quads + # u.quads is a dict of graphURI=>[triples] + for g in u.quads: + # type error: Argument 1 to "get_context" of "ConjunctiveGraph" has incompatible type "Optional[Graph]"; expected "Union[IdentifiedNode, str, None]" + cg = ctx.dataset.get_context(g) # type: ignore[arg-type] + cg += u.quads[g] + + +def evalDeleteData(ctx: QueryContext, u: CompValue) -> None: + """ + http://www.w3.org/TR/sparql11-update/#deleteData + """ + # remove triples + g = ctx.graph + g -= u.triples + + # remove quads + # u.quads is a dict of graphURI=>[triples] + for g in u.quads: + # type error: Argument 1 to "get_context" of "ConjunctiveGraph" has incompatible type "Optional[Graph]"; expected "Union[IdentifiedNode, str, None]" + cg = ctx.dataset.get_context(g) # type: ignore[arg-type] + cg -= u.quads[g] + + +def evalDeleteWhere(ctx: QueryContext, u: CompValue) -> None: + """ + http://www.w3.org/TR/sparql11-update/#deleteWhere + """ + + res: Iterator[FrozenDict] = evalBGP(ctx, u.triples) + for g in u.quads: + cg = ctx.dataset.get_context(g) + c = ctx.pushGraph(cg) + res = _join(res, list(evalBGP(c, u.quads[g]))) + + # type error: Incompatible types in assignment (expression has type "FrozenBindings", variable has type "QueryContext") + for c in res: # type: ignore[assignment] + g = ctx.graph + g -= _fillTemplate(u.triples, c) + + for g in u.quads: + cg = ctx.dataset.get_context(c.get(g)) + cg -= _fillTemplate(u.quads[g], c) + + +def evalModify(ctx: QueryContext, u: CompValue) -> None: + originalctx = ctx + + # Using replaces the dataset for evaluating the where-clause + dg: Optional[Graph] + if u.using: + otherDefault = False + for d in u.using: + if d.default: + if not otherDefault: + # replace current default graph + dg = Graph() + ctx = ctx.pushGraph(dg) + otherDefault = True + + ctx.load(d.default, default=True) + + elif d.named: + g = d.named + ctx.load(g, default=False) + + # "The WITH clause provides a convenience for when an operation + # primarily refers to a single graph. If a graph name is specified + # in a WITH clause, then - for the purposes of evaluating the + # WHERE clause - this will define an RDF Dataset containing a + # default graph with the specified name, but only in the absence + # of USING or USING NAMED clauses. In the presence of one or more + # graphs referred to in USING clauses and/or USING NAMED clauses, + # the WITH clause will be ignored while evaluating the WHERE + # clause." + if not u.using and u.withClause: + g = ctx.dataset.get_context(u.withClause) + ctx = ctx.pushGraph(g) + + res = evalPart(ctx, u.where) + + if u.using: + if otherDefault: + ctx = originalctx # restore original default graph + if u.withClause: + g = ctx.dataset.get_context(u.withClause) + ctx = ctx.pushGraph(g) + + for c in list(res): + # TODO: Make this more intentional and without the weird type checking logic + # once ConjunctiveGraph is removed and Dataset no longer inherits from + # Graph. + dg = ctx.graph if type(ctx.graph) is Graph else ctx.dataset.default_context + if u.delete: + # type error: Unsupported left operand type for - ("None") + # type error: Unsupported operand types for - ("Graph" and "Generator[Tuple[Identifier, Identifier, Identifier], None, None]") + dg -= _fillTemplate(u.delete.triples, c) # type: ignore[operator] + + for g, q in u.delete.quads.items(): + cg = ctx.dataset.get_context(c.get(g)) + cg -= _fillTemplate(q, c) + + if u.insert: + # type error: Unsupported left operand type for + ("None") + # type error: Unsupported operand types for + ("Graph" and "Generator[Tuple[Identifier, Identifier, Identifier], None, None]") + dg += _fillTemplate(u.insert.triples, c) # type: ignore[operator] + + for g, q in u.insert.quads.items(): + cg = ctx.dataset.get_context(c.get(g)) + cg += _fillTemplate(q, c) + + +def evalAdd(ctx: QueryContext, u: CompValue) -> None: + """ + + add all triples from src to dst + + http://www.w3.org/TR/sparql11-update/#add + """ + src, dst = u.graph + + srcg = _graphOrDefault(ctx, src) + dstg = _graphOrDefault(ctx, dst) + + # type error: Item "None" of "Optional[Graph]" has no attribute "identifier" + if srcg.identifier == dstg.identifier: # type: ignore[union-attr] + return + + # type error: Unsupported left operand type for + ("None") + dstg += srcg # type: ignore[operator] + + +def evalMove(ctx: QueryContext, u: CompValue) -> None: + """ + + remove all triples from dst + add all triples from src to dst + remove all triples from src + + http://www.w3.org/TR/sparql11-update/#move + """ + + src, dst = u.graph + + srcg = _graphOrDefault(ctx, src) + dstg = _graphOrDefault(ctx, dst) + + # type error: Item "None" of "Optional[Graph]" has no attribute "identifier" + if srcg.identifier == dstg.identifier: # type: ignore[union-attr] + return + + # type error: Item "None" of "Optional[Graph]" has no attribute "remove" + dstg.remove((None, None, None)) # type: ignore[union-attr] + + # type error: Unsupported left operand type for + ("None") + dstg += srcg # type: ignore[operator] + + if ctx.dataset.store.graph_aware: + # type error: Argument 1 to "remove_graph" of "Store" has incompatible type "Optional[Graph]"; expected "Graph" + ctx.dataset.store.remove_graph(srcg) # type: ignore[arg-type] + else: + # type error: Item "None" of "Optional[Graph]" has no attribute "remove" + srcg.remove((None, None, None)) # type: ignore[union-attr] + + +def evalCopy(ctx: QueryContext, u: CompValue) -> None: + """ + + remove all triples from dst + add all triples from src to dst + + http://www.w3.org/TR/sparql11-update/#copy + """ + + src, dst = u.graph + + srcg = _graphOrDefault(ctx, src) + dstg = _graphOrDefault(ctx, dst) + + # type error: Item "None" of "Optional[Graph]" has no attribute "remove" + if srcg.identifier == dstg.identifier: # type: ignore[union-attr] + return + + # type error: Item "None" of "Optional[Graph]" has no attribute "remove" + dstg.remove((None, None, None)) # type: ignore[union-attr] + + # type error: Unsupported left operand type for + ("None") + dstg += srcg # type: ignore[operator] + + +def evalUpdate( + graph: Graph, + update: Update, + initBindings: Optional[Mapping[str, Identifier]] = None, +) -> None: + """http://www.w3.org/TR/sparql11-update/#updateLanguage + + 'A request is a sequence of operations [...] Implementations MUST + ensure that operations of a single request are executed in a + fashion that guarantees the same effects as executing them in + lexical order. + + Operations all result either in success or failure. + + If multiple operations are present in a single request, then a + result of failure from any operation MUST abort the sequence of + operations, causing the subsequent operations to be ignored.' + + This will return None on success and raise Exceptions on error + + !!! warning "Security Considerations" + + This method can access indirectly requested network endpoints, for + example, query processing will attempt to access network endpoints + specified in `SERVICE` directives. + + When processing untrusted or potentially malicious queries, measures + should be taken to restrict network and file access. + + For information on available security measures, see the RDFLib + [Security Considerations](../security_considerations.md) + documentation. + + """ + + for u in update.algebra: + initBindings = dict((Variable(k), v) for k, v in (initBindings or {}).items()) + + ctx = QueryContext(graph, initBindings=initBindings) + ctx.prologue = u.prologue + + try: + if u.name == "Load": + evalLoad(ctx, u) + elif u.name == "Clear": + evalClear(ctx, u) + elif u.name == "Drop": + evalDrop(ctx, u) + elif u.name == "Create": + evalCreate(ctx, u) + elif u.name == "Add": + evalAdd(ctx, u) + elif u.name == "Move": + evalMove(ctx, u) + elif u.name == "Copy": + evalCopy(ctx, u) + elif u.name == "InsertData": + evalInsertData(ctx, u) + elif u.name == "DeleteData": + evalDeleteData(ctx, u) + elif u.name == "DeleteWhere": + evalDeleteWhere(ctx, u) + elif u.name == "Modify": + evalModify(ctx, u) + else: + raise Exception("Unknown update operation: %s" % (u,)) + except: # noqa: E722 + if not u.silent: + raise diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/__init__.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..85ae55c2b7ad1583f5450e67f5b9463d0c71ee6b --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/__init__.py @@ -0,0 +1,8 @@ +"""Module for builtin RDF stores. + +All builtin [RDF Stores][rdflib.store.Store] available +during [RDFLib Graphs creation][rdflib.graph.Graph] are listed here. + +Registration of builtin and external plugins +is described in [`rdflib.plugin`][rdflib.plugin]. +""" diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/__pycache__/__init__.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cf0706346a35bc9955a6a8cb76fbfd9abb030055 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/__pycache__/__init__.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/__pycache__/auditable.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/__pycache__/auditable.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3f21dd4ef09f585095cdcaf6bfbc796af6d91ce9 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/__pycache__/auditable.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/__pycache__/berkeleydb.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/__pycache__/berkeleydb.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a491af455955851ac5f65d91d24da0609b0ae285 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/__pycache__/berkeleydb.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/__pycache__/concurrent.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/__pycache__/concurrent.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3be480424074a0dc62b066fae4824c162bf8d13b Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/__pycache__/concurrent.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/__pycache__/memory.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/__pycache__/memory.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b8311ae697af62cb9892254cde979a645de76998 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/__pycache__/memory.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/__pycache__/rdf4j.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/__pycache__/rdf4j.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5f3fabbce9fc5da2162cb4a9c9616a769c047d07 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/__pycache__/rdf4j.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/__pycache__/regexmatching.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/__pycache__/regexmatching.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..95188281006e8f5b61dce766d5ec851ab6e2ad4f Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/__pycache__/regexmatching.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/__pycache__/sparqlconnector.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/__pycache__/sparqlconnector.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a2b2dd51a3bc6d7ef347f06aeb8e6f06a45b76c0 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/__pycache__/sparqlconnector.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/__pycache__/sparqlstore.cpython-312.pyc b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/__pycache__/sparqlstore.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c5340bbe9be8ab8824bfce4d4be937d290d295e1 Binary files /dev/null and b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/__pycache__/sparqlstore.cpython-312.pyc differ diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/auditable.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/auditable.py new file mode 100644 index 0000000000000000000000000000000000000000..05ca2f6489410e05a382d1a4ae310a838632c1dd --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/auditable.py @@ -0,0 +1,203 @@ +""" + +This wrapper intercepts calls through the store interface and implements +thread-safe logging of destructive operations (adds / removes) in reverse. +This is persisted on the store instance and the reverse operations are +executed In order to return the store to the state it was when the transaction +began Since the reverse operations are persisted on the store, the store +itself acts as a transaction. + +Calls to commit or rollback, flush the list of reverse operations This +provides thread-safe atomicity and isolation (assuming concurrent operations +occur with different store instances), but no durability (transactions are +persisted in memory and won't be available to reverse operations after the +system fails): A and I out of ACID. + +""" + +from __future__ import annotations + +import threading +from typing import TYPE_CHECKING, Any, Generator, Iterator, List, Optional, Tuple, Union + +from rdflib.graph import ConjunctiveGraph, Graph +from rdflib.store import Store + +if TYPE_CHECKING: + from rdflib.graph import ( + _ContextIdentifierType, + _ContextType, + _ObjectType, + _PredicateType, + _SubjectType, + _TriplePatternType, + _TripleType, + ) + from rdflib.query import Result + from rdflib.term import URIRef + + +destructiveOpLocks = { # noqa: N816 + "add": None, + "remove": None, +} + + +class AuditableStore(Store): + """A store that logs destructive operations (add/remove) in reverse order.""" + + def __init__(self, store: Store): + self.store = store + self.context_aware = store.context_aware + # NOTE: this store can't be formula_aware as it doesn't have enough + # info to reverse the removal of a quoted statement + self.formula_aware = False # store.formula_aware + self.transaction_aware = True # This is only half true + self.reverseOps: List[ + Tuple[ + Optional[_SubjectType], + Optional[_PredicateType], + Optional[_ObjectType], + Optional[_ContextIdentifierType], + str, + ] + ] = [] + self.rollbackLock = threading.RLock() + + def open( + self, configuration: Union[str, tuple[str, str]], create: bool = True + ) -> Optional[int]: + return self.store.open(configuration, create) + + def close(self, commit_pending_transaction: bool = False) -> None: + self.store.close() + + def destroy(self, configuration: str) -> None: + self.store.destroy(configuration) + + def query(self, *args: Any, **kw: Any) -> Result: + return self.store.query(*args, **kw) + + def add( + self, triple: _TripleType, context: _ContextType, quoted: bool = False + ) -> None: + (s, p, o) = triple + lock = destructiveOpLocks["add"] + lock = lock if lock else threading.RLock() + with lock: + context = ( + context.__class__(self.store, context.identifier) + if context is not None + else None + ) + ctxId = context.identifier if context is not None else None # noqa: N806 + if list(self.store.triples(triple, context)): + return # triple already in store, do nothing + self.reverseOps.append((s, p, o, ctxId, "remove")) + try: + self.reverseOps.remove((s, p, o, ctxId, "add")) + except ValueError: + pass + self.store.add((s, p, o), context, quoted) + + def remove( + self, spo: _TriplePatternType, context: Optional[_ContextType] = None + ) -> None: + subject, predicate, object_ = spo + lock = destructiveOpLocks["remove"] + lock = lock if lock else threading.RLock() + with lock: + # Need to determine which quads will be removed if any term is a + # wildcard + context = ( + context.__class__(self.store, context.identifier) + if context is not None + else None + ) + ctxId = context.identifier if context is not None else None # noqa: N806 + if None in [subject, predicate, object_, context]: + if ctxId: + # type error: Item "None" of "Optional[Graph]" has no attribute "triples" + for s, p, o in context.triples((subject, predicate, object_)): # type: ignore[union-attr] + try: + self.reverseOps.remove((s, p, o, ctxId, "remove")) + except ValueError: + self.reverseOps.append((s, p, o, ctxId, "add")) + else: + for s, p, o, ctx in ConjunctiveGraph(self.store).quads( + (subject, predicate, object_) + ): + try: + # type error: Item "None" of "Optional[Graph]" has no attribute "identifier" + self.reverseOps.remove((s, p, o, ctx.identifier, "remove")) # type: ignore[union-attr] + except ValueError: + # type error: Item "None" of "Optional[Graph]" has no attribute "identifier" + self.reverseOps.append((s, p, o, ctx.identifier, "add")) # type: ignore[union-attr] + else: + if not list(self.triples((subject, predicate, object_), context)): + return # triple not present in store, do nothing + try: + self.reverseOps.remove( + (subject, predicate, object_, ctxId, "remove") + ) + except ValueError: + self.reverseOps.append((subject, predicate, object_, ctxId, "add")) + self.store.remove((subject, predicate, object_), context) + + def triples( + self, triple: _TriplePatternType, context: Optional[_ContextType] = None + ) -> Iterator[Tuple[_TripleType, Iterator[Optional[_ContextType]]]]: + (su, pr, ob) = triple + context = ( + context.__class__(self.store, context.identifier) + if context is not None + else None + ) + for (s, p, o), cg in self.store.triples((su, pr, ob), context): + yield (s, p, o), cg + + def __len__(self, context: Optional[_ContextType] = None): + context = ( + context.__class__(self.store, context.identifier) + if context is not None + else None + ) + return self.store.__len__(context) + + def contexts( + self, triple: Optional[_TripleType] = None + ) -> Generator[_ContextType, None, None]: + for ctx in self.store.contexts(triple): + yield ctx + + def bind(self, prefix: str, namespace: URIRef, override: bool = True) -> None: + self.store.bind(prefix, namespace, override=override) + + def prefix(self, namespace: URIRef) -> Optional[str]: + return self.store.prefix(namespace) + + def namespace(self, prefix: str) -> Optional[URIRef]: + return self.store.namespace(prefix) + + def namespaces(self) -> Iterator[Tuple[str, URIRef]]: + return self.store.namespaces() + + def commit(self) -> None: + self.reverseOps = [] + + def rollback(self) -> None: + # Acquire Rollback lock and apply reverse operations in the forward + # order + with self.rollbackLock: + for subject, predicate, obj, context, op in self.reverseOps: + if op == "add": + # type error: Argument 2 to "Graph" has incompatible type "Optional[Node]"; expected "Union[IdentifiedNode, str, None]" + self.store.add( + (subject, predicate, obj), Graph(self.store, context) # type: ignore[arg-type] + ) + else: + self.store.remove( + (subject, predicate, obj), Graph(self.store, context) + ) + + self.reverseOps = [] diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/berkeleydb.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/berkeleydb.py new file mode 100644 index 0000000000000000000000000000000000000000..693dfd220aeea121d1e94f853aadafec3d047d34 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/berkeleydb.py @@ -0,0 +1,794 @@ +from __future__ import annotations + +import logging +from os import mkdir +from os.path import abspath, exists +from threading import Thread +from typing import ( + TYPE_CHECKING, + Any, + Callable, + Dict, + Generator, + List, + Optional, + Tuple, + Union, +) +from urllib.request import pathname2url + +from rdflib.store import NO_STORE, VALID_STORE, Store +from rdflib.term import Identifier, Node, URIRef + +if TYPE_CHECKING: + from rdflib.graph import Graph, _ContextType, _TriplePatternType, _TripleType + + +def bb(u: str) -> bytes: + return u.encode("utf-8") + + +try: + from berkeleydb import db + + has_bsddb = True +except ImportError: + has_bsddb = False + + +if has_bsddb: + # These are passed to bsddb when creating DBs + + # passed to db.DBEnv.set_flags + ENVSETFLAGS = db.DB_CDB_ALLDB + # passed to db.DBEnv.open + ENVFLAGS = db.DB_INIT_MPOOL | db.DB_INIT_CDB | db.DB_THREAD + CACHESIZE = 1024 * 1024 * 50 + + # passed to db.DB.Open() + DBOPENFLAGS = db.DB_THREAD + +logger = logging.getLogger(__name__) + +__all__ = [ + "BerkeleyDB", + "_ToKeyFunc", + "_FromKeyFunc", + "_GetPrefixFunc", + "_ResultsFromKeyFunc", +] + + +_ToKeyFunc = Callable[[Tuple[bytes, bytes, bytes], bytes], bytes] +_FromKeyFunc = Callable[[bytes], Tuple[bytes, bytes, bytes, bytes]] +_GetPrefixFunc = Callable[ + [Tuple[str, str, str], Optional[str]], Generator[str, None, None] +] +_ResultsFromKeyFunc = Callable[ + [bytes, Optional[Node], Optional[Node], Optional[Node], bytes], + Tuple[Tuple[Node, Node, Node], Generator[Node, None, None]], +] + + +class BerkeleyDB(Store): + """A store that allows for on-disk persistent using BerkeleyDB, a fast key/value DB. + + This store implementation used to be known, previous to rdflib 6.0.0 + as 'Sleepycat' due to that being the then name of the Python wrapper + for BerkeleyDB. + + This store allows for quads as well as triples. See examples of use + in both the `examples.berkeleydb_example` and `test/test_store/test_store_berkeleydb.py` + files. + + **NOTE on installation**: + + To use this store, you must have BerkeleyDB installed on your system + separately to Python (`brew install berkeley-db` on a Mac) and also have + the BerkeleyDB Python wrapper installed (`pip install berkeleydb`). + You may need to install BerkeleyDB Python wrapper like this: + `YES_I_HAVE_THE_RIGHT_TO_USE_THIS_BERKELEY_DB_VERSION=1 pip install berkeleydb` + """ + + context_aware = True + formula_aware = True + transaction_aware = False + graph_aware = True + db_env: db.DBEnv = None + + def __init__( + self, + configuration: Optional[str] = None, + identifier: Optional[Identifier] = None, + ): + if not has_bsddb: + raise ImportError("Unable to import berkeleydb, store is unusable.") + self.__open = False + self.__identifier = identifier + super(BerkeleyDB, self).__init__(configuration) + self._loads = self.node_pickler.loads + self._dumps = self.node_pickler.dumps + self.__indicies_info: List[Tuple[Any, _ToKeyFunc, _FromKeyFunc]] + + def __get_identifier(self) -> Optional[Identifier]: + return self.__identifier + + identifier = property(__get_identifier) + + def _init_db_environment( + self, homeDir: str, create: bool = True # noqa: N803 + ) -> db.DBEnv: + if not exists(homeDir): + if create is True: + mkdir(homeDir) + # TODO: implement create method and refactor this to it + self.create(homeDir) + else: + return NO_STORE + db_env = db.DBEnv() + db_env.set_cachesize(0, CACHESIZE) # TODO + # db_env.set_lg_max(1024*1024) + db_env.set_flags(ENVSETFLAGS, 1) + db_env.open(homeDir, ENVFLAGS | db.DB_CREATE) + return db_env + + def is_open(self) -> bool: + return self.__open + + def open( + self, configuration: Union[str, tuple[str, str]], create: bool = True + ) -> Optional[int]: + if not has_bsddb: + return NO_STORE + + if type(configuration) is str: + homeDir = configuration # noqa: N806 + else: + raise Exception("Invalid configuration provided") + + if self.__identifier is None: + self.__identifier = URIRef(pathname2url(abspath(homeDir))) + + db_env = self._init_db_environment(homeDir, create) + if db_env == NO_STORE: + return NO_STORE + self.db_env = db_env + self.__open = True + + dbname = None + dbtype = db.DB_BTREE + # auto-commit ensures that the open-call commits when transactions + # are enabled + + dbopenflags = DBOPENFLAGS + if self.transaction_aware is True: + dbopenflags |= db.DB_AUTO_COMMIT + + if create: + dbopenflags |= db.DB_CREATE + + dbmode = 0o660 + dbsetflags = 0 + + # create and open the DBs + self.__indicies: List[db.DB] = [ + None, + ] * 3 + # NOTE on type ingore: this is because type checker does not like this + # way of initializing, using a temporary variable will solve it. + # type error: error: List item 0 has incompatible type "None"; expected "Tuple[Any, Callable[[Tuple[bytes, bytes, bytes], bytes], bytes], Callable[[bytes], Tuple[bytes, bytes, bytes, bytes]]]" + self.__indicies_info = [ + None, # type: ignore[list-item] + ] * 3 + for i in range(0, 3): + index_name = to_key_func(i)( + ("s".encode("latin-1"), "p".encode("latin-1"), "o".encode("latin-1")), + "c".encode("latin-1"), + ).decode() + index = db.DB(db_env) + index.set_flags(dbsetflags) + index.open(index_name, dbname, dbtype, dbopenflags, dbmode) + self.__indicies[i] = index + self.__indicies_info[i] = (index, to_key_func(i), from_key_func(i)) + + lookup: Dict[ + int, Tuple[db.DB, _GetPrefixFunc, _FromKeyFunc, _ResultsFromKeyFunc] + ] = {} + for i in range(0, 8): + results: List[Tuple[Tuple[int, int], int, int]] = [] + for start in range(0, 3): + score = 1 + len = 0 + for j in range(start, start + 3): + if i & (1 << (j % 3)): + score = score << 1 + len += 1 + else: + break + tie_break = 2 - start + results.append(((score, tie_break), start, len)) + + results.sort() + # NOTE on type error: this is because the variable `score` is + # reused with different type + # type error: Incompatible types in assignment (expression has type "Tuple[int, int]", variable has type "int") + score, start, len = results[-1] # type: ignore[assignment] + + def get_prefix_func(start: int, end: int) -> _GetPrefixFunc: + def get_prefix( + triple: Tuple[str, str, str], context: Optional[str] + ) -> Generator[str, None, None]: + if context is None: + yield "" + else: + yield context + i = start + while i < end: + yield triple[i % 3] + i += 1 + yield "" + + return get_prefix + + lookup[i] = ( + self.__indicies[start], + get_prefix_func(start, start + len), + from_key_func(start), + results_from_key_func(start, self._from_string), + ) + + self.__lookup_dict = lookup + + self.__contexts = db.DB(db_env) + self.__contexts.set_flags(dbsetflags) + self.__contexts.open("contexts", dbname, dbtype, dbopenflags, dbmode) + + self.__namespace = db.DB(db_env) + self.__namespace.set_flags(dbsetflags) + self.__namespace.open("namespace", dbname, dbtype, dbopenflags, dbmode) + + self.__prefix = db.DB(db_env) + self.__prefix.set_flags(dbsetflags) + self.__prefix.open("prefix", dbname, dbtype, dbopenflags, dbmode) + + self.__k2i = db.DB(db_env) + self.__k2i.set_flags(dbsetflags) + self.__k2i.open("k2i", dbname, db.DB_HASH, dbopenflags, dbmode) + + self.__i2k = db.DB(db_env) + self.__i2k.set_flags(dbsetflags) + self.__i2k.open("i2k", dbname, db.DB_RECNO, dbopenflags, dbmode) + + self.__needs_sync = False + t = Thread(target=self.__sync_run) + t.setDaemon(True) + t.start() + self.__sync_thread = t + return VALID_STORE + + def __sync_run(self) -> None: + from time import sleep, time + + try: + min_seconds, max_seconds = 10, 300 + while self.__open: + if self.__needs_sync: + t0 = t1 = time() + self.__needs_sync = False + while self.__open: + sleep(0.1) + if self.__needs_sync: + t1 = time() + self.__needs_sync = False + if time() - t1 > min_seconds or time() - t0 > max_seconds: + self.__needs_sync = False + logger.debug("sync") + self.sync() + break + else: + sleep(1) + except Exception as e: + logger.exception(e) + + def sync(self) -> None: + if self.__open: + for i in self.__indicies: + i.sync() + self.__contexts.sync() + self.__namespace.sync() + self.__prefix.sync() + self.__i2k.sync() + self.__k2i.sync() + + def close(self, commit_pending_transaction: bool = False) -> None: + self.__open = False + self.__sync_thread.join() + for i in self.__indicies: + i.close() + self.__contexts.close() + self.__namespace.close() + self.__prefix.close() + self.__i2k.close() + self.__k2i.close() + self.db_env.close() + + def add( + self, + triple: _TripleType, + context: _ContextType, + quoted: bool = False, + txn: Optional[Any] = None, + ) -> None: + """\ + Add a triple to the store of triples. + """ + (subject, predicate, object) = triple + assert self.__open, "The Store must be open." + assert context != self, "Can not add triple directly to store" + Store.add(self, (subject, predicate, object), context, quoted) + + _to_string = self._to_string + + s = _to_string(subject, txn=txn) + p = _to_string(predicate, txn=txn) + o = _to_string(object, txn=txn) + c = _to_string(context, txn=txn) + + cspo, cpos, cosp = self.__indicies + + value = cspo.get(bb("%s^%s^%s^%s^" % (c, s, p, o)), txn=txn) + if value is None: + self.__contexts.put(bb(c), b"", txn=txn) + + contexts_value = cspo.get( + bb("%s^%s^%s^%s^" % ("", s, p, o)), txn=txn + ) or "".encode("latin-1") + contexts = set(contexts_value.split("^".encode("latin-1"))) + contexts.add(bb(c)) + contexts_value = "^".encode("latin-1").join(contexts) + assert contexts_value is not None + + cspo.put(bb("%s^%s^%s^%s^" % (c, s, p, o)), b"", txn=txn) + cpos.put(bb("%s^%s^%s^%s^" % (c, p, o, s)), b"", txn=txn) + cosp.put(bb("%s^%s^%s^%s^" % (c, o, s, p)), b"", txn=txn) + if not quoted: + cspo.put(bb("%s^%s^%s^%s^" % ("", s, p, o)), contexts_value, txn=txn) + cpos.put(bb("%s^%s^%s^%s^" % ("", p, o, s)), contexts_value, txn=txn) + cosp.put(bb("%s^%s^%s^%s^" % ("", o, s, p)), contexts_value, txn=txn) + + self.__needs_sync = True + + def __remove( + self, + spo: Tuple[bytes, bytes, bytes], + c: bytes, + quoted: bool = False, + txn: Optional[Any] = None, + ) -> None: + s, p, o = spo + cspo, cpos, cosp = self.__indicies + contexts_value = cspo.get( + "^".encode("latin-1").join( + ["".encode("latin-1"), s, p, o, "".encode("latin-1")] + ), + txn=txn, + ) or "".encode("latin-1") + contexts = set(contexts_value.split("^".encode("latin-1"))) + contexts.discard(c) + contexts_value = "^".encode("latin-1").join(contexts) + for i, _to_key, _from_key in self.__indicies_info: + i.delete(_to_key((s, p, o), c), txn=txn) + if not quoted: + if contexts_value: + for i, _to_key, _from_key in self.__indicies_info: + i.put( + _to_key((s, p, o), "".encode("latin-1")), + contexts_value, + txn=txn, + ) + else: + for i, _to_key, _from_key in self.__indicies_info: + try: + i.delete(_to_key((s, p, o), "".encode("latin-1")), txn=txn) + except db.DBNotFoundError: + pass # TODO: is it okay to ignore these? + + # type error: Signature of "remove" incompatible with supertype "Store" + def remove( # type: ignore[override] + self, + spo: _TriplePatternType, + context: Optional[_ContextType], + txn: Optional[Any] = None, + ) -> None: + subject, predicate, object = spo + assert self.__open, "The Store must be open." + Store.remove(self, (subject, predicate, object), context) + _to_string = self._to_string + + if context is not None: + if context == self: + context = None + + if ( + subject is not None + and predicate is not None + and object is not None + and context is not None + ): + s = _to_string(subject, txn=txn) + p = _to_string(predicate, txn=txn) + o = _to_string(object, txn=txn) + c = _to_string(context, txn=txn) + value = self.__indicies[0].get(bb("%s^%s^%s^%s^" % (c, s, p, o)), txn=txn) + if value is not None: + self.__remove((bb(s), bb(p), bb(o)), bb(c), txn=txn) + self.__needs_sync = True + else: + cspo, cpos, cosp = self.__indicies + index, prefix, from_key, results_from_key = self.__lookup( + (subject, predicate, object), context, txn=txn + ) + + cursor = index.cursor(txn=txn) + try: + current = cursor.set_range(prefix) + needs_sync = True + except db.DBNotFoundError: + current = None + needs_sync = False + cursor.close() + while current: + key, value = current + cursor = index.cursor(txn=txn) + try: + cursor.set_range(key) + # Hack to stop 2to3 converting this to next(cursor) + current = getattr(cursor, "next")() + except db.DBNotFoundError: + current = None + cursor.close() + if key.startswith(prefix): + # NOTE on type error: variables are being reused with a + # different type + # type error: Incompatible types in assignment (expression has type "bytes", variable has type "str") + c, s, p, o = from_key(key) # type: ignore[assignment] + if context is None: + contexts_value = index.get(key, txn=txn) or "".encode("latin-1") + # remove triple from all non quoted contexts + contexts = set(contexts_value.split("^".encode("latin-1"))) + # and from the conjunctive index + contexts.add("".encode("latin-1")) + for c in contexts: + for i, _to_key, _ in self.__indicies_info: + # NOTE on type error: variables are being + # reused with a different type + # type error: Argument 1 has incompatible type "Tuple[str, str, str]"; expected "Tuple[bytes, bytes, bytes]" + # type error: Argument 2 has incompatible type "str"; expected "bytes" + i.delete(_to_key((s, p, o), c), txn=txn) # type: ignore[arg-type] + else: + # type error: Argument 1 to "__remove" of "BerkeleyDB" has incompatible type "Tuple[str, str, str]"; expected "Tuple[bytes, bytes, bytes]" + # type error: Argument 2 to "__remove" of "BerkeleyDB" has incompatible type "str"; expected "bytes" + self.__remove((s, p, o), c, txn=txn) # type: ignore[arg-type] + else: + break + + if context is not None: + if subject is None and predicate is None and object is None: + # TODO: also if context becomes empty and not just on + # remove((None, None, None), c) + try: + self.__contexts.delete( + bb(_to_string(context, txn=txn)), txn=txn + ) + except db.DBNotFoundError: + pass + + self.__needs_sync = needs_sync + + def triples( + self, + spo: _TriplePatternType, + context: Optional[_ContextType] = None, + txn: Optional[Any] = None, + ) -> Generator[ + Tuple[_TripleType, Generator[Optional[_ContextType], None, None]], + None, + None, + ]: + """A generator over all the triples matching""" + assert self.__open, "The Store must be open." + + subject, predicate, object = spo + + if context is not None: + if context == self: + context = None + + # _from_string = self._from_string ## UNUSED + index, prefix, from_key, results_from_key = self.__lookup( + (subject, predicate, object), context, txn=txn + ) + + cursor = index.cursor(txn=txn) + try: + current = cursor.set_range(prefix) + except db.DBNotFoundError: + current = None + cursor.close() + while current: + key, value = current + cursor = index.cursor(txn=txn) + try: + cursor.set_range(key) + # Cheap hack so 2to3 doesn't convert to next(cursor) + current = getattr(cursor, "next")() + except db.DBNotFoundError: + current = None + cursor.close() + if key and key.startswith(prefix): + contexts_value = index.get(key, txn=txn) + # type error: Incompatible types in "yield" (actual type "Tuple[Tuple[Node, Node, Node], Generator[Node, None, None]]", expected type "Tuple[Tuple[IdentifiedNode, URIRef, Identifier], Iterator[Optional[Graph]]]") + # NOTE on type ignore: this is needed because some context is + # lost in the process of extracting triples from the database. + yield results_from_key(key, subject, predicate, object, contexts_value) # type: ignore[misc] + else: + break + + def __len__(self, context: Optional[_ContextType] = None) -> int: + assert self.__open, "The Store must be open." + if context is not None: + if context == self: + context = None + + if context is None: + prefix = "^".encode("latin-1") + else: + prefix = bb("%s^" % self._to_string(context)) + + index = self.__indicies[0] + cursor = index.cursor() + current = cursor.set_range(prefix) + count = 0 + while current: + key, value = current + if key.startswith(prefix): + count += 1 + # Hack to stop 2to3 converting this to next(cursor) + current = getattr(cursor, "next")() + else: + break + cursor.close() + return count + + def bind(self, prefix: str, namespace: URIRef, override: bool = True) -> None: + # NOTE on type error: this is because the variables are reused with + # another type. + # type error: Incompatible types in assignment (expression has type "bytes", variable has type "str") + prefix = prefix.encode("utf-8") # type: ignore[assignment] + # type error: Incompatible types in assignment (expression has type "bytes", variable has type "URIRef") + namespace = namespace.encode("utf-8") # type: ignore[assignment] + bound_prefix = self.__prefix.get(namespace) + bound_namespace = self.__namespace.get(prefix) + if override: + if bound_prefix: + self.__namespace.delete(bound_prefix) + if bound_namespace: + self.__prefix.delete(bound_namespace) + self.__prefix[namespace] = prefix + self.__namespace[prefix] = namespace + else: + self.__prefix[bound_namespace or namespace] = bound_prefix or prefix + self.__namespace[bound_prefix or prefix] = bound_namespace or namespace + + def namespace(self, prefix: str) -> Optional[URIRef]: + # NOTE on type error: this is because the variable is reused with + # another type. + # type error: Incompatible types in assignment (expression has type "bytes", variable has type "str") + prefix = prefix.encode("utf-8") # type: ignore[assignment] + ns = self.__namespace.get(prefix, None) + if ns is not None: + return URIRef(ns.decode("utf-8")) + return None + + def prefix(self, namespace: URIRef) -> Optional[str]: + # NOTE on type error: this is because the variable is reused with + # another type. + # type error: Incompatible types in assignment (expression has type "bytes", variable has type "URIRef") + namespace = namespace.encode("utf-8") # type: ignore[assignment] + prefix = self.__prefix.get(namespace, None) + if prefix is not None: + return prefix.decode("utf-8") + return None + + def namespaces(self) -> Generator[Tuple[str, URIRef], None, None]: + cursor = self.__namespace.cursor() + results = [] + current = cursor.first() + while current: + prefix, namespace = current + results.append((prefix.decode("utf-8"), namespace.decode("utf-8"))) + # Hack to stop 2to3 converting this to next(cursor) + current = getattr(cursor, "next")() + cursor.close() + for prefix, namespace in results: + yield prefix, URIRef(namespace) + + def contexts( + self, triple: Optional[_TripleType] = None + ) -> Generator[_ContextType, None, None]: + _from_string = self._from_string + _to_string = self._to_string + # NOTE on type errors: context is lost because of how data is loaded + # from the DB. + if triple: + s: str + p: str + o: str + # type error: Incompatible types in assignment (expression has type "Node", variable has type "str") + s, p, o = triple # type: ignore[assignment] + # type error: Argument 1 has incompatible type "str"; expected "Node" + s = _to_string(s) # type: ignore[arg-type] + # type error: Argument 1 has incompatible type "str"; expected "Node" + p = _to_string(p) # type: ignore[arg-type] + # type error: Argument 1 has incompatible type "str"; expected "Node" + o = _to_string(o) # type: ignore[arg-type] + contexts = self.__indicies[0].get(bb("%s^%s^%s^%s^" % ("", s, p, o))) + if contexts: + for c in contexts.split("^".encode("latin-1")): + if c: + # type error: Incompatible types in "yield" (actual type "Node", expected type "Graph") + yield _from_string(c) # type: ignore[misc] + else: + index = self.__contexts + cursor = index.cursor() + current = cursor.first() + cursor.close() + while current: + key, value = current + context = _from_string(key) + # type error: Incompatible types in "yield" (actual type "Node", expected type "Graph") + yield context # type: ignore[misc] + cursor = index.cursor() + try: + cursor.set_range(key) + # Hack to stop 2to3 converting this to next(cursor) + current = getattr(cursor, "next")() + except db.DBNotFoundError: + current = None + cursor.close() + + def add_graph(self, graph: Graph) -> None: + self.__contexts.put(bb(self._to_string(graph)), b"") + + def remove_graph(self, graph: Graph): + self.remove((None, None, None), graph) + + def _from_string(self, i: bytes) -> Node: + k = self.__i2k.get(int(i)) + return self._loads(k) + + def _to_string(self, term: Node, txn: Optional[Any] = None) -> str: + k = self._dumps(term) + i = self.__k2i.get(k, txn=txn) + if i is None: + # weird behaviour from bsddb not taking a txn as a keyword argument + # for append + if self.transaction_aware: + i = "%s" % self.__i2k.append(k, txn) + else: + i = "%s" % self.__i2k.append(k) + + self.__k2i.put(k, i.encode(), txn=txn) + else: + i = i.decode() + return i + + def __lookup( + self, + spo: _TriplePatternType, + context: Optional[_ContextType], + txn: Optional[Any] = None, + ) -> Tuple[db.DB, bytes, _FromKeyFunc, _ResultsFromKeyFunc]: + subject, predicate, object = spo + _to_string = self._to_string + # NOTE on type errors: this is because the same variable is used with different types. + if context is not None: + # type error: Incompatible types in assignment (expression has type "str", variable has type "Optional[Graph]") + context = _to_string(context, txn=txn) # type: ignore[assignment] + i = 0 + if subject is not None: + i += 1 + # type error: Incompatible types in assignment (expression has type "str", variable has type "Node") + subject = _to_string(subject, txn=txn) # type: ignore[assignment] + if predicate is not None: + i += 2 + # type error: Incompatible types in assignment (expression has type "str", variable has type "Node") + predicate = _to_string(predicate, txn=txn) # type: ignore[assignment] + if object is not None: + i += 4 + # type error: Incompatible types in assignment (expression has type "str", variable has type "Node") + object = _to_string(object, txn=txn) # type: ignore[assignment] + index, prefix_func, from_key, results_from_key = self.__lookup_dict[i] + # print (subject, predicate, object), context, prefix_func, index + # #DEBUG + # type error: Argument 1 has incompatible type "Tuple[Node, Node, Node]"; expected "Tuple[str, str, str]" + # type error: Argument 2 has incompatible type "Optional[Graph]"; expected "Optional[str]" + prefix = bb("^".join(prefix_func((subject, predicate, object), context))) # type: ignore[arg-type] + return index, prefix, from_key, results_from_key + + +def to_key_func(i: int) -> _ToKeyFunc: + def to_key(triple: Tuple[bytes, bytes, bytes], context: bytes) -> bytes: + "Takes a string; returns key" + return "^".encode("latin-1").join( + ( + context, + triple[i % 3], + triple[(i + 1) % 3], + triple[(i + 2) % 3], + "".encode("latin-1"), + ) + ) # "" to tac on the trailing ^ + + return to_key + + +def from_key_func(i: int) -> _FromKeyFunc: + def from_key(key: bytes) -> Tuple[bytes, bytes, bytes, bytes]: + "Takes a key; returns string" + parts = key.split("^".encode("latin-1")) + return ( + parts[0], + parts[(3 - i + 0) % 3 + 1], + parts[(3 - i + 1) % 3 + 1], + parts[(3 - i + 2) % 3 + 1], + ) + + return from_key + + +def results_from_key_func( + i: int, from_string: Callable[[bytes], Node] +) -> _ResultsFromKeyFunc: + def from_key( + key: bytes, + subject: Optional[Node], + predicate: Optional[Node], + object: Optional[Node], + contexts_value: bytes, + ) -> Tuple[Tuple[Node, Node, Node], Generator[Node, None, None]]: + "Takes a key and subject, predicate, object; returns tuple for yield" + parts = key.split("^".encode("latin-1")) + if subject is None: + # TODO: i & 1: # dis assemble and/or measure to see which is faster + # subject is None or i & 1 + s = from_string(parts[(3 - i + 0) % 3 + 1]) + else: + s = subject + if predicate is None: # i & 2: + p = from_string(parts[(3 - i + 1) % 3 + 1]) + else: + p = predicate + if object is None: # i & 4: + o = from_string(parts[(3 - i + 2) % 3 + 1]) + else: + o = object + return ( + (s, p, o), + (from_string(c) for c in contexts_value.split("^".encode("latin-1")) if c), + ) + + return from_key + + +# TODO: Remove unused +def readable_index(i: int) -> str: + # type error: Unpacking a string is disallowed + s, p, o = "?" * 3 # type: ignore[misc] + if i & 1: + s = "s" + if i & 2: + p = "p" + if i & 4: + o = "o" + return "%s,%s,%s" % (s, p, o) diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/concurrent.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/concurrent.py new file mode 100644 index 0000000000000000000000000000000000000000..4203dd1ac7bbd34de165c148f47808a5de226c2e --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/concurrent.py @@ -0,0 +1,97 @@ +from threading import Lock + + +class ResponsibleGenerator: + """A generator that will help clean up when it is done being used.""" + + __slots__ = ["cleanup", "gen"] + + def __init__(self, gen, cleanup): + self.cleanup = cleanup + self.gen = gen + + def __del__(self): + self.cleanup() + + def __iter__(self): + return self + + def __next__(self): + return next(self.gen) + + +class ConcurrentStore: + """A store that allows concurrent reads and writes.""" + + def __init__(self, store): + self.store = store + + # number of calls to visit still in progress + self.__visit_count = 0 + + # lock for locking down the indices + self.__lock = Lock() + + # lists for keeping track of added and removed triples while + # we wait for the lock + self.__pending_removes = [] + self.__pending_adds = [] + + def add(self, triple): + (s, p, o) = triple + if self.__visit_count == 0: + self.store.add((s, p, o)) + else: + self.__pending_adds.append((s, p, o)) + + def remove(self, triple): + (s, p, o) = triple + if self.__visit_count == 0: + self.store.remove((s, p, o)) + else: + self.__pending_removes.append((s, p, o)) + + def triples(self, triple): + (su, pr, ob) = triple + g = self.store.triples((su, pr, ob)) + pending_removes = self.__pending_removes + self.__begin_read() + for s, p, o in ResponsibleGenerator(g, self.__end_read): + if not (s, p, o) in pending_removes: # noqa: E713 + yield s, p, o + + for s, p, o in self.__pending_adds: + if ( + (su is None or su == s) + and (pr is None or pr == p) + and (ob is None or ob == o) + ): + yield s, p, o + + def __len__(self): + return self.store.__len__() + + def __begin_read(self): + lock = self.__lock + lock.acquire() + self.__visit_count = self.__visit_count + 1 + lock.release() + + def __end_read(self): + lock = self.__lock + lock.acquire() + self.__visit_count = self.__visit_count - 1 + if self.__visit_count == 0: + pending_removes = self.__pending_removes + while pending_removes: + (s, p, o) = pending_removes.pop() + try: + self.store.remove((s, p, o)) + except: # noqa: E722 + # TODO: change to try finally? + print(s, p, o, "Not in store to remove") + pending_adds = self.__pending_adds + while pending_adds: + (s, p, o) = pending_adds.pop() + self.store.add((s, p, o)) + lock.release() diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/memory.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/memory.py new file mode 100644 index 0000000000000000000000000000000000000000..a474c5caf2f9f590f822608873473de4501606ed --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/memory.py @@ -0,0 +1,731 @@ +# +# +from __future__ import annotations + +from typing import ( + TYPE_CHECKING, + Any, + Collection, + Dict, + Generator, + Iterator, + Mapping, + Optional, + Set, + Tuple, + Union, + overload, +) + +from rdflib.store import Store +from rdflib.util import _coalesce + +if TYPE_CHECKING: + from rdflib.graph import ( + Graph, + _ContextType, + _ObjectType, + _PredicateType, + _SubjectType, + _TriplePatternType, + _TripleType, + ) + from rdflib.plugins.sparql.sparql import Query, Update + from rdflib.query import Result + from rdflib.term import Identifier, URIRef + +__all__ = ["SimpleMemory", "Memory"] + +ANY: None = None + + +class SimpleMemory(Store): + """A fast naive in memory implementation of a triple store. + + This triple store uses nested dictionaries to store triples. Each + triple is stored in two such indices as follows `spo[s][p][o]` = 1 and + `pos[p][o][s]` = 1. + + Authors: Michel Pelletier, Daniel Krech, Stefan Niederhauser + """ + + def __init__( + self, + configuration: Optional[str] = None, + identifier: Optional[Identifier] = None, + ): + super(SimpleMemory, self).__init__(configuration) + self.identifier = identifier + + # indexed by [subject][predicate][object] + self.__spo: Dict[_SubjectType, Dict[_PredicateType, Dict[_ObjectType, int]]] = ( + {} + ) + + # indexed by [predicate][object][subject] + self.__pos: Dict[_PredicateType, Dict[_ObjectType, Dict[_SubjectType, int]]] = ( + {} + ) + + # indexed by [predicate][object][subject] + self.__osp: Dict[_ObjectType, Dict[_SubjectType, Dict[_PredicateType, int]]] = ( + {} + ) + + self.__namespace: Dict[str, URIRef] = {} + self.__prefix: Dict[URIRef, str] = {} + + def add( + self, + triple: _TripleType, + context: _ContextType, + quoted: bool = False, + ) -> None: + """Add a triple to the store of triples.""" + # add dictionary entries for spo[s][p][p] = 1 and pos[p][o][s] + # = 1, creating the nested dictionaries where they do not yet + # exits. + subject, predicate, object = triple + spo = self.__spo + try: + po = spo[subject] + except: # noqa: E722 + po = spo[subject] = {} + try: + o = po[predicate] + except: # noqa: E722 + o = po[predicate] = {} + o[object] = 1 + + pos = self.__pos + try: + os = pos[predicate] + except: # noqa: E722 + os = pos[predicate] = {} + try: + s = os[object] + except: # noqa: E722 + s = os[object] = {} + s[subject] = 1 + + osp = self.__osp + try: + sp = osp[object] + except: # noqa: E722 + sp = osp[object] = {} + try: + p = sp[subject] + except: # noqa: E722 + p = sp[subject] = {} + p[predicate] = 1 + + def remove( + self, + triple_pattern: _TriplePatternType, + context: Optional[_ContextType] = None, + ) -> None: + for (subject, predicate, object), c in list(self.triples(triple_pattern)): + del self.__spo[subject][predicate][object] + del self.__pos[predicate][object][subject] + del self.__osp[object][subject][predicate] + + def triples( + self, + triple_pattern: _TriplePatternType, + context: Optional[_ContextType] = None, + ) -> Iterator[Tuple[_TripleType, Iterator[Optional[_ContextType]]]]: + """A generator over all the triples matching""" + subject, predicate, object = triple_pattern + if subject != ANY: # subject is given + spo = self.__spo + if subject in spo: + subjectDictionary = spo[subject] # noqa: N806 + if predicate != ANY: # subject+predicate is given + if predicate in subjectDictionary: + if object != ANY: # subject+predicate+object is given + if object in subjectDictionary[predicate]: + yield (subject, predicate, object), self.__contexts() + else: # given object not found + pass + else: # subject+predicate is given, object unbound + for o in subjectDictionary[predicate].keys(): + yield (subject, predicate, o), self.__contexts() + else: # given predicate not found + pass + else: # subject given, predicate unbound + for p in subjectDictionary.keys(): + if object != ANY: # object is given + if object in subjectDictionary[p]: + yield (subject, p, object), self.__contexts() + else: # given object not found + pass + else: # object unbound + for o in subjectDictionary[p].keys(): + yield (subject, p, o), self.__contexts() + else: # given subject not found + pass + elif predicate != ANY: # predicate is given, subject unbound + pos = self.__pos + if predicate in pos: + predicateDictionary = pos[predicate] # noqa: N806 + if object != ANY: # predicate+object is given, subject unbound + if object in predicateDictionary: + for s in predicateDictionary[object].keys(): + yield (s, predicate, object), self.__contexts() + else: # given object not found + pass + else: # predicate is given, object+subject unbound + for o in predicateDictionary.keys(): + for s in predicateDictionary[o].keys(): + yield (s, predicate, o), self.__contexts() + elif object != ANY: # object is given, subject+predicate unbound + osp = self.__osp + if object in osp: + objectDictionary = osp[object] # noqa: N806 + for s in objectDictionary.keys(): + for p in objectDictionary[s].keys(): + yield (s, p, object), self.__contexts() + else: # subject+predicate+object unbound + spo = self.__spo + for s in spo.keys(): + subjectDictionary = spo[s] # noqa: N806 + for p in subjectDictionary.keys(): + for o in subjectDictionary[p].keys(): + yield (s, p, o), self.__contexts() + + def __len__(self, context: Optional[_ContextType] = None) -> int: + # @@ optimize + i = 0 + for triple in self.triples((None, None, None)): + i += 1 + return i + + def bind(self, prefix: str, namespace: URIRef, override: bool = True) -> None: + # should be identical to `Memory.bind` + bound_namespace = self.__namespace.get(prefix) + bound_prefix = _coalesce( + self.__prefix.get(namespace), + # type error: error: Argument 1 to "get" of "Mapping" has incompatible type "Optional[URIRef]"; expected "URIRef" + self.__prefix.get(bound_namespace), # type: ignore[arg-type] + ) + if override: + if bound_prefix is not None: + del self.__namespace[bound_prefix] + if bound_namespace is not None: + del self.__prefix[bound_namespace] + self.__prefix[namespace] = prefix + self.__namespace[prefix] = namespace + else: + # type error: Invalid index type "Optional[URIRef]" for "Dict[URIRef, str]"; expected type "URIRef" + self.__prefix[_coalesce(bound_namespace, namespace)] = _coalesce( # type: ignore[index] + bound_prefix, default=prefix + ) + # type error: Invalid index type "Optional[str]" for "Dict[str, URIRef]"; expected type "str" + self.__namespace[_coalesce(bound_prefix, prefix)] = _coalesce( # type: ignore[index] + bound_namespace, default=namespace + ) + + def namespace(self, prefix: str) -> Optional[URIRef]: + return self.__namespace.get(prefix, None) + + def prefix(self, namespace: URIRef) -> Optional[str]: + return self.__prefix.get(namespace, None) + + def namespaces(self) -> Iterator[Tuple[str, URIRef]]: + for prefix, namespace in self.__namespace.items(): + yield prefix, namespace + + def __contexts(self) -> Generator[_ContextType, None, None]: + # TODO: best way to return empty generator + # type error: Need type annotation for "c" + return (c for c in []) # type: ignore[var-annotated] + + # type error: Missing return statement + def query( # type: ignore[return] + self, + query: Union[Query, str], + initNs: Mapping[str, Any], # noqa: N803 + initBindings: Mapping[str, Identifier], # noqa: N803 + queryGraph: str, # noqa: N803 + **kwargs: Any, + ) -> Result: + super(SimpleMemory, self).query( + query, initNs, initBindings, queryGraph, **kwargs + ) + + def update( + self, + update: Union[Update, str], + initNs: Mapping[str, Any], # noqa: N803 + initBindings: Mapping[str, Identifier], # noqa: N803 + queryGraph: str, # noqa: N803 + **kwargs: Any, + ) -> None: + super(SimpleMemory, self).update( + update, initNs, initBindings, queryGraph, **kwargs + ) + + +class Memory(Store): + """An in memory implementation of a triple store. + + Same as SimpleMemory above, but is Context-aware, Graph-aware, and Formula-aware + Authors: Ashley Sommer + """ + + context_aware = True + formula_aware = True + graph_aware = True + + def __init__( + self, + configuration: Optional[str] = None, + identifier: Optional[Identifier] = None, + ): + super(Memory, self).__init__(configuration) + self.identifier = identifier + + # indexed by [subject][predicate][object] + self.__spo: Dict[_SubjectType, Dict[_PredicateType, Dict[_ObjectType, int]]] = ( + {} + ) + + # indexed by [predicate][object][subject] + self.__pos: Dict[_PredicateType, Dict[_ObjectType, Dict[_SubjectType, int]]] = ( + {} + ) + + # indexed by [predicate][object][subject] + self.__osp: Dict[_ObjectType, Dict[_SubjectType, Dict[_PredicateType, int]]] = ( + {} + ) + + self.__namespace: Dict[str, URIRef] = {} + self.__prefix: Dict[URIRef, str] = {} + self.__context_obj_map: Dict[str, Graph] = {} + self.__tripleContexts: Dict[_TripleType, Dict[Optional[str], bool]] = {} + self.__contextTriples: Dict[Optional[str], Set[_TripleType]] = {None: set()} + # all contexts used in store (unencoded) + self.__all_contexts: Set[Graph] = set() + # default context information for triples + self.__defaultContexts: Optional[Dict[Optional[str], bool]] = None + + def add( + self, + triple: _TripleType, + context: _ContextType, + quoted: bool = False, + ) -> None: + """Add a triple to the store of triples.""" + # add dictionary entries for spo[s][p][p] = 1 and pos[p][o][s] + # = 1, creating the nested dictionaries where they do not yet + # exits. + Store.add(self, triple, context, quoted=quoted) + if context is not None: + self.__all_contexts.add(context) + subject, predicate, object_ = triple + + spo = self.__spo + try: + po = spo[subject] + except LookupError: + po = spo[subject] = {} + try: + o = po[predicate] + except LookupError: + o = po[predicate] = {} + + try: + _ = o[object_] + # This cannot be reached if (s, p, o) was not inserted before. + triple_exists = True + except KeyError: + o[object_] = 1 + triple_exists = False + self.__add_triple_context(triple, triple_exists, context, quoted) + + if triple_exists: + # No need to insert twice this triple. + return + + pos = self.__pos + try: + os = pos[predicate] + except LookupError: + os = pos[predicate] = {} + try: + s = os[object_] + except LookupError: + s = os[object_] = {} + s[subject] = 1 + + osp = self.__osp + try: + sp = osp[object_] + except LookupError: + sp = osp[object_] = {} + try: + p = sp[subject] + except LookupError: + p = sp[subject] = {} + p[predicate] = 1 + + def remove( + self, + triple_pattern: _TriplePatternType, + context: Optional[_ContextType] = None, + ) -> None: + req_ctx = self.__ctx_to_str(context) + for triple, c in self.triples(triple_pattern, context=context): + subject, predicate, object_ = triple + for ctx in self.__get_context_for_triple(triple): + if context is not None and req_ctx != ctx: + continue + self.__remove_triple_context(triple, ctx) + ctxs = self.__get_context_for_triple(triple, skipQuoted=True) + if None in ctxs and (context is None or len(ctxs) == 1): + # remove from default graph too + self.__remove_triple_context(triple, None) + if len(self.__get_context_for_triple(triple)) == 0: + del self.__spo[subject][predicate][object_] + del self.__pos[predicate][object_][subject] + del self.__osp[object_][subject][predicate] + del self.__tripleContexts[triple] + if ( + req_ctx is not None + and req_ctx in self.__contextTriples + and len(self.__contextTriples[req_ctx]) == 0 + ): + # all triples are removed out of this context + # and it's not the default context so delete it + del self.__contextTriples[req_ctx] + + if ( + triple_pattern == (None, None, None) + and context in self.__all_contexts + and not self.graph_aware + ): + # remove the whole context + self.__all_contexts.remove(context) + + def triples( + self, + triple_pattern: _TriplePatternType, + context: Optional[_ContextType] = None, + ) -> Generator[ + Tuple[_TripleType, Generator[Optional[_ContextType], None, None]], + None, + None, + ]: + """A generator over all the triples matching""" + req_ctx = self.__ctx_to_str(context) + subject, predicate, object_ = triple_pattern + + # all triples case (no triple parts given as pattern) + if subject is None and predicate is None and object_ is None: + # Just dump all known triples from the given graph + if req_ctx not in self.__contextTriples: + return + for triple in self.__contextTriples[req_ctx].copy(): + yield triple, self.__contexts(triple) + + # optimize "triple in graph" case (all parts given) + elif subject is not None and predicate is not None and object_ is not None: + # type error: Incompatible types in assignment (expression has type "Tuple[Optional[IdentifiedNode], Optional[IdentifiedNode], Optional[Identifier]]", variable has type "Tuple[IdentifiedNode, IdentifiedNode, Identifier]") + # NOTE on type error: at this point, all elements of triple_pattern + # is not None, so it has the same type as triple + triple = triple_pattern # type: ignore[assignment] + try: + _ = self.__spo[subject][predicate][object_] + if self.__triple_has_context(triple, req_ctx): + yield triple, self.__contexts(triple) + except KeyError: + return + + elif subject is not None: # subject is given + spo = self.__spo + if subject in spo: + subjectDictionary = spo[subject] # noqa: N806 + if predicate is not None: # subject+predicate is given + if predicate in subjectDictionary: + if object_ is not None: # subject+predicate+object is given + if object_ in subjectDictionary[predicate]: + triple = (subject, predicate, object_) + if self.__triple_has_context(triple, req_ctx): + yield triple, self.__contexts(triple) + else: # given object not found + pass + else: # subject+predicate is given, object unbound + for o in list(subjectDictionary[predicate].keys()): + triple = (subject, predicate, o) + if self.__triple_has_context(triple, req_ctx): + yield triple, self.__contexts(triple) + else: # given predicate not found + pass + else: # subject given, predicate unbound + for p in list(subjectDictionary.keys()): + if object_ is not None: # object is given + if object_ in subjectDictionary[p]: + triple = (subject, p, object_) + if self.__triple_has_context(triple, req_ctx): + yield triple, self.__contexts(triple) + else: # given object not found + pass + else: # object unbound + for o in list(subjectDictionary[p].keys()): + triple = (subject, p, o) + if self.__triple_has_context(triple, req_ctx): + yield triple, self.__contexts(triple) + else: # given subject not found + pass + elif predicate is not None: # predicate is given, subject unbound + pos = self.__pos + if predicate in pos: + predicateDictionary = pos[predicate] # noqa: N806 + if object_ is not None: # predicate+object is given, subject unbound + if object_ in predicateDictionary: + for s in list(predicateDictionary[object_].keys()): + triple = (s, predicate, object_) + if self.__triple_has_context(triple, req_ctx): + yield triple, self.__contexts(triple) + else: # given object not found + pass + else: # predicate is given, object+subject unbound + for o in list(predicateDictionary.keys()): + for s in list(predicateDictionary[o].keys()): + triple = (s, predicate, o) + if self.__triple_has_context(triple, req_ctx): + yield triple, self.__contexts(triple) + elif object_ is not None: # object is given, subject+predicate unbound + osp = self.__osp + if object_ in osp: + objectDictionary = osp[object_] # noqa: N806 + for s in list(objectDictionary.keys()): + for p in list(objectDictionary[s].keys()): + triple = (s, p, object_) + if self.__triple_has_context(triple, req_ctx): + yield triple, self.__contexts(triple) + else: # subject+predicate+object unbound + # Shouldn't get here if all other cases above worked correctly. + spo = self.__spo + for s in list(spo.keys()): + subjectDictionary = spo[s] # noqa: N806 + for p in list(subjectDictionary.keys()): + for o in list(subjectDictionary[p].keys()): + triple = (s, p, o) + if self.__triple_has_context(triple, req_ctx): + yield triple, self.__contexts(triple) + + def bind(self, prefix: str, namespace: URIRef, override: bool = True) -> None: + # should be identical to `SimpleMemory.bind` + bound_namespace = self.__namespace.get(prefix) + bound_prefix = _coalesce( + self.__prefix.get(namespace), + # type error: error: Argument 1 to "get" of "Mapping" has incompatible type "Optional[URIRef]"; expected "URIRef" + self.__prefix.get(bound_namespace), # type: ignore[arg-type] + ) + if override: + if bound_prefix is not None: + del self.__namespace[bound_prefix] + if bound_namespace is not None: + del self.__prefix[bound_namespace] + self.__prefix[namespace] = prefix + self.__namespace[prefix] = namespace + else: + # type error: Invalid index type "Optional[URIRef]" for "Dict[URIRef, str]"; expected type "URIRef" + self.__prefix[_coalesce(bound_namespace, namespace)] = _coalesce( # type: ignore[index] + bound_prefix, default=prefix + ) + # type error: Invalid index type "Optional[str]" for "Dict[str, URIRef]"; expected type "str" + # type error: Incompatible types in assignment (expression has type "Optional[URIRef]", target has type "URIRef") + self.__namespace[_coalesce(bound_prefix, prefix)] = _coalesce( # type: ignore[index] + bound_namespace, default=namespace + ) + + def namespace(self, prefix: str) -> Optional[URIRef]: + return self.__namespace.get(prefix, None) + + def prefix(self, namespace: URIRef) -> Optional[str]: + return self.__prefix.get(namespace, None) + + def namespaces(self) -> Iterator[Tuple[str, URIRef]]: + for prefix, namespace in self.__namespace.items(): + yield prefix, namespace + + def contexts( + self, triple: Optional[_TripleType] = None + ) -> Generator[_ContextType, None, None]: + if triple is None or triple == (None, None, None): + return (context for context in list(self.__all_contexts)) + + subj, pred, obj = triple + try: + _ = self.__spo[subj][pred][obj] + return self.__contexts(triple) + except KeyError: + return (_ for _ in []) + + def __len__(self, context: Optional[_ContextType] = None) -> int: + ctx = self.__ctx_to_str(context) + if ctx not in self.__contextTriples: + return 0 + return len(self.__contextTriples[ctx]) + + def add_graph(self, graph: Graph) -> None: + if not self.graph_aware: + Store.add_graph(self, graph) + else: + self.__all_contexts.add(graph) + + def remove_graph(self, graph: Graph) -> None: + if not self.graph_aware: + Store.remove_graph(self, graph) + else: + self.remove((None, None, None), graph) + try: + self.__all_contexts.remove(graph) + except KeyError: + pass # we didn't know this graph, no problem + + # internal utility methods below + def __add_triple_context( + self, + triple: _TripleType, + triple_exists: bool, + context: Optional[_ContextType], + quoted: bool, + ) -> None: + """add the given context to the set of contexts for the triple""" + ctx = self.__ctx_to_str(context) + quoted = bool(quoted) + if triple_exists: + # we know the triple exists somewhere in the store + try: + triple_context = self.__tripleContexts[triple] + except KeyError: + # triple exists with default ctx info + # start with a copy of the default ctx info + # type error: Item "None" of "Optional[Dict[Optional[str], bool]]" has no attribute "copy" + triple_context = self.__tripleContexts[triple] = ( + self.__defaultContexts.copy() # type: ignore[union-attr] + ) + + triple_context[ctx] = quoted + + if not quoted: + triple_context[None] = quoted + + else: + # the triple didn't exist before in the store + if quoted: # this context only + triple_context = self.__tripleContexts[triple] = {ctx: quoted} + else: # default context as well + triple_context = self.__tripleContexts[triple] = { + ctx: quoted, + None: quoted, + } + + # if the triple is not quoted add it to the default context + if not quoted: + self.__contextTriples[None].add(triple) + + # always add the triple to given context, making sure it's initialized + if ctx not in self.__contextTriples: + self.__contextTriples[ctx] = set() + self.__contextTriples[ctx].add(triple) + + # if this is the first ever triple in the store, set default ctx info + if self.__defaultContexts is None: + self.__defaultContexts = triple_context + # if the context info is the same as default, no need to store it + if triple_context == self.__defaultContexts: + del self.__tripleContexts[triple] + + def __get_context_for_triple( + self, triple: _TripleType, skipQuoted: bool = False # noqa: N803 + ) -> Collection[Optional[str]]: + """return a list of contexts (str) for the triple, skipping + quoted contexts if skipQuoted==True""" + + ctxs = self.__tripleContexts.get(triple, self.__defaultContexts) + + if not skipQuoted: + # type error: Item "None" of "Optional[Dict[Optional[str], bool]]" has no attribute "keys" + return ctxs.keys() # type: ignore[union-attr] + + # type error: Item "None" of "Optional[Dict[Optional[str], bool]]" has no attribute "items" + return [ctx for ctx, quoted in ctxs.items() if not quoted] # type: ignore[union-attr] + + def __triple_has_context(self, triple: _TripleType, ctx: Optional[str]) -> bool: + """return True if the triple exists in the given context""" + # type error: Unsupported right operand type for in ("Optional[Dict[Optional[str], bool]]") + return ctx in self.__tripleContexts.get(triple, self.__defaultContexts) # type: ignore[operator] + + def __remove_triple_context(self, triple: _TripleType, ctx): + """remove the context from the triple""" + # type error: Item "None" of "Optional[Dict[Optional[str], bool]]" has no attribute "copy" + ctxs = self.__tripleContexts.get(triple, self.__defaultContexts).copy() # type: ignore[union-attr] + del ctxs[ctx] + if ctxs == self.__defaultContexts: + del self.__tripleContexts[triple] + else: + self.__tripleContexts[triple] = ctxs + self.__contextTriples[ctx].remove(triple) + + @overload + def __ctx_to_str(self, ctx: _ContextType) -> str: ... + + @overload + def __ctx_to_str(self, ctx: None) -> None: ... + + def __ctx_to_str(self, ctx: Optional[_ContextType]) -> Optional[str]: + if ctx is None: + return None + try: + # ctx could be a graph. In that case, use its identifier + ctx_str = "{}:{}".format(ctx.identifier.__class__.__name__, ctx.identifier) + self.__context_obj_map[ctx_str] = ctx + return ctx_str + except AttributeError: + # otherwise, ctx should be a URIRef or BNode or str + # NOTE on type errors: This is actually never called with ctx value as str in all unit tests, so this seems like it should just not be here. + # type error: Subclass of "Graph" and "str" cannot exist: would have incompatible method signatures + if isinstance(ctx, str): # type: ignore[unreachable] + # type error: Statement is unreachable + ctx_str = "{}:{}".format(ctx.__class__.__name__, ctx) # type: ignore[unreachable] + if ctx_str in self.__context_obj_map: + return ctx_str + self.__context_obj_map[ctx_str] = ctx + return ctx_str + raise RuntimeError("Cannot use that type of object as a Graph context") + + def __contexts(self, triple: _TripleType) -> Generator[_ContextType, None, None]: + """return a generator for all the non-quoted contexts + (dereferenced) the encoded triple appears in""" + # type error: Argument 2 to "get" of "Mapping" has incompatible type "str"; expected "Optional[Graph]" + return ( + self.__context_obj_map.get(ctx_str, ctx_str) # type: ignore[arg-type] + for ctx_str in self.__get_context_for_triple(triple, skipQuoted=True) + if ctx_str is not None + ) + + # type error: Missing return statement + def query( # type: ignore[return] + self, + query: Union[Query, str], + initNs: Mapping[str, Any], # noqa: N803 + initBindings: Mapping[str, Identifier], # noqa: N803 + queryGraph: str, # noqa: N803 + **kwargs, + ) -> Result: + super(Memory, self).query(query, initNs, initBindings, queryGraph, **kwargs) + + def update( + self, + update: Union[Update, Any], + initNs: Mapping[str, Any], # noqa: N803 + initBindings: Mapping[str, Identifier], # noqa: N803 + queryGraph: str, # noqa: N803 + **kwargs, + ) -> None: + super(Memory, self).update(update, initNs, initBindings, queryGraph, **kwargs) diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/rdf4j.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/rdf4j.py new file mode 100644 index 0000000000000000000000000000000000000000..7f1bb5cad35d7248075bfe564d65c74d0953df8a --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/rdf4j.py @@ -0,0 +1,223 @@ +from __future__ import annotations + +from textwrap import dedent +from typing import Any, Generator, Iterable, Iterator, Mapping, Optional, Tuple + +from rdflib import Graph +from rdflib.contrib.rdf4j import has_httpx +from rdflib.contrib.rdf4j.exceptions import RepositoryNotFoundError +from rdflib.graph import ( + DATASET_DEFAULT_GRAPH_ID, + Dataset, + _ContextType, + _QuadType, + _TriplePatternType, + _TripleType, +) +from rdflib.store import VALID_STORE, Store +from rdflib.term import BNode, Node, URIRef, Variable + +if has_httpx: + from rdflib.contrib.rdf4j import RDF4JClient + + +def _inject_prefixes(query: str, extra_bindings: Mapping[str, Any]) -> str: + bindings = set(list(extra_bindings.items())) + if not bindings: + return query + return "\n".join( + [ + "\n".join(["PREFIX %s: <%s>" % (k, v) for k, v in bindings]), + "", # separate ns_bindings from query with an empty line + query, + ] + ) + + +def _node_to_sparql(node: Node) -> str: + if isinstance(node, BNode): + raise Exception( + "SPARQL-based stores do not support BNodes" + "See http://www.w3.org/TR/sparql11-query/#BGPsparqlBNodes" + ) + return node.n3() + + +def _default_repo_config(repository_id: str) -> str: + return dedent( + f""" + PREFIX config: + + [] a config:Repository ; + config:rep.id "{repository_id}" ; + config:rep.impl + [ + config:rep.type "openrdf:SailRepository" ; + config:sail.impl + [ + config:native.tripleIndexers "spoc,posc" ; + config:sail.defaultQueryEvaluationMode "STANDARD" ; + config:sail.iterationCacheSyncThreshold "10000" ; + config:sail.type "openrdf:NativeStore" ; + ] ; + ] ; + . + """ + ) + + +class RDF4JStore(Store): + """An RDF4J store.""" + + context_aware = True + formula_aware = False + transaction_aware = False + graph_aware = True + + def __init__( + self, + base_url: str, + repository_id: str, + configuration: str | None = None, + auth: tuple[str, str] | None = None, + timeout: float = 30.0, + create: bool = False, + **kwargs, + ): + if configuration is None: + configuration = _default_repo_config(repository_id) + self._client = RDF4JClient(base_url, auth, timeout, **kwargs) + self._repository_id = repository_id + self._repo = None + self.open(configuration, create) + super().__init__() + + @property + def client(self): + return self._client + + @property + def repo(self): + if self._repo is None: + self._repo = self.client.repositories.get(self._repository_id) + return self._repo + + def open( + self, configuration: str | tuple[str, str] | None, create: bool = False + ) -> int | None: + try: + # Try connecting to the repository. + self.repo.health() + except RepositoryNotFoundError: + if create: + self.client.repositories.create(self._repository_id, configuration) + self.repo.health() + else: + raise Exception(f"Repository {self._repository_id} not found.") + + return VALID_STORE + + def close(self, commit_pending_transaction: bool = False) -> None: + self.client.close() + + def add( + self, + triple: _TripleType, + context: _ContextType | None = None, + quoted: bool = False, + ) -> None: + s, p, o = triple + graph_name = ( + "" + if context is None or context.identifier == DATASET_DEFAULT_GRAPH_ID + else context.identifier.n3() + ) + statement = f"{s.n3()} {p.n3()} {o.n3()} {graph_name} ." + self.repo.upload(statement) + + def addN(self, quads: Iterable[_QuadType]) -> None: # noqa: N802 + statements = "" + for s, p, o, c in quads: + graph_name = ( + "" + if c is None or c.identifier == DATASET_DEFAULT_GRAPH_ID + else c.identifier.n3() + ) + statement = f"{s.n3()} {p.n3()} {o.n3()} {graph_name} .\n" + statements += statement + self.repo.upload(statements) + + def remove( + self, + triple: _TriplePatternType, + context: Optional[_ContextType] = None, + ) -> None: + s, p, o = triple + g = context.identifier if context is not None else None + self.repo.delete(s, p, o, g) + + def triples( + self, + triple_pattern: _TriplePatternType, + context: Optional[_ContextType] = None, + ) -> Iterator[Tuple[_TripleType, Iterator[Optional[_ContextType]]]]: + s, p, o = triple_pattern + graph_name = context.identifier if context is not None else None + result_graph = self.repo.get(s, p, o, graph_name) + if isinstance(result_graph, Dataset): + for s, p, o, g in result_graph: + yield (s, p, o), iter([Graph(self, identifier=g)]) + else: + # It's a Graph object. + for triple in result_graph: + # Returning None for _ContextType as it's not used by the caller. + yield triple, iter([None]) + + def contexts( + self, triple: Optional[_TripleType] = None + ) -> Generator[_ContextType, None, None]: + if triple is None: + for graph_name in self.repo.graph_names(): + yield Graph(self, identifier=graph_name) + else: + s, p, o = triple + params = ( + _node_to_sparql(s if s else Variable("s")), + _node_to_sparql(p if p else Variable("p")), + _node_to_sparql(o if o else Variable("o")), + ) + query = ( + "SELECT DISTINCT ?graph WHERE { GRAPH ?graph { %s %s %s } }" % params + ) + result = self.repo.query(query) + for row in result: + yield Graph(self, identifier=row["graph"]) + + def bind(self, prefix: str, namespace: URIRef, override: bool = True) -> None: + # Note: RDF4J namespaces always override. + self.repo.namespaces.set(prefix, namespace) + + def prefix(self, namespace: URIRef) -> Optional[str]: + namespace_prefixes = dict( + [(x.namespace, x.prefix) for x in self.repo.namespaces.list()] + ) + return namespace_prefixes.get(str(namespace)) + + def namespace(self, prefix: str) -> Optional[URIRef]: + result = self.repo.namespaces.get(prefix) + return URIRef(result) if result is not None else None + + def namespaces(self) -> Iterator[Tuple[str, URIRef]]: + for result in self.repo.namespaces.list(): + yield result.prefix, URIRef(result.namespace) + + def add_graph(self, graph: Graph) -> None: + if graph.identifier != DATASET_DEFAULT_GRAPH_ID: + # Note: this is a no-op since RDF4J doesn't support empty named graphs. + self.repo.update(f"CREATE SILENT GRAPH {graph.identifier.n3()}") + + def remove_graph(self, graph: Graph) -> None: + self.repo.graphs.clear(graph.identifier) + + def __len__(self, context: _ContextType | None = None) -> int: + return self.repo.size(context if context is None else context.identifier) diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/regexmatching.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/regexmatching.py new file mode 100644 index 0000000000000000000000000000000000000000..9dc3da2faa1d914029aa6d32d12b4ae46e0f9a74 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/regexmatching.py @@ -0,0 +1,174 @@ +""" +This wrapper intercepts calls through the store interface which make use of +the REGEXTerm class to represent matches by REGEX instead of literal +comparison. + +Implemented for stores that don't support this and essentially +provides the support by replacing the REGEXTerms by wildcards (None) and +matching against the results from the store it's wrapping. +""" + +import re + +from rdflib.graph import Graph +from rdflib.store import Store + +# Store is capable of doing its own REGEX matching +NATIVE_REGEX = 0 +# Store uses Python's re module internally for REGEX matching +PYTHON_REGEX = 1 + + +class REGEXTerm(str): + """ + REGEXTerm can be used in any term slot and is interpreted as a request to + perform a REGEX match (not a string comparison) using the value + (pre-compiled) for checking rdf:type matches + """ + + def __init__(self, expr): + self.compiledExpr = re.compile(expr) + + def __reduce__(self): + return (REGEXTerm, ("",)) + + +def regexCompareQuad(quad, regexQuad): # noqa: N802, N803 + for index in range(4): + if isinstance(regexQuad[index], REGEXTerm) and not regexQuad[ + index + ].compiledExpr.match(quad[index]): + return False + return True + + +class REGEXMatching(Store): + def __init__(self, storage): + self.storage = storage + self.context_aware = storage.context_aware + # NOTE: this store can't be formula_aware as it doesn't have enough + # info to reverse the removal of a quoted statement. + self.formula_aware = storage.formula_aware + self.transaction_aware = storage.transaction_aware + + def open(self, configuration, create=True): + return self.storage.open(configuration, create) + + def close(self, commit_pending_transaction=False): + self.storage.close() + + def destroy(self, configuration): + self.storage.destroy(configuration) + + def add(self, triple, context, quoted=False): + (subject, predicate, object_) = triple + self.storage.add((subject, predicate, object_), context, quoted) + + def remove(self, triple, context=None): + (subject, predicate, object_) = triple + if ( + isinstance(subject, REGEXTerm) + or isinstance(predicate, REGEXTerm) + or isinstance(object_, REGEXTerm) + or (context is not None and isinstance(context.identifier, REGEXTerm)) + ): + # One or more of the terms is a REGEX expression, so we must + # replace it / them with wildcard(s)and match after we query. + s = not isinstance(subject, REGEXTerm) and subject or None + p = not isinstance(predicate, REGEXTerm) and predicate or None + o = not isinstance(object_, REGEXTerm) and object_ or None + c = ( + (context is not None and not isinstance(context.identifier, REGEXTerm)) + and context + or None + ) + + removeQuadList = [] # noqa: N806 + for (s1, p1, o1), cg in self.storage.triples((s, p, o), c): + for ctx in cg: + ctx = ctx.identifier + if regexCompareQuad( + (s1, p1, o1, ctx), + ( + subject, + predicate, + object_, + context is not None and context.identifier or context, + ), + ): + removeQuadList.append((s1, p1, o1, ctx)) + for s, p, o, c in removeQuadList: + self.storage.remove((s, p, o), c and Graph(self, c) or c) + else: + self.storage.remove((subject, predicate, object_), context) + + def triples(self, triple, context=None): + (subject, predicate, object_) = triple + if ( + isinstance(subject, REGEXTerm) + or isinstance(predicate, REGEXTerm) + or isinstance(object_, REGEXTerm) + or (context is not None and isinstance(context.identifier, REGEXTerm)) + ): + # One or more of the terms is a REGEX expression, so we must + # replace it / them with wildcard(s) and match after we query. + s = not isinstance(subject, REGEXTerm) and subject or None + p = not isinstance(predicate, REGEXTerm) and predicate or None + o = not isinstance(object_, REGEXTerm) and object_ or None + c = ( + (context is not None and not isinstance(context.identifier, REGEXTerm)) + and context + or None + ) + for (s1, p1, o1), cg in self.storage.triples((s, p, o), c): + matchingCtxs = [] # noqa: N806 + for ctx in cg: + if c is None: + if context is None or context.identifier.compiledExpr.match( + ctx.identifier + ): + matchingCtxs.append(ctx) + else: + matchingCtxs.append(ctx) + if matchingCtxs and regexCompareQuad( + (s1, p1, o1, None), (subject, predicate, object_, None) + ): + yield (s1, p1, o1), (c for c in matchingCtxs) + else: + for (s1, p1, o1), cg in self.storage.triples( + (subject, predicate, object_), context + ): + yield (s1, p1, o1), cg + + def __len__(self, context=None): + # NOTE: If the context is a REGEX this could be an expensive + # proposition + return self.storage.__len__(context) + + def contexts(self, triple=None): + # NOTE: There is no way to control REGEX matching for this method at + # this level as it only returns the contexts, not the matching + # triples. + for ctx in self.storage.contexts(triple): + yield ctx + + def remove_context(self, identifier): + self.storage.remove((None, None, None), identifier) + + def bind(self, prefix, namespace, override=True): + self.storage.bind(prefix, namespace, override=override) + + def prefix(self, namespace): + return self.storage.prefix(namespace) + + def namespace(self, prefix): + return self.storage.namespace(prefix) + + def namespaces(self): + return self.storage.namespaces() + + def commit(self): + self.storage.commit() + + def rollback(self): + self.storage.rollback() diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/sparqlconnector.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/sparqlconnector.py new file mode 100644 index 0000000000000000000000000000000000000000..d4cb86c63ec8bd24cfbcfc05ec5242f0fdd46153 --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/sparqlconnector.py @@ -0,0 +1,206 @@ +from __future__ import annotations + +import base64 +import copy +import logging +from io import BytesIO +from typing import TYPE_CHECKING, Optional, Tuple +from urllib.error import HTTPError +from urllib.parse import urlencode +from urllib.request import Request, urlopen + +from rdflib.plugin import plugins +from rdflib.query import Result, ResultParser +from rdflib.term import BNode +from rdflib.util import FORMAT_MIMETYPE_MAP, RESPONSE_TABLE_FORMAT_MIMETYPE_MAP + +log = logging.getLogger(__name__) + +if TYPE_CHECKING: + import typing_extensions as te + + +class SPARQLConnectorException(Exception): # noqa: N818 + pass + + +class SPARQLConnector: + """ + this class deals with nitty gritty details of talking to a SPARQL server + """ + + def __init__( + self, + query_endpoint: Optional[str] = None, + update_endpoint: Optional[str] = None, + returnFormat: Optional[str] = "xml", # noqa: N803 + method: te.Literal["GET", "POST", "POST_FORM"] = "GET", + auth: Optional[Tuple[str, str]] = None, + **kwargs, + ): + """ + auth, if present, must be a tuple of (username, password) used for Basic Authentication + + Any additional keyword arguments will be passed to to the request, and can be used to setup timeouts etc. + """ + self._method: str + self.returnFormat = returnFormat + self.query_endpoint = query_endpoint + self.update_endpoint = update_endpoint + self.kwargs = kwargs + self.method = method + if auth is not None: + if type(auth) is not tuple: + raise SPARQLConnectorException("auth must be a tuple") + if len(auth) != 2: + raise SPARQLConnectorException("auth must be a tuple (user, password)") + base64string = base64.b64encode(bytes("%s:%s" % auth, "ascii")) + self.kwargs.setdefault("headers", {}) + self.kwargs["headers"].update( + {"Authorization": "Basic %s" % base64string.decode("utf-8")} + ) + + @property + def method(self) -> str: + return self._method + + @method.setter + def method(self, method: str) -> None: + if method not in ("GET", "POST", "POST_FORM"): + raise SPARQLConnectorException( + 'Method must be "GET", "POST", or "POST_FORM"' + ) + + self._method = method + + def query( + self, + query: str, + default_graph: Optional[str] = None, + named_graph: Optional[str] = None, + ) -> Result: + if not self.query_endpoint: + raise SPARQLConnectorException("Query endpoint not set!") + + params = {} + # this test ensures we don't have a useless (BNode) default graph URI, which calls to Graph().query() will add + if default_graph is not None and type(default_graph) is not BNode: + params["default-graph-uri"] = default_graph + + headers = {"Accept": self.response_mime_types()} + + args = copy.deepcopy(self.kwargs) + + # merge params/headers dicts + args.setdefault("params", {}) + + args.setdefault("headers", {}) + args["headers"].update(headers) + + if self.method == "GET": + params["query"] = query + args["params"].update(params) + qsa = "?" + urlencode(args["params"]) + try: + res = urlopen( + Request(self.query_endpoint + qsa, headers=args["headers"]) + ) + except Exception as e: # noqa: F841 + raise ValueError( + "You did something wrong formulating either the URI or your SPARQL query" + ) + elif self.method == "POST": + args["headers"].update({"Content-Type": "application/sparql-query"}) + args["params"].update(params) + qsa = "?" + urlencode(args["params"]) + try: + res = urlopen( + Request( + self.query_endpoint + qsa, + data=query.encode(), + headers=args["headers"], + ) + ) + except HTTPError as e: + # type error: Incompatible return value type (got "Tuple[int, str, None]", expected "Result") + return e.code, str(e), None # type: ignore[return-value] + elif self.method == "POST_FORM": + params["query"] = query + args["params"].update(params) + try: + res = urlopen( + Request( + self.query_endpoint, + data=urlencode(args["params"]).encode(), + headers=args["headers"], + ) + ) + except HTTPError as e: + # type error: Incompatible return value type (got "Tuple[int, str, None]", expected "Result") + return e.code, str(e), None # type: ignore[return-value] + else: + raise SPARQLConnectorException("Unknown method %s" % self.method) + return Result.parse( + BytesIO(res.read()), content_type=res.headers["Content-Type"].split(";")[0] + ) + + def update( + self, + query: str, + default_graph: Optional[str] = None, + named_graph: Optional[str] = None, + ) -> None: + if not self.update_endpoint: + raise SPARQLConnectorException("Query endpoint not set!") + + params = {} + + if default_graph is not None: + params["using-graph-uri"] = default_graph + + if named_graph is not None: + params["using-named-graph-uri"] = named_graph + + headers = { + "Accept": self.response_mime_types(), + "Content-Type": "application/sparql-update; charset=UTF-8", + } + + args = copy.deepcopy(self.kwargs) # other QSAs + + args.setdefault("params", {}) + args["params"].update(params) + args.setdefault("headers", {}) + args["headers"].update(headers) + + qsa = "?" + urlencode(args["params"]) + res = urlopen( # noqa: F841 + Request( + self.update_endpoint + qsa, data=query.encode(), headers=args["headers"] + ) + ) + + def response_mime_types(self) -> str: + """Construct a HTTP-Header Accept field to reflect the supported mime types. + + If the return_format parameter is set, the mime types are restricted to these accordingly. + """ + sparql_format_mimetype_map = { + k: FORMAT_MIMETYPE_MAP.get(k, []) + + RESPONSE_TABLE_FORMAT_MIMETYPE_MAP.get(k, []) + for k in list(FORMAT_MIMETYPE_MAP.keys()) + + list(RESPONSE_TABLE_FORMAT_MIMETYPE_MAP.keys()) + } + + supported_formats = set() + for plugin in plugins(name=self.returnFormat, kind=ResultParser): + if "/" not in plugin.name: + supported_formats.update( + sparql_format_mimetype_map.get(plugin.name, []) + ) + else: + supported_formats.add(plugin.name) + return ", ".join(supported_formats) + + +__all__ = ["SPARQLConnector", "SPARQLConnectorException"] diff --git a/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/sparqlstore.py b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/sparqlstore.py new file mode 100644 index 0000000000000000000000000000000000000000..4d72f2c8d276cc309deac4d80c6135fb80938f7d --- /dev/null +++ b/TTS/Kokoro/.venv/Lib/site-packages/rdflib/plugins/stores/sparqlstore.py @@ -0,0 +1,997 @@ +""" +This is an RDFLib store around Ivan Herman et al.'s SPARQL service wrapper. +This was first done in layer-cake, and then ported to RDFLib +""" + +from __future__ import annotations + +import collections +import re +from typing import ( + TYPE_CHECKING, + Any, + Callable, + Dict, + Generator, + Iterable, + Iterator, + List, + Mapping, + Optional, + Tuple, + Union, + overload, +) + +from rdflib.graph import DATASET_DEFAULT_GRAPH_ID, Graph +from rdflib.plugins.stores.regexmatching import NATIVE_REGEX +from rdflib.store import Store +from rdflib.term import BNode, Identifier, Node, URIRef, Variable + +if TYPE_CHECKING: + import typing_extensions as te # noqa: I001 + from rdflib.graph import ( + _TripleType, + _ContextType, + _QuadType, + _TripleChoiceType, + _TriplePatternType, + _SubjectType, + _PredicateType, + _ObjectType, + _ContextIdentifierType, + ) + from rdflib.plugins.sparql.sparql import Query, Update + from rdflib.query import Result, ResultRow + +from .sparqlconnector import SPARQLConnector + +# Defines some SPARQL keywords +LIMIT = "LIMIT" +OFFSET = "OFFSET" +ORDERBY = "ORDER BY" + +BNODE_IDENT_PATTERN = re.compile(r"(?P