Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting Started Guide #306

Merged
merged 17 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ group :jekyll_plugins do
gem 'jekyll-sitemap'
gem 'jekyll-feed'
gem 'jekyll-seo-tag'
gem 'jekyll-tabs'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
Expand Down
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ GEM
jekyll-sitemap (1.4.0)
jekyll (>= 3.7, < 5.0)
jekyll-swiss (1.0.0)
jekyll-tabs (1.2.1)
jekyll (>= 3.0, < 5.0)
jekyll-theme-architect (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
Expand Down Expand Up @@ -271,6 +273,7 @@ DEPENDENCIES
jekyll-feed
jekyll-seo-tag
jekyll-sitemap
jekyll-tabs
tzinfo-data
webrick (~> 1.7)

Expand Down
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ highlighter: rouge
# theme: minima
plugins:
- jekyll-feed
- jekyll-tabs

defaults:
- scope:
Expand Down
2 changes: 1 addition & 1 deletion _data/nav.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- name: Getting Started
link: /ontology/start.html
link: /ontology/get-started.html
- name: Releases
submenuitems:
- name: Latest Release
Expand Down
2 changes: 2 additions & 0 deletions _includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
<!-- DataTables CSS -->
<link href="/vendor/datatables/datatables.min.css" rel="stylesheet">

<link rel="stylesheet" href="/assets/css/tabs.css">

<!-- Custom fonts for this template -->
<link href="/vendor/fontawesome-free-6.5.1/css/fontawesome.css" rel="stylesheet">
<link href="/vendor/fontawesome-free-6.5.1/css/brands.css" rel="stylesheet">
Expand Down
1 change: 1 addition & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ <h2 class="display-4">
</div>
<div class="container">
{{ content }}
<script src="/assets/js/tabs.js"></script>
</div>
</section>
{% include footer.html %}
22 changes: 22 additions & 0 deletions assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,25 @@ footer.footer {
padding-top: 4rem;
padding-bottom: 4rem;
}

table {
width: 100%;
max-width: 100%;
margin-bottom: 1rem;
background-color: transparent;
border-collapse: collapse;
color: #333;
}

table th {
font-weight: bold;
border-bottom: 2px solid #ccc;
}

table tr {
border-bottom: 1px solid #ccc;
}

pre code {
color: #fff;
}
70 changes: 70 additions & 0 deletions assets/css/tabs.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
.tab {
display: flex;
flex-wrap: wrap;
margin-left: -20px;
padding: 0;
list-style: none;
position: relative;
}

.tab > * {
flex: none;
padding-left: 20px;
position: relative;
}

.tab > * > a {
display: block;
text-align: center;
padding: 9px 20px;
color: #999;
border-bottom: 2px solid transparent;
border-bottom-color: transparent;
font-size: 12px;
text-transform: uppercase;
transition: color .1s ease-in-out;
line-height: 20px;
}

.tab > .active > a {
color:#222;
border-color: #1e87f0;
}

.tab > li > a {
text-decoration: none;
cursor: pointer;
}

.tab-content {
padding: 0;
}

.tab-content > li {
display: none;
}
.tab-content > li.active {
display: block;
}

/* The 2 following blocks can be removed if the script is not configured to show the toast message */
#jekyll-tabs-copy-to-clipboard-message {
visibility: hidden;
min-width: 250px;
margin-left: -125px;
background-color: #333;
color: #fff;
text-align: center;
border-radius: 2px;
padding: 16px;
position: fixed;
z-index: 1;
right: 50%;
bottom: 30px;
}

#jekyll-tabs-copy-to-clipboard-message.show {
visibility: visible;
-webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s;
animation: fadein 0.5s, fadeout 0.5s 2.5s;
}
5 changes: 5 additions & 0 deletions assets/js/tabs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ <h1 class="mb-5">
><i class="fa-solid fa-circle-nodes text-primary"></i
></a>
</div>
<a href="/ontology/start.html"><h3>CDO</h3></a>
<a href="/ontology/get-started.html"><h3>CDO</h3></a>
<p class="lead mb-0">Learn about CASE's parent organization.</p>
</div>
</div>
Expand Down
4 changes: 4 additions & 0 deletions ontology/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
get-started-example-*.md
get-started-example-*.nt
get-started-example-*.rdf
get-started-example-*.ttl
105 changes: 102 additions & 3 deletions ontology/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ all: \

.PHONY: \
check-develop \
check-unstable
check-unstable \
get-started-resources

CASE-develop.ttl: \
$(top_srcdir)/dependencies/CASE-develop.ttl \
Expand Down Expand Up @@ -84,7 +85,8 @@ CASE-unstable-2.0.0.ttl: \
check: \
check-develop \
check-unstable \
check-unstable-2.0.0
check-unstable-2.0.0 \
get-started-resources

check-develop: \
CASE-develop.ttl
Expand All @@ -110,4 +112,101 @@ check-unstable-2.0.0: \
clean:
@rm -f \
CASE-develop*.ttl \
CASE-unstable*.ttl
CASE-unstable*.ttl \
get-started-example-*.md \
get-started-example-*.nt \
get-started-example-*.rdf \
get-started-example-*.ttl

# This target generates some of the result snippets that were manually
# copied into get-started.md. "make check" depends on this to confirm
# the examples will rebuild.
get-started-resources: \
get-started-example-minimal.nt \
get-started-example-minimal.rdf \
get-started-example-minimal.ttl \
get-started-example-location.nt \
get-started-example-location.rdf \
get-started-example-location.ttl \
get-started-example-location.md

get-started-example-location.md: \
$(top_srcdir)/.venv.done.log \
get-started-example-location.jsonld \
get-started-example-location-query.sparql
source $(top_srcdir)/venv/bin/activate \
&& case_sparql_select \
_$@ \
get-started-example-location-query.sparql \
get-started-example-location.jsonld
mv _$@ $@

get-started-example-location.nt: \
get-started-example-location.jsonld \
$(top_srcdir)/.venv.done.log
source $(top_srcdir)/venv/bin/activate \
&& rdfpipe \
--output-format nt \
$< \
> __$@
LC_ALL=C \
sort \
__$@ \
> _$@
rm __$@
mv _$@ $@

get-started-example-location.rdf: \
get-started-example-location.jsonld \
$(top_srcdir)/.venv.done.log
source $(top_srcdir)/venv/bin/activate \
&& rdfpipe \
--output-format xml \
$< \
> _$@
mv _$@ $@

get-started-example-location.ttl: \
get-started-example-location.jsonld \
$(top_srcdir)/.venv.done.log
source $(top_srcdir)/venv/bin/activate \
&& rdfpipe \
--output-format turtle \
$< \
> _$@
mv _$@ $@

get-started-example-minimal.nt: \
get-started-example-minimal.jsonld \
$(top_srcdir)/.venv.done.log
source $(top_srcdir)/venv/bin/activate \
&& rdfpipe \
--output-format nt \
$< \
> __$@
LC_ALL=C \
sort \
__$@ \
> _$@
rm __$@
mv _$@ $@

get-started-example-minimal.rdf: \
get-started-example-minimal.jsonld \
$(top_srcdir)/.venv.done.log
source $(top_srcdir)/venv/bin/activate \
&& rdfpipe \
--output-format xml \
$< \
> _$@
mv _$@ $@

get-started-example-minimal.ttl: \
get-started-example-minimal.jsonld \
$(top_srcdir)/.venv.done.log
source $(top_srcdir)/venv/bin/activate \
&& rdfpipe \
--output-format turtle \
$< \
> _$@
mv _$@ $@
24 changes: 24 additions & 0 deletions ontology/get-started-example-location-query.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
PREFIX uco-location: <https://ontology.unifiedcyberontology.org/uco/location/>
PREFIX uco-core: <https://ontology.unifiedcyberontology.org/uco/core/>

SELECT ?lStreet ?lLatitude ?lLongitude
WHERE
{
?nLocation a uco-location:Location .

OPTIONAL {
?nLocation uco-core:hasFacet ?nSimpleAddressFacet .
?nSimpleAddressFacet a uco-location:SimpleAddressFacet .
OPTIONAL { ?nSimpleAddressFacet uco-location:street ?lStreet . }
}

OPTIONAL {
?nLocation uco-core:hasFacet ?nLatLongCoordinatesFacet .
?nLatLongCoordinatesFacet
a uco-location:LatLongCoordinatesFacet ;
uco-location:latitude ?lLatitude ;
uco-location:longitude ?lLongitude ;
.
}
}
ORDER BY ?lStreet
51 changes: 51 additions & 0 deletions ontology/get-started-example-location.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"@context": {
"@vocab": "http://example.org/local#",
"kb": "http://example.org/kb/",
"uco-core": "https://ontology.unifiedcyberontology.org/uco/core/",
"uco-location": "https://ontology.unifiedcyberontology.org/uco/location/",
"xsd": "http://www.w3.org/2001/XMLSchema#"
},
"@graph": [
{
"@id": "kb:location-4511219e-a924-4ba5-aee7-dfad5a2c9c05",
"@type": "uco-location:Location",
"uco-core:hasFacet": [
{
"@id": "kb:simple-address-facet-59334948-00b9-4370-85b0-4dc8e07f5384",
"@type": "uco-location:SimpleAddressFacet",
"uco-location:locality": "Seattle",
"uco-location:region": "WA",
"uco-location:postalCode": "98052",
"uco-location:street": "20341 Whitworth Institute 405 N. Whitworth"
}
]
},
{
"@id": "kb:location-b579264d-6e30-4055-bf9b-72390364f224",
"@type": "uco-location:Location",
"uco-core:hasFacet": [
{
"@id": "kb:simple-address-facet-258f169e-1e9c-4936-ba65-eed0f0c60788",
"@type": "uco-location:SimpleAddressFacet",
"uco-location:locality": "Paris",
"uco-location:country": "France",
"uco-location:postalCode": "F-75002",
"uco-location:street": "38 Bad Guy Headquarters st."
},
{
"@id": "kb:lat-long-coordinates-facet-36126f9c-0273-48fe-ad4d-6a4e2848458f",
"@type": "uco-location:LatLongCoordinatesFacet",
"uco-location:latitude": {
"@type": "xsd:decimal",
"@value": "48.860346"
},
"uco-location:longitude": {
"@type": "xsd:decimal",
"@value": "2.331199"
}
}
]
}
]
}
10 changes: 10 additions & 0 deletions ontology/get-started-example-minimal.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"@context": {
"kb": "http://example.org/kb/",
"uco-location": "https://ontology.unifiedcyberontology.org/uco/location/"
},
"@graph": {
"@id": "kb:location-4511219e-a924-4ba5-aee7-dfad5a2c9c05",
"@type": "uco-location:Location"
}
}
Loading
Loading