Skip to content

Commit

Permalink
Aligning with upstream.
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-brandizi committed Aug 18, 2023
1 parent 86a6154 commit 803b952
Show file tree
Hide file tree
Showing 16 changed files with 371 additions and 104 deletions.
64 changes: 46 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,59 @@
# Linked Data Browser at Knetminer/Data
# Knetminer/Lodestar, Linked Data Browser at Knetminer/Data

*This branch is to manage a LODEStar version of [Knetminer Data Site](https://knetminer.org/data). You find more explanations on that web site. The original LODEStar text follows below.*

# Lodestar

Lodestar is a Linked Data Browser and SPARQL endpoint. Lodestar is a Java based web app that can wrap any existing SPARQL endpoint to provide a set of additional SPARQL and Linked Data services. Lodestar was developed to provide a consistent set of SPARQL and Linked Data services across the European Bioinformatics Institute (EBI). Some of the service provided by Lodestar:

* Javascript based SPARQL endpoint with configurable example queries and paginated results table
* Read only SPARQL endpoint for protection from write operations
* A single SPARQL endpoint that provides a UI, the service and a SPARQL 1.1 service description
* SPARQL syntax highlighting provided by CodeMirror
* Works with any SPARQL endpoint (Includes Virtuoso JDBC connection option)
* Linked data browser for navigating data from a SPARQL endpoint
* Configurable resource description/linked data pages:
* Renders resources by label where possible
* Grouping of related resource by type
* Set top facts to display, such as labels and descriptions
* Configurable limits for how many related resources to render in the browser
* Renders depictions of resources
* Handles content negotiation for both SPARQL queries and linked data pages
* CORS enabled for cross domain scripting
* Basic REST API for accessing data in simplified JSON format
- Javascript based SPARQL endpoint with configurable example queries and paginated results table
- Read only SPARQL endpoint for protection from write operations
- A single SPARQL endpoint that provides a UI, the service and a SPARQL 1.1 service description
- SPARQL syntax highlighting provided by CodeMirror
- Works with any SPARQL endpoint (Includes Virtuoso JDBC connection option)
- Linked data browser for navigating data from a SPARQL endpoint
- Configurable resource description/linked data pages:
- Renders resources by label where possible
- Grouping of related resource by type
- Set top facts to display, such as labels and descriptions
- Configurable limits for how many related resources to render in the browser
- Renders depictions of resources
- Handles content negotiation for both SPARQL queries and linked data pages
- CORS enabled for cross domain scripting
- Basic REST API for accessing data in simplified JSON format

To see a demonstration of the Lodestar linked data browser please see the [Expression Atlas RDF website](http://www.ebi.ac.uk/rdf/services/atlas/sparql). Lodestar has been primarily developed as an internal tool for EBI services deploying RDF, however, the application should be sufficiently generic that others can use it. I can't guarantee any support for the software at this time, but please feel free to use it or adapt for your own purposes and let me know how you get on.

Documentation and stable release at http://ebispot.github.io/lodestar/.
Documentation and stable release at [http://ebispot.github.io/lodestar/](http://ebispot.github.io/lodestar/).

## Release Notes

See the [revision history file](revision-history.md).

## Testing the Knetminer branch locally

To test locally, ensure you are on the `knetminer-httpsparql` branch. Follow the steps below:

1. Clone the repository (or checkout knetminer-httpsparql):
`git clone -b knetminer-httpsparql https://github.com/Rothamsted/knetminer-lodestar`
2. Navigate to the test-utils directory:
`cd knetminer-lodestar/test-utils`
3. Run the build script:
`./build-n-run-test.sh`

After the build is successful, you can access the application at localhost:8080. Here are the sites to check:

- http://localhost:8080/
- http://localhost:8080/sparql
- http://localhost:8080/describe

As it is common, the describe endpoint shows a subject-centric description of a resource, given its URI. For example:

- http://localhost:8080/describe?uri=http%3A%2F%2Fknetminer.org%2Fdata%2Frdf%2Fresources%2Fpublication_23105158

Links like this are created in the SPARQL query results, when your query returns a URI.
For instance, try [one of the GXA examples][GXA-EX-1], and then click links under the 'gene' or 'study' column.

[GXA-EX-1]: http://localhost:8080/sparql?query=PREFIX+bk%3A+%3Chttp%3A%2F%2Fknetminer.org%2Fdata%2Frdf%2Fterms%2Fbiokno%2F%3E%09PREFIX+bkr%3A+%3Chttp%3A%2F%2Fknetminer.org%2Fdata%2Frdf%2Fresources%2F%3E%0D%0APREFIX+bka%3A+%3Chttp%3A%2F%2Fknetminer.org%2Fdata%2Frdf%2Fterms%2Fbiokno%2Fattributes%2F%3E%09PREFIX+bkg%3A+%3Chttp%3A%2F%2Fknetminer.org%2Fdata%2Frdf%2Fresources%2Fgraphs%2F%3E%0D%0APREFIX+rdf%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E%09PREFIX+rdfs%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0D%0APREFIX+owl%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2002%2F07%2Fowl%23%3E%09PREFIX+dc%3A+%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%3E%0D%0APREFIX+dcterms%3A+%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%09PREFIX+agri%3A+%3Chttp%3A%2F%2Fagrischemas.org%2F%3E%0D%0APREFIX+bioschema%3A+%3Chttp%3A%2F%2Fbioschemas.org%2F%3E%09PREFIX+schema%3A+%3Chttp%3A%2F%2Fschema.org%2F%3E%0D%0A%0D%0A%0D%0ASELECT+%3Fgene+%3FgeneAcc+%3FcondLabel+%3FstudyTitle+%3Fstudy+%3Fpub+%3FpubTitle+%3FpubYear+%3FcondTerm+%0D%0A%7B%0D%0A%09%3Fgene+a+bk%3AGene%3B%0D%0A%09%09dcterms%3Aidentifier+%3FgeneAcc.%0D%0A%09%09%0D%0A%09%3Fgene+bioschema%3AexpressedIn+%3Fcondition.%0D%0A%09%09%0D%0A%09%3FexpStatement+a+rdfs%3AStatement%3B%0D%0A%09%09rdf%3Asubject+%3Fgene%3B%0D%0A%09%09rdf%3Apredicate+bioschema%3AexpressedIn%3B%0D%0A%09%09rdf%3Aobject+%3Fcondition%3B%0D%0A%09%09agri%3Aevidence+%3Fstudy.%0D%0A%0D%0A%09%3Fgene+bk%3Aocc_in+%3Fpub.%0D%0A%09%09%0D%0A%09%3Fpub+a+bk%3APublication%3B%0D%0A%09%09bka%3AAbstractHeader+%3FpubTitle.%0D%0A%09OPTIONAL+%7B+%3Fpub+bka%3AYEAR+%3FpubYear+%7D%0D%0A%09%09%09%0D%0A%09%3Fcondition+schema%3Aname+%3FcondLabel.%0D%0A%09OPTIONAL+%7B+%3Fcondition+dc%3Atype+%3FcondTerm.+%7D%0D%0A%09%09%0D%0A%09%3Fstudy+%0D%0A%09%09dc%3Atitle+%3FstudyTitle%3B%0D%0A%7D%0D%0AORDER+BY+%3Fstudy+%3Fgene%0D%0A&render=HTML&limit=25&offset=0#loadstar-results-section



30 changes: 28 additions & 2 deletions revision-history.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,35 @@
# Revision History

*This file was last reviewed on 2023-02-16.* **Please, keep this note updated.**
*This file was last reviewed on 2023-08-18.* **Please, keep this note updated.**

## 2.0.2-SNAPSHOT
* Current snapshot

Visual overhaul to Index, Explorer and Resource description pages. Details below.

### Home page & general
* Updated README to include 'Testing Locally' section for developers
* Added new banners to all pages
* Updated fonts throughout to use Nexa, the KnetMiner standard
* Added navbar to all main HTML pages
* Updated license terms
* Updated all URLs on index
* Modernised scrollbars
* Improved tab/page titles
* Added Favicon to all major HTML pages

### Explorer page
* Widened Explorer's Query box (reducing sample query space)
* Lengthened Explorer's Query box by 50px
* Reduced width of Results per page selector - moved it in line with Output dropdown
* Added 200 & 500 to Results per page selector
* Modernised buttons, added color
* Added increased padding around page

### Resource Description page
* Widened About paragraph to have wider maxwidth
* Updated H2 color to be KnetMiner green
* Improved padding on outer edges


## 2.0.1-KNM
* Minor improvements to the splash page text and layout.
Expand Down
26 changes: 23 additions & 3 deletions web-ui/src/main/webapp/codemirror/codemirror.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* BASICS */

.CodeMirror {
/* Set height, width, borders, and global font properties here */
font-family: monospace;
height: 300px;
/* height of the sparql query container */
font-family: 'Nexa';
height: 350px;
color: black;
}

Expand Down Expand Up @@ -339,3 +339,23 @@ div.CodeMirror-dragcursors {

/* Help users use markselection to safely style text background */
span.CodeMirror-selectedtext { background: none; }

/* Scrollbar (modernised) - For Webkit browsers like Chrome, Safari */
::-webkit-scrollbar {
width: 10px; /* Width of the vertical scrollbar */
height: 10px; /* Height of the horizontal scrollbar */
}

::-webkit-scrollbar-track {
background: #f1f1f1; /* Color of the track */
border-radius: 10px; /* Round corners of the track */
}

::-webkit-scrollbar-thumb {
background: #888; /* Color of the thumb */
border-radius: 10px; /* Round corners of the thumb */
}

::-webkit-scrollbar-thumb:hover {
background: #555; /* Color of the thumb when hovered */
}
2 changes: 1 addition & 1 deletion web-ui/src/main/webapp/css/foundation.min.css

Large diffs are not rendered by default.

185 changes: 158 additions & 27 deletions web-ui/src/main/webapp/css/knetgraph.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.very-light-green-box {
.very-light-green-box-padded {
background-color: #e5f8eb;
width: 99%;
width: 95%;
padding: 10px;
margin: 10px auto;
}
.very-light-green-box-padded {
.very-light-green-box {
background-color: #e5f8eb;
width: 95%;
width: 99%;
padding: 10px;
margin: 10px auto;
}
Expand All @@ -27,32 +27,163 @@
align-items: center;
justify-content: center;
}
.banner_explore {
display: flex;
align-items: center;
justify-content: center;
padding-bottom: 40px;
}
img {
max-width: 96%;
}

.navbar {

display:block;
height:54px;
display: flex;
align-items: center !important; /* This will vertically center items */
justify-content: space-between; /* This will keep logo to the left and links to the right */
height: 54px;
-webkit-box-shadow: rgb(99 97 97 / 45%) 0px 25px 20px -20px;
box-shadow: rgb(99 97 97 / 45%) 0px 25px 20px -20px; background-color:#ffffff/*#2A2A2A*/;
margin-bottom:40px;
width:100%;

}
ul.nav {
float:right;
list-style:none;
}
ul {
font-size:19px;
}
.nav a {
color: #6F7F8F;
text-decoration: none;
padding-right: 30px;
}
.nav a:hover{
color:#51CE7B;
}
box-shadow: rgb(99 97 97 / 45%) 0px 25px 20px -20px;
background-color: #ffffff;
margin-bottom: 40px;
width: 100%;
padding: 0 20px; /* Added some padding to give some space on the sides */
}

ul.nav {
display: flex; /* This makes the list items line up horizontally */
list-style: none;
margin: 0; /* Remove default margin */
padding: 0; /* Remove default padding */
}

ul {
font-size: 19px;
font-family: 'Nexa'; /* Set font-family for ul */
}

.nav a {
color: #6F7F8F;
text-decoration: none;
padding-right: 30px;
}

.nav a:hover {
color: #51CE7B;
}

.navbar img.logo-top {
max-width: 168px;
height: auto;
}
.logo-top {
vertical-align: middle;
}
*, *:before, *:after {
box-sizing: border-box;
}
/* Base Button Style submit query */
.lode-button {
display: inline-block;
padding: 10px 20px;
font-size: 16px;
font-weight: bold;
text-align: center;
text-decoration: none;
border-radius: 5px;
transition: background-color 0.3s, transform 0.3s;
cursor: pointer;
border: 2px solid rgb(81,206,123);
background-color: rgb(81,206,123);
color: #fff;
margin-right: 10px; /* spacing between buttons */
}

/* Hover State */
.lode-button:hover {
background-color: rgb(28, 147, 68);
}

/* Active State */
.lode-button:active {
transform: scale(0.98);
}

/* Adding a shadow */
.lode-button {
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
/* Base Button Style reset */
.lode-button-reset {
display: inline-block;
padding: 10px 20px;
font-size: 16px;
font-weight: bold;
text-align: center;
text-decoration: none;
border-radius: 5px;
transition: background-color 0.3s, transform 0.3s;
cursor: pointer;
border: 2px solid #F34A4A;
background-color: #F34A4A;
color: #fff;
margin-right: 10px; /* spacing between buttons */
}

/* Hover State */
.lode-button-reset:hover {
background-color: #741c1c;
}

/* Active State */
.lode-button-reset:active {
transform: scale(0.98);
}

/* Adding a shadow */
.lode-button-reset {
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
#data-explorer-content.grid_24 {
width: 100%;
float: none;
}
/*Data explorer (describe html) padding along sides */
#data-explorer-content {
padding-left: 40px;
padding-right: 40px;
padding-bottom: 20px;
}
#data-explorer-content h3 {
color: rgb(81,206,123);
}
#limit, #render {
width: 150px;
}
.dropdown-container {
display: flex;
align-items: left;
}
.dropdown-container > p {
margin: 0;
padding: 0 10px;
}
/* Scrollbar For Webkit browsers like Chrome, Safari */
::-webkit-scrollbar {
width: 10px; /* Width of the vertical scrollbar */
height: 10px; /* Height of the horizontal scrollbar */
}

::-webkit-scrollbar-track {
background: #f1f1f1; /* Color of the track */
border-radius: 10px; /* Round corners of the track */
}

::-webkit-scrollbar-thumb {
background: #888; /* Color of the thumb */
border-radius: 10px; /* Round corners of the thumb */
}

::-webkit-scrollbar-thumb:hover {
background: #555; /* Color of the thumb when hovered */
}
15 changes: 13 additions & 2 deletions web-ui/src/main/webapp/css/lode-style.css
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ span.pagmes {

#lodestar-sparql-form {
font-size: 100%;
font-family: Helvetica,sans-serif;
font-family: 'Nexa';
color: black;
}

Expand All @@ -69,10 +69,21 @@ span.pagmes {
}

.lodestar-grid12 {
width: 49.0%;
width: 75%;
display: inline;
float: left;
position: relative;
margin-right: 10px;
}

#example_queries {
width: 20%;
display: inline;
float: left;
position: relative;
}


ul {
font-family: 'Nexa';
}
Loading

0 comments on commit 803b952

Please sign in to comment.