Skip to content

Commit a91c148

Browse files
authored
Merge pull request #13 from blue-core-lod/bc-branding
Blue Core Logo and Color Scheme
2 parents 30d9237 + 0f511ee commit a91c148

File tree

13 files changed

+181
-10900
lines changed

13 files changed

+181
-10900
lines changed

.github/workflows/static.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Simple workflow for deploying static content to GitHub Pages
2+
name: Deploy static content to Pages
3+
4+
on:
5+
# Runs on pushes targeting the default branch
6+
push:
7+
branches: ["main"]
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20+
concurrency:
21+
group: "pages"
22+
cancel-in-progress: false
23+
24+
jobs:
25+
# Single deploy job since we're just deploying
26+
deploy:
27+
environment:
28+
name: github-pages
29+
url: ${{ steps.deployment.outputs.page_url }}
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
- name: Setup Pages
35+
uses: actions/configure-pages@v5
36+
- name: Upload artifact
37+
uses: actions/upload-pages-artifact@v3
38+
with:
39+
# Upload entire repository
40+
path: '.'
41+
- name: Deploy to GitHub Pages
42+
id: deployment
43+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
*__pycache__*
1+
*__pycache__*
2+
3+
*swp

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

README.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1-
# Graph Explorer
2-
Proof-of-concept for loading [Sinopia](https://sinopia.io) RDF by selecting
3-
groups or individual resources. You can then run SPARQL queries againest the loaded RDF graph.
1+
# Blue Core Graph Explorer
2+
Web Application for loading and manipulating [Blue Core](https://bcld.info) RDF.
43

5-
Web application published with Github pages and is available at [https://ld4p.github.io/graph-explorer/](https://ld4p.github.io/graph-explorer/).
4+
Web application published with Github pages and is available at
5+
[https://blue-core-lod.github.io/graph-explorer](https://blue-core-lod.github.io/graph-explorer).
66

7-
Through [Pyscript](https://pyscript.net/), the [rdflib](https://rdflib.readthedocs.io/en/stable/) Python package is used for loading RDF through Sinopia.
7+
Through [Pyscript](https://pyscript.net/), the [rdflib](https://rdflib.readthedocs.io/en/stable/) Python package is used
8+
for loading RDF through Blue Core.
9+
10+
## Existing and Planned Functionality
11+
- Run SPARQL queries on one or more Blue Core Resources
12+
- Download RDF in various serializations like Turtle, XML/RDF, and json-ld
13+
- Chat with Blue Core AI Agents
14+
- Import and convert MARC to Blue Core BIBFRAME Resources
15+
- Export Blue Core Constrained Bound Descriptions (CBD) to
16+
MARC21 records

index.html

Lines changed: 40 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,31 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<title>Sinopia Linked Data - Graph Explorer</title>
5-
<link rel="stylesheet" href="https://pyscript.net/releases/2024.11.1/core.css" />
4+
<title>Blue Core - Graph Explorer</title>
5+
6+
<link rel="stylesheet" href="https://pyscript.net/releases/2025.5.1/core.css" />
7+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.6/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-4Q6Gf2aSP4eDXB8Miphtr37CMZZQ5oXLH2yaXMJ2w8e2ZtHTl7GptT4jmndRuHDT" crossorigin="anonymous">
68
<link href="static/css/main.css" rel="stylesheet" />
7-
<link href="static/css/header.css" rel="stylesheet" />
89
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.3/font/bootstrap-icons.css">
910
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
10-
<script type="module" src="https://pyscript.net/releases/2024.11.1/core.js"></script>
11+
<script type="module" src="https://pyscript.net/releases/2025.5.1/core.js"></script>
1112
<style>
1213
strong {
1314
font-weight: 800;
1415
}
1516
</style>
1617
</head>
17-
<body>
18-
<div class="editor-navbar">
19-
<h3>Linked-Data for Production</h3>
20-
<h1>Graph Explorer with Sinopia Linked Data</h1>
18+
<body class="container">
19+
<div class="editor-navbar row">
20+
<div class="col-4">
21+
<img src="static/img/blue-core-v1.svg" class="float-start" alt="Blue Core Label" style="height: 100px">
22+
</div>
23+
<div class="col-8">
24+
<h1>Graph Explorer, Management &amp; Batch Handling</h1>
2125
<h4>Version <span id="version" ></span></h4>
26+
</div>
2227
</div>
23-
<div class="float-end sticky-top">
28+
<div class="float-end sticky-top" style="background-color: rgb(255,255,255)">
2429
<button class="btn btn-outline-success" data-bs-toggle="modal" data-bs-target="#graph-repl-modal">
2530
<img width="64" alt="Python-logo-notext" src="./static/img/python-repl.svg">
2631
</button>
@@ -61,9 +66,7 @@ <h4>Version <span id="version" ></span></h4>
6166
<div class="tab-pane fade show active" id="load" role="tabpanel" aria-labelledby="home-tab">
6267
<div class="container">
6368
<div id="intro">
64-
## Load RDF
65-
66-
Environments and Groups
69+
<h2>Login &amp; Load Options</h2>
6770
</div>
6871
<div class="row">
6972
<div class="col">
@@ -82,10 +85,15 @@ <h4>Version <span id="version" ></span></h4>
8285
<label for="https://api.sinopia.io/" class="form-check-label">Production</label>
8386
</input>
8487
</div>
85-
<button class="btn btn-primary btn-lg" py-click="build_graph">
86-
<i class="spinner-border d-none" id="graph-loading-status"></i>
87-
Build Graph
88-
</button>
88+
<div class="btn-group" role="group" aria-label="Basic Actions">
89+
<button class="btn btn-primary btn-lg" py-click="bluecore_login">
90+
<span id="login-action">Login</span>
91+
</button>
92+
<button class="btn btn-primary btn-lg" py-click="build_graph">
93+
<i class="spinner-border d-none" id="graph-loading-status"></i>
94+
Build Graph
95+
</button>
96+
</div>
8997
</div>
9098
<div class="col">
9199
<h4>Groups</h4>
@@ -107,10 +115,11 @@ <h4>Individual Resources</h4>
107115
<div class="tab-pane fade" id="graph-summary" role="tabpanel" aria-labelledby="profile-tab">
108116
<div class="container">
109117
<div id="bf-work-instance-item-rdf">
110-
## Graph Summary
111-
The [Sinopia API](https://github.com/ld4p/sinopia_api) is used to construct a small
112-
RDF graph and then create a knowledge graph for analysis and visualization of the entities
113-
along with their properties.
118+
<h2>Graph Summary</h2>
119+
<p>
120+
Summary of graph loaded from the
121+
<a href="https://github.com/blue-core-lod/bluecore_api/">Blue Core API</a>
122+
</p>
114123
</div>
115124
<div class="row">
116125
<div class="col">
@@ -122,7 +131,7 @@ <h4>Individual Resources</h4>
122131
<div class="tab-pane fade" id="sparql" role="tabpanel" aria-labelledby="contact-tab">
123132
<div class="container">
124133
<div id="sparql-summary">
125-
## SPARQL
134+
<h2>SPARQL</h2>
126135

127136
</div>
128137
<div class="row">
@@ -136,15 +145,15 @@ <h4>Individual Resources</h4>
136145
</div>
137146
</div>
138147
</div>
139-
148+
140149
<footer>
141150
<p xmlns:cc="http://creativecommons.org/ns#" >
142151
Version <span id="footer-version"></span>. Documentation is licensed under
143152
<a href="http://creativecommons.org/licenses/by/4.0/?ref=chooser-v1"
144153
target="_blank"
145154
rel="license noopener noreferrer" style="display:inline-block;">Creative Commons Attribution 4.0 International</a>.
146155
Source code licensed under <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache 2</a> and available
147-
at <a href="https://github.com/LD4P/graph-explorer">https://github.com/LD4P/graph-explorer</a>
156+
at <a href="https://github.com/blue-core-lod/graph-explorer">https://github.com/blue-core-lod/graph-explorer</a>
148157
</p>
149158
</footer>
150159

@@ -158,11 +167,14 @@ <h5 class="modal-title" id="graph-repl-modal-title">Graph Explorer - Python REPL
158167
<div class="modal-body">
159168
<div class="sticky-top py-3 bg-light">
160169
<div id="err-div" class="bg-red text-blue text-center border-t-4"></div>
161-
<py-repl id="graph-repl" auto-generate="true" std-out="output" std-err="err-div">print("Hello")</py-repl>
162-
<div id="output" class="p-4"></div>
163-
<div id="err-div"></div>
170+
<script type="py" id="repl" terminal worker>
171+
import code
172+
173+
code.interact()
174+
</script>
175+
<div id="output" class="p-4"></div>
176+
<div id="err-div"></div>
164177
</div>
165-
<py-terminal></py-terminal>
166178
</div>
167179
</div>
168180
<div class="modal-footer">
@@ -189,13 +201,6 @@ <h5 class="modal-title">Graph Explorer Initialization</h5>
189201
</div>
190202
</div>
191203
</div>
192-
193-
<script>
194-
document.addEventListener('DOMContentLoaded', function () {
195-
var myModal = new bootstrap.Modal('#splashModal', {});
196-
myModal.show();
197-
});
198-
</script>
199-
<script type="py" src="./main.py" config="./pyconfig.json"></script>
204+
<script type="py" src="./main.py" config="./pyconfig.json"></script>
200205
</body>
201206
</html>

main.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "1.1.0"
1+
__version__ = "1.0.0"
22
import asyncio
33
import sys
44
import js
@@ -13,23 +13,12 @@
1313
BIBFRAME = rdflib.Namespace("http://id.loc.gov/ontologies/bibframe/")
1414
SINOPIA = rdflib.Namespace("http://sinopia.io/vocabulary/")
1515

16+
from helpers import bluecore_login
1617
from sinopia_api import show_groups
1718
from load_rdf import bibframe_sparql as bf_sparql_widget, build_graph, download_graph
1819
from query_rdf import download_query_results, run_query
1920

2021

21-
async def load_content():
22-
for element_id in [
23-
"intro",
24-
"retrieve-rdf",
25-
"bf-work-instance-item-rdf",
26-
"sparql-summary",
27-
]:
28-
await helpers.render_markdown(element_id)
29-
30-
31-
asyncio.ensure_future(load_content())
32-
3322
bf_sparql_widget("bf-sparql-query")
3423

3524
helpers.set_versions(__version__)

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[project]
2+
name = "blue-core-graph-explorer"
3+
version = "0.1.0"
4+
description = "Blue Core fork of LD4P Graph Explorer"
5+
readme = "README.md"
6+
requires-python = ">=3.12"
7+
dependencies = []

src/helpers.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
import js
22
import markdown
33

4-
from js import document
4+
from js import document, console
55

66

7+
async def bluecore_login(event):
8+
console.log(f"Starting Blue Core Login")
9+
10+
11+
712
def set_versions(version):
813
version_element = document.getElementById("version")
914
footer_version = document.getElementById("footer-version")
@@ -29,3 +34,4 @@ def run_step_01(event):
2934
output.innerHTML = f"sinopia_urls has ${len(sinopia_stage_urls)}"
3035
except Exception as e:
3136
output.innerHTML = f"Error {e} loading {stage_urls.value}"
37+

static/css/header.css

Lines changed: 0 additions & 32 deletions
This file was deleted.

static/css/header.css.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)