Skip to content
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
12 changes: 12 additions & 0 deletions docs/other/ontology/publication.shacl.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,18 @@ ga:ProjectCardPresentationShape a sh:NodeShape ;
ga:PageResourceSectionShape a sh:NodeShape ; sh:targetSubjectsOf ga:resourceSection ;
sh:property [ sh:path ga:resourceSection ; sh:datatype xsd:string ; sh:maxCount 32 ; sh:minLength 1 ; sh:maxLength 128 ; sh:pattern "^[\\p{L}\\p{N}_-]+$" ] .

ga:PageCalloutSectionShape a sh:NodeShape ; sh:targetSubjectsOf ga:calloutSection ;
sh:property [ sh:path ga:calloutSection ; sh:datatype xsd:string ; sh:maxCount 32 ; sh:minLength 1 ; sh:maxLength 128 ; sh:pattern "^[\\p{L}\\p{N}_-]+$" ] .

ga:PageTermSectionShape a sh:NodeShape ; sh:targetSubjectsOf ga:termSection ;
sh:property [ sh:path ga:termSection ; sh:datatype xsd:string ; sh:maxCount 32 ; sh:minLength 1 ; sh:maxLength 128 ; sh:pattern "^[\\p{L}\\p{N}_-]+$" ] .

ga:PageCompactSectionShape a sh:NodeShape ; sh:targetSubjectsOf ga:compactSection ;
sh:property [ sh:path ga:compactSection ; sh:datatype xsd:string ; sh:maxCount 32 ; sh:minLength 1 ; sh:maxLength 128 ; sh:pattern "^[\\p{L}\\p{N}_-]+$" ] .

ga:GeneratorCreditShape a sh:NodeShape ; sh:targetSubjectsOf ga:generatorCredit ;
sh:property [ sh:path ga:generatorCredit ; sh:datatype xsd:boolean ; sh:maxCount 1 ] .

ga:PageHeroShape a sh:NodeShape ; sh:targetSubjectsOf ga:heroKind ;
sh:property [ sh:path ga:heroKind ; sh:datatype xsd:string ; sh:maxCount 1 ; sh:in ("landing" "introduction") ] .

Expand Down
13 changes: 13 additions & 0 deletions docs/other/ontology/publication.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -1840,6 +1840,10 @@ ga:timelineStatus a owl:ObjectProperty ; rdfs:label "timeline status"@en ; rdfs:
ga:statusLabel a owl:DatatypeProperty ; rdfs:label "status label"@en ; rdfs:isDefinedBy <https://ekgf.org/ontology/grapharch> ; skos:definition "Names a timeline status exactly as timeline items write it."@en ; dct:description "Names a timeline status exactly as timeline items write it."@en ; rdfs:domain rdfs:Resource ; rdfs:range xsd:string .
ga:eyebrow a owl:DatatypeProperty ; rdfs:label "eyebrow"@en ; rdfs:isDefinedBy <https://ekgf.org/ontology/grapharch> ; skos:definition "Supplies the short label shown above the title of a generated page."@en ; dct:description "Supplies the short label shown above the title of a generated page."@en ; rdfs:domain ga:DocumentorUse ; rdfs:range xsd:string .

ga:calloutSection a owl:DatatypeProperty ; rdfs:label "callout section"@en ; rdfs:isDefinedBy <https://ekgf.org/ontology/grapharch> ; skos:definition "Selects a level-two heading anchor whose section is presented as a call-to-action band on the theme's accent colour."@en ; dct:description "Selects a level-two heading anchor whose section is presented as a call-to-action band on the theme's accent colour."@en ; rdfs:domain ga:Page ; rdfs:range xsd:string ; skos:scopeNote "The band keeps the section's heading, prose, list and links-only action row. The first actions are solid and a final one of several is outlined."@en .
ga:termSection a owl:DatatypeProperty ; rdfs:label "term section"@en ; rdfs:isDefinedBy <https://ekgf.org/ontology/grapharch> ; skos:definition "Selects a level-two heading anchor whose level-three cards are presented as a term/definition list."@en ; dct:description "Selects a level-two heading anchor whose level-three cards are presented as a term/definition list."@en ; rdfs:domain ga:Page ; rdfs:range xsd:string ; skos:scopeNote "Each level-three heading is a term, shown in its card presentation's tone. A following paragraph that is wholly strong text is the term's expansion beneath it; the rest of the card is its definition beside it. A term heading that is one link makes the row that link."@en .
ga:compactSection a owl:DatatypeProperty ; rdfs:label "compact section"@en ; rdfs:isDefinedBy <https://ekgf.org/ontology/grapharch> ; skos:definition "Selects a level-two heading anchor for a compact section with a smaller heading; consecutive compact sections read as one continuous section."@en ; dct:description "Selects a level-two heading anchor for a compact section with a smaller heading; consecutive compact sections read as one continuous section."@en ; rdfs:domain ga:Page ; rdfs:range xsd:string ; skos:scopeNote "Suits a sequence of steps. A compact section may also select another presentation."@en .

ga:resourceSection a owl:DatatypeProperty ; rdfs:label "resource section"@en ; rdfs:isDefinedBy <https://ekgf.org/ontology/grapharch> ; skos:definition "Selects a level-two heading anchor for a single-column list of resource cards."@en ; dct:description "Selects a level-two heading anchor for a single-column list of resource cards."@en ; rdfs:domain ga:Page ; rdfs:range xsd:string ; skos:scopeNote "Naming the anchor of the page title presents the cards directly after the introduction as this list. A card whose title is one link gains a trailing arrow and acts as that link; a wholly emphasized paragraph in a card is shown as its metadata line."@en .

ga:heroKind a owl:DatatypeProperty ; rdfs:label "hero kind"@en ; rdfs:isDefinedBy <https://ekgf.org/ontology/grapharch> ; skos:definition "Selects a landing campaign hero or an interior introduction for a project page."@en ; dct:description "Selects a landing campaign hero or an interior introduction for a project page."@en ; rdfs:domain ga:Page ; rdfs:range xsd:string .
Expand Down Expand Up @@ -3540,6 +3544,15 @@ ga:projectNavigation a owl:DatatypeProperty ;
rdfs:domain ga:Profile ;
rdfs:range xsd:boolean .

ga:generatorCredit a owl:DatatypeProperty ;
rdfs:label "Generator credit"@en ;
rdfs:isDefinedBy <https://ekgf.org/ontology/grapharch> ;
skos:definition "States whether website page footers show the line naming the generating GraphArch build and linking the provenance page; the default is true."@en ;
dct:description "States whether website page footers show the line naming the generating GraphArch build and linking the provenance page; the default is true."@en ;
skos:scopeNote "Use false only when the publisher states provenance elsewhere. The provenance page and the build metadata are still published."@en ;
rdfs:domain ga:Profile ;
rdfs:range xsd:boolean .

ga:siteSearch a owl:DatatypeProperty ;
rdfs:label "Website search"@en ;
rdfs:isDefinedBy <https://ekgf.org/ontology/grapharch> ;
Expand Down
8 changes: 7 additions & 1 deletion docs/usage/project-websites.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,13 @@ timeline_statuses:
Planned: {name: circle, tone: muted}
```

An undeclared status fails the build. A thematic break (`---`) ends the current card, so a following block quote is shown as the section's closing note. A footer link may name a bundled icon with `ga:iconName`, such as `github`.
An undeclared status fails the build.

Three more section presentations are selected by heading anchor. `callout_sections: [join-us]` presents a section as a call-to-action band on the accent colour, keeping its heading, prose, list and links-only action row; the first actions are solid and a final one of several is outlined. `term_sections: [standards]` presents a section's level-three cards as a term/definition list: each heading is a term in its card presentation's tone, a following wholly strong paragraph is its expansion, and the rest of the card is the definition beside it; a term heading that is one link makes the row that link. `compact_sections: [step-1, step-2]` gives sections a smaller heading and a tighter rhythm, so consecutive compact sections read as one section of steps. A section takes one of the callout, term, feature, resource or timeline presentations; compact combines with any of them. Links in a section's action row are marked as leading to another page or away from the site, as in cards.

A publication inventory may declare its website root with `dcat:landingPage`. Versions beneath it then show their path relative to that root, such as `/spec/main`, while their links stay relative and correct.

Website footers end with a line naming the generating GraphArch build and linking the provenance page. A profile may omit that line with `ga:generatorCredit false`; the provenance page and build metadata are still published. A thematic break (`---`) ends the current card, so a following block quote is shown as the section's closing note. A footer link may name a bundled icon with `ga:iconName`, such as `github`.

Links to absolute URLs beneath the website target's `ga:thisVersion` or `ga:latestVersion` render relative to the linking page; those locations are used only for canonical, Open Graph and sitemap URLs.

Expand Down
9 changes: 9 additions & 0 deletions src/publication/collect/page_presentation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ pub(super) struct Hints {
#[serde(default)]
timeline_sections: Vec<String>,
#[serde(default)]
callout_sections: Vec<String>,
#[serde(default)]
term_sections: Vec<String>,
#[serde(default)]
compact_sections: Vec<String>,
#[serde(default)]
card_icons: BTreeMap<String, CardIcon>,
#[serde(default)]
timeline_statuses: BTreeMap<String, Marker>,
Expand Down Expand Up @@ -71,6 +77,9 @@ impl Hints {
("featureSection", &self.feature_sections),
("resourceSection", &self.resource_sections),
("timelineSection", &self.timeline_sections),
("calloutSection", &self.callout_sections),
("termSection", &self.term_sections),
("compactSection", &self.compact_sections),
] {
ensure!(
anchors.len() <= SECTIONS,
Expand Down
1 change: 1 addition & 0 deletions src/publication/document/publication_inventory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ pub(crate) async fn document(
job: &job,
description: description.as_deref(),
versions: &inventory.versions,
site: inventory.site.as_deref(),
}
.markdown()?;
let revision = format!("publication-inventory-v1:{snapshot}");
Expand Down
27 changes: 26 additions & 1 deletion src/publication/document/publication_inventory/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ pub(crate) const DCAT: &str = "http://www.w3.org/ns/dcat#";
#[serde(deny_unknown_fields)]
pub(crate) struct Inventory {
pub observed_at: String,
/// The website root that version paths are displayed beneath. Display
/// only: the route manifest that hosting reads never carries it.
#[serde(skip)]
pub site: Option<String>,
// bounded: explicit catalogue limited to 1000 publication records.
pub versions: Vec<Version>,
}
Expand Down Expand Up @@ -162,6 +166,23 @@ impl Inventory {
anyhow::bail!("publication inventory requires observation time")
};
chrono::DateTime::parse_from_rfc3339(observed_at.value())?;
let site = match view
.optional_by(
subject,
&NamedNode::new(format!("{DCAT}landingPage"))?,
)
.await?
{
None => None,
Some(Term::NamedNode(site)) if site.as_str().ends_with('/') => {
Some(site.into_string())
},
Some(_) => {
anyhow::bail!(
"publication inventory landingPage must be a directory IRI"
)
},
};
let members =
view.pattern(&format!("{subject} <{DCT}hasPart> ?version"), 0);
let fields = view.pattern("?version ?predicate ?object", 1);
Expand Down Expand Up @@ -227,7 +248,11 @@ impl Inventory {
versions.iter().all(|v| slugs.insert(v.slug.clone())),
"publication slugs collide"
);
Ok(Self { observed_at: observed_at.value().into(), versions })
Ok(Self {
observed_at: observed_at.value().into(),
site,
versions,
})
}
}

Expand Down
19 changes: 16 additions & 3 deletions src/publication/document/publication_inventory/page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ pub(super) struct VersionPage<'a> {
pub job: &'a Job,
pub description: Option<&'a str>,
pub versions: &'a [Version],
/// The website root; a version beneath it shows its site-relative path.
pub site: Option<&'a str>,
}

impl VersionPage<'_> {
Expand Down Expand Up @@ -87,7 +89,7 @@ impl VersionPage<'_> {
badge: version.status.clone(),
});
}
body.push_str(&Self::card(version));
body.push_str(&self.card(version));
}
let frontmatter = serde_yaml::to_string(&Frontmatter {
nav_order: self.job.order,
Expand All @@ -97,7 +99,7 @@ impl VersionPage<'_> {
}

/// One version: its linked title, description and location line.
fn card(version: &Version) -> String {
fn card(&self, version: &Version) -> String {
let mut card = format!(
"### [{}](<{}>)\n\n",
text(&version.label),
Expand All @@ -107,7 +109,7 @@ impl VersionPage<'_> {
card.push_str(&format!("{}\n\n", text(description)));
}
// Double-backtick spans hold any branch name verbatim.
let mut location = format!("`` {} ``", version.location());
let mut location = format!("`` {} ``", self.location(version));
if version.branch != version.slug {
location.push_str(&format!(" · branch `` {} ``", version.branch));
}
Expand All @@ -120,6 +122,17 @@ impl VersionPage<'_> {
}
}

impl VersionPage<'_> {
/// Where a version is shown to be served: beneath the website root as a
/// root-relative path, such as `/spec/main`, else its route or URL.
fn location(&self, version: &Version) -> String {
match self.site.and_then(|site| version.url.strip_prefix(site)) {
Some(path) => format!("/{}", path.trim_end_matches('/')),
None => version.location().to_owned(),
}
}
}

/// Escape Markdown syntax in plain text.
fn text(value: &str) -> String {
let mut output = String::new();
Expand Down
2 changes: 1 addition & 1 deletion src/publication/render/website/community_footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
</ul></nav>
<nav class="ekgf-footer-group" aria-label="EKGF resources"><h2>Resources</h2><ul><li><a href="https://ekgf.org/about/">About Us</a></li><li><a href="https://ekgf.org/membership/">Membership</a></li><li><a href="https://ekgf.org/team/">Team</a></li><li><a href="https://ekgf.org/resources/">Resources</a></li><li><a href="https://ekgf.org/contact/">Contact</a></li></ul></nav>
<nav class="ekgf-footer-group" aria-label="Connect with EKGF"><h2>Connect</h2><ul><li><a href="https://twitter.com/EKG_Foundation">Twitter</a></li><li><a href="https://www.linkedin.com/company/EKGF">LinkedIn</a></li><li><a href="https://github.com/EKGF">GitHub</a></li></ul></nav>
</div><div class="ekgf-footer-bottom"><p>An initiative of the <a href="https://ekgf.org/">Enterprise Knowledge Graph Forum (EKGF)</a>, a Managed Community of the <a href="https://www.omg.org/">Object Management Group (OMG)</a>.</p><p>{generator_credit} · <a href="{prefix}provenance.html">Provenance</a> · <a href="{home}">Documentation home</a> · <a href="{prefix}brand/NOTICE.txt">EKGF identity credits</a> · <a href="https://github.com/EKGF/grapharch/blob/main/LICENSE">GraphArch license</a></p></div></div>
</div><div class="ekgf-footer-bottom"><p>An initiative of the <a href="https://ekgf.org/">Enterprise Knowledge Graph Forum (EKGF)</a>, a Managed Community of the <a href="https://www.omg.org/">Object Management Group (OMG)</a>.</p><p>{generator_credit}<a href="{home}">Documentation home</a> · <a href="{prefix}brand/NOTICE.txt">EKGF identity credits</a> · <a href="https://github.com/EKGF/grapharch/blob/main/LICENSE">GraphArch license</a></p></div></div>
</footer>
13 changes: 13 additions & 0 deletions src/publication/render/website/ekgf_project.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* EKGF project sites follow the ekgf.org product layout metrics. The values
are theme tokens; the rules below only apply them. */
.theme-ekgf{--project-body-leading:1.5;--project-heading-weight:700;--project-heading-tracking:normal;--project-nav-padding:8px 16px;--project-nav-height:36px;--project-control-size:36px;--project-header-start:max(20px,calc(50vw - 654px));--project-header-end:max(20px,calc(50vw - 616px))}
.theme-ekgf{line-height:var(--project-body-leading)}
.theme-ekgf .project-section h2,.theme-ekgf .project-section-heading h2{font-weight:var(--project-heading-weight);letter-spacing:var(--project-heading-tracking)}
.theme-ekgf .project-section-callout h2{font-weight:600}
.community-menu .ekgf-header-navigation a{padding:var(--project-nav-padding);line-height:20px}
.community-header-row .source-link,.community-header-row .color-scheme-toggle{box-sizing:border-box;min-width:var(--project-control-size);min-height:var(--project-control-size);width:var(--project-control-size);height:var(--project-control-size);padding:8px;display:inline-flex;align-items:center;justify-content:center}
.community-header-row .source-link svg{width:20px;height:20px}
@media(min-width:1151px){.community-header-row{max-width:none;padding-inline:var(--project-header-start) var(--project-header-end)}}
.community-menu>nav{gap:4px}
.community-header-row .site-links{gap:16px}
.community-header-row .source-link svg{fill:none;stroke:currentColor}
Loading
Loading