-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b868835
Showing
118 changed files
with
12,807 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: 8b659c1b09d0020b3e51ad473a1d0d73 | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,231 @@ | ||
|
||
<!DOCTYPE html> | ||
<html lang="en" class="scroll-smooth"> | ||
|
||
<head> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<meta charset="utf-8" /> | ||
|
||
<title>gimie.graph.operations | gimie 0.6.1 documentation</title> | ||
<link rel="stylesheet" href="../../../_static/pygments.css" /> | ||
<link rel="stylesheet" href="../../../_static/theme.c973b470ab69573097f3.css" /> | ||
<link rel="stylesheet" href="../../../_static/copybutton.css" /> | ||
<link rel="stylesheet" href="../../../_static/design-style.1e8bd061cd6da7fc9cf755528e8ffc24.min.css" /> | ||
<link rel="icon" href="../../../_static/favicon.ico" /> | ||
<link rel="search" title="Search" href="../../../search.html" /> | ||
<link rel="index" title="Index" href="../../../genindex.html" /> | ||
</head> | ||
|
||
<body class="antialiased text-gray"> | ||
<div id="page" data-controller="sidebar search scroll " | ||
data-action="keydown@window->search#focus " | ||
class="min-h-screen xl:h-screen flex flex-col xl:grid xl:grid-layout print:block print:h-auto" | ||
> | ||
<a class="block transition -translate-x-full focus:translate-x-0 opacity-0 focus:opacity-100 text-xl bg-white p-4 z-20 absolute top-0 left-0 h-14" href="#gimie-graph-operations" title="Skip navigation links">Skip to content</a> | ||
|
||
<header class="grid-area-header z-10 h-14 fixed w-full top-0 print:hidden"> | ||
<div class="bg-gray-dark shadow-md flex items-center h-full xl:px-2 relative"><div class="flex items-center"> | ||
<button data-action="sidebar#open" data-sidebar-target="hamburger" | ||
class="xl:hidden h-14 w-14 leading-14 text-gray-100 hover:bg-gray-700 hover:text-brand focus:outline-none focus:bg-gray-700 focus:text-brand"> | ||
<span class="sr-only">Open navigation menu</span> | ||
<svg aria-hidden="true" class="inline fill-current h-8 w-8" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> | ||
<path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" /> | ||
</svg> | ||
</button><a class="hover:bg-gray-700 focus:bg-gray-700 focus:outline-none" href="../../../index.html" | ||
title="Back to homepage"> | ||
<img class="h-14 w-14 p-3 inline-block" src="../../../_static/logo_notext.svg" alt="Logo" /><span class="hidden lg:inline-block shrink-0 font-medium text-gray-100 mx-5 leading-14 tracking-wider">gimie 0.6.1 documentation</span> | ||
</a></div><div class="flex justify-end items-center flex-1"><form | ||
id="searchbox" | ||
action="../../../search.html" | ||
data-action="click->search#focusSearchInput" | ||
method="get" | ||
class="flex print:hidden justify-between items-center leading-14 md:ml-4 bg-gray-dark text-gray-300 focus-within:bg-gray-50 focus-within:text-gray-800 focus-within:absolute focus-within:inset-x-0 focus-within:top-0 md:focus-within:w-full md:focus-within:static z-10"> | ||
|
||
<button | ||
class="text-inherit h-14 w-14" | ||
aria-label="Get search results" | ||
tabindex="-1" | ||
> | ||
<svg aria-hidden="true" class="fill-current stroke-current h-8 w-8" stroke-width="0.5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg> | ||
</button> | ||
|
||
<input | ||
name="q" | ||
id="search-input" | ||
data-search-target="searchInput" | ||
type="search" | ||
aria-label="Search the docs" | ||
placeholder="Search the docs" | ||
class="pr-2 bg-transparent text-inherit focus:outline-none w-0 md:w-auto focus:w-full transition-all duration-100" | ||
/> | ||
</form></div> | ||
</div> | ||
</header> | ||
|
||
|
||
<aside data-sidebar-target="sidebar" class="grid-area-sidebar h-full fixed pt-14 xl:relative inset-y-0 left-0 z-20 xl:z-0 print:hidden overflow-y-auto transition-all transform transform-gpu -translate-x-full opacity-0 duration-300 xl:translate-x-0 xl:opacity-100"> | ||
<nav | ||
role="navigation" | ||
class="h-full overflow-y-auto bg-white text-gray-600 pt-8 flex flex-col" | ||
> | ||
<div class="nav-toc flex-1 pl-6"><p class="caption" role="heading"><span class="caption-text">Background</span></p> | ||
<ul> | ||
<li class="toctree-l1"><a class="reference internal" href="../../../intro/linked_data.html">Linked data - What is it and why do we use it?</a></li> | ||
<li class="toctree-l1"><a class="reference internal" href="../../../intro/git.html">Git repositories - Where code lives</a></li> | ||
<li class="toctree-l1"><a class="reference internal" href="../../../intro/tokens.html">Access tokens - Authenticate gimie on your behalf</a><ul> | ||
<li class="toctree-l2"><a class="reference internal" href="../../../intro/tokens.html#encrypting-tokens">Encrypting tokens</a></li> | ||
</ul> | ||
</li> | ||
</ul> | ||
<p class="caption" role="heading"><span class="caption-text">Documentation</span></p> | ||
<ul> | ||
<li class="toctree-l1"><a class="reference internal" href="../../../intro/quickstart.html">Quick start</a></li> | ||
<li class="toctree-l1"><a class="reference internal" href="../../../intro/usage_python.html">Python Usage</a></li> | ||
<li class="toctree-l1"><a class="reference internal" href="../../../api/modules.html">API Documentation</a><ul> | ||
<li class="toctree-l2"><a class="reference internal" href="../../../api/gimie.html">gimie package</a><ul> | ||
<li class="toctree-l3"><a class="reference internal" href="../../../api/gimie.html#subpackages">Subpackages</a></li> | ||
<li class="toctree-l3"><a class="reference internal" href="../../../api/gimie.html#submodules">Submodules</a></li> | ||
<li class="toctree-l3"><a class="reference internal" href="../../../api/gimie.html#module-gimie.cli">gimie.cli module</a></li> | ||
<li class="toctree-l3"><a class="reference internal" href="../../../api/gimie.html#module-gimie.io">gimie.io module</a></li> | ||
<li class="toctree-l3"><a class="reference internal" href="../../../api/gimie.html#module-gimie.models">gimie.models module</a></li> | ||
<li class="toctree-l3"><a class="reference internal" href="../../../api/gimie.html#module-gimie.project">gimie.project module</a></li> | ||
<li class="toctree-l3"><a class="reference internal" href="../../../api/gimie.html#module-gimie">Module contents</a></li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</li> | ||
<li class="toctree-l1"><a class="reference internal" href="../../../cli.html">CLI Documentation</a><ul> | ||
<li class="toctree-l2"><a class="reference internal" href="../../../cli.html#gimie">gimie</a><ul> | ||
<li class="toctree-l3"><a class="reference internal" href="../../../cli.html#gimie"></a></li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
<p class="caption" role="heading"><span class="caption-text">Changelog</span></p> | ||
<ul> | ||
<li class="toctree-l1"><a class="reference internal" href="../../../changelog_link.html">[0.6.0] - 2023-10-19</a><ul> | ||
<li class="toctree-l2"><a class="reference internal" href="../../../changelog_link.html#bug-fixes">Bug Fixes</a></li> | ||
<li class="toctree-l2"><a class="reference internal" href="../../../changelog_link.html#features">Features</a></li> | ||
</ul> | ||
</li> | ||
<li class="toctree-l1"><a class="reference internal" href="../../../changelog_link.html#id2">[0.5.1] - 2023-07-10</a><ul> | ||
<li class="toctree-l2"><a class="reference internal" href="../../../changelog_link.html#id3">Bug Fixes</a></li> | ||
</ul> | ||
</li> | ||
<li class="toctree-l1"><a class="reference internal" href="../../../changelog_link.html#id4">[0.5.0] - 2023-07-04</a><ul> | ||
<li class="toctree-l2"><a class="reference internal" href="../../../changelog_link.html#id5">Bug Fixes</a></li> | ||
<li class="toctree-l2"><a class="reference internal" href="../../../changelog_link.html#documentation">Documentation</a></li> | ||
<li class="toctree-l2"><a class="reference internal" href="../../../changelog_link.html#id6">Features</a></li> | ||
</ul> | ||
</li> | ||
<li class="toctree-l1"><a class="reference internal" href="../../../changelog_link.html#id7">[0.4.0] - 2023-06-09</a><ul> | ||
<li class="toctree-l2"><a class="reference internal" href="../../../changelog_link.html#id8">Bug Fixes</a></li> | ||
<li class="toctree-l2"><a class="reference internal" href="../../../changelog_link.html#id9">Documentation</a></li> | ||
<li class="toctree-l2"><a class="reference internal" href="../../../changelog_link.html#id10">Features</a></li> | ||
</ul> | ||
</li> | ||
<li class="toctree-l1"><a class="reference internal" href="../../../changelog_link.html#id11">[0.3.0] - 2023-02-24</a><ul> | ||
<li class="toctree-l2"><a class="reference internal" href="../../../changelog_link.html#id12">Bug Fixes</a></li> | ||
<li class="toctree-l2"><a class="reference internal" href="../../../changelog_link.html#id13">Documentation</a></li> | ||
<li class="toctree-l2"><a class="reference internal" href="../../../changelog_link.html#id14">Features</a></li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</div> | ||
|
||
<button | ||
data-action="sidebar#close" | ||
title="Close navigation menu" | ||
class="text-4xl text-gray-800 p-4 bottom-0 hover:text-brand xl:hidden focus:text-brand self-center"> | ||
<span class="sr-only">Close navigation menu</span> | ||
<svg aria-hidden="true" class="fill-current stroke-current h-6 w-6" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg> | ||
</button> | ||
</nav> | ||
</aside> | ||
|
||
<main | ||
class="px-4 pt-14 xl:ml-fluid grid-area-main overflow-y-auto flex flex-col flex-1 h-full mx-0 md:mx-auto xl:mr-0" | ||
><nav role="navigation" | ||
aria-label="breadcrumbs" | ||
class="print:hidden mt-12 text-sm text-gray-light"> | ||
<a class="text-gray-light text-sm hover:text-gray-dark font-medium focus:text-gray-dark" href="../../../index.html">gimie 0.6.1 documentation</a> | ||
<span class="mr-1">/</span><a class="text-gray-light text-sm hover:text-gray-dark" href="../../index.html">Module code</a> | ||
<span class="mr-1">/</span><span aria-current="page">gimie.graph.operations</span> | ||
</nav> | ||
|
||
<article role="main" class="flex-1 prose"> | ||
|
||
<h1>Source code for gimie.graph.operations</h1><div class="highlight"><pre> | ||
<span></span><code><span class="c1"># Gimie</span> | ||
<span class="c1"># Copyright 2022 - Swiss Data Science Center (SDSC)</span> | ||
<span class="c1"># A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and</span> | ||
<span class="c1"># Eidgenössische Technische Hochschule Zürich (ETHZ).</span> | ||
<span class="c1">#</span> | ||
<span class="c1"># Licensed under the Apache License, Version 2.0 (the "License");</span> | ||
<span class="c1"># you may not use this file except in compliance with the License.</span> | ||
<span class="c1"># You may obtain a copy of the License at</span> | ||
<span class="c1">#</span> | ||
<span class="c1"># http://www.apache.org/licenses/LICENSE-2.0</span> | ||
<span class="c1">#</span> | ||
<span class="c1"># Unless required by applicable law or agreed to in writing, software</span> | ||
<span class="c1"># distributed under the License is distributed on an "AS IS" BASIS,</span> | ||
<span class="c1"># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span> | ||
<span class="c1"># See the License for the specific language governing permissions and</span> | ||
<span class="c1"># limitations under the License.</span> | ||
<span class="sd">"""Operations on graphs."""</span> | ||
<span class="kn">from</span> <span class="nn">functools</span> <span class="kn">import</span> <span class="n">reduce</span> | ||
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Set</span> | ||
|
||
<span class="kn">from</span> <span class="nn">rdflib</span> <span class="kn">import</span> <span class="n">Graph</span> | ||
<span class="kn">from</span> <span class="nn">rdflib.term</span> <span class="kn">import</span> <span class="n">URIRef</span> | ||
|
||
<span class="kn">from</span> <span class="nn">gimie.graph</span> <span class="kn">import</span> <span class="n">Property</span> | ||
|
||
|
||
<div class="viewcode-block" id="combine_graphs"><a class="viewcode-back" href="../../../api/gimie.graph.html#gimie.graph.operations.combine_graphs">[docs]</a><span class="k">def</span> <span class="nf">combine_graphs</span><span class="p">(</span><span class="o">*</span><span class="n">graphs</span><span class="p">:</span> <span class="n">Graph</span><span class="p">)</span> <span class="o">-></span> <span class="n">Graph</span><span class="p">:</span> | ||
<span class="w"> </span><span class="sd">"""Combines an arbitrary number of input graphs</span> | ||
<span class="sd"> into a single graph."""</span> | ||
<span class="k">return</span> <span class="n">reduce</span><span class="p">(</span><span class="k">lambda</span> <span class="n">g1</span><span class="p">,</span> <span class="n">g2</span><span class="p">:</span> <span class="n">g1</span> <span class="o">|</span> <span class="n">g2</span><span class="p">,</span> <span class="n">graphs</span><span class="p">)</span></div> | ||
|
||
|
||
<div class="viewcode-block" id="properties_to_graph"><a class="viewcode-back" href="../../../api/gimie.graph.html#gimie.graph.operations.properties_to_graph">[docs]</a><span class="k">def</span> <span class="nf">properties_to_graph</span><span class="p">(</span><span class="n">uri</span><span class="p">:</span> <span class="n">URIRef</span><span class="p">,</span> <span class="n">properties</span><span class="p">:</span> <span class="n">Set</span><span class="p">[</span><span class="n">Property</span><span class="p">])</span> <span class="o">-></span> <span class="n">Graph</span><span class="p">:</span> | ||
<span class="w"> </span><span class="sd">"""Attaches a set of predicate-object tuples to input</span> | ||
<span class="sd"> URI to produce an RDF graph."""</span> | ||
<span class="n">g</span> <span class="o">=</span> <span class="n">Graph</span><span class="p">()</span> | ||
<span class="k">for</span> <span class="n">pred</span><span class="p">,</span> <span class="n">obj</span> <span class="ow">in</span> <span class="n">properties</span><span class="p">:</span> | ||
<span class="n">g</span><span class="o">.</span><span class="n">add</span><span class="p">((</span><span class="n">uri</span><span class="p">,</span> <span class="n">pred</span><span class="p">,</span> <span class="n">obj</span><span class="p">))</span> | ||
<span class="k">return</span> <span class="n">g</span></div> | ||
</code></pre></div> | ||
|
||
</article> | ||
|
||
<footer><div class="mt-20 mb-4 text-sm text-gray-700 print:mt-4">© 2023, sdsc-ordes Made with <a class="text-link hover:text-brand focus:text-brand hover:underline focus:underline" href="https://www.sphinx-doc.org">Sphinx 6.2.1</a></div> | ||
</footer></main> | ||
|
||
|
||
<button | ||
data-search-target="snackbar" | ||
data-action="search#hideSnackbar" | ||
class="fixed bottom-0 right-0 z-20 opacity-0 p-4 m-4 tracking-wide bg-gray-900 text-gray-100 transition transform transform-gpu duration-500 translate-y-full" | ||
> | ||
Clear highlights | ||
</button><div | ||
data-sidebar-target="screen" | ||
data-action="click->sidebar#close" | ||
class="fixed hidden inset-0 bg-black bg-opacity-50"> | ||
</div> | ||
</div> | ||
|
||
|
||
<script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script> | ||
<script src="../../../_static/doctools.js"></script> | ||
<script src="../../../_static/sphinx_highlight.js"></script> | ||
<script src="../../../_static/clipboard.min.js"></script> | ||
<script src="../../../_static/copybutton.js"></script> | ||
<script src="../../../_static/design-tabs.js"></script> | ||
<script src="../../../_static/theme.c8991bd7bb6e57cbeea8.js"></script> | ||
|
||
</body> | ||
|
||
</html> |
Oops, something went wrong.