-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add graph, timeline semantics to schema docs pages
- Loading branch information
1 parent
9834675
commit 067092c
Showing
9 changed files
with
128 additions
and
47 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,27 @@ | ||
--- | ||
const { properties } = Astro.props; | ||
const last = properties.pop(); | ||
--- | ||
|
||
{properties.length <= 0 && <code>{last.name}</code>} | ||
|
||
{ | ||
properties.length === 1 && ( | ||
<> | ||
<code>{properties[0].name}</code> or <code>{last.name}</code> | ||
</> | ||
) | ||
} | ||
|
||
{ | ||
properties.length > 1 && ( | ||
<> | ||
{properties.map((prop) => ( | ||
<> | ||
<code>{prop.name}</code>, | ||
</> | ||
))} | ||
or <code>{last.name}</code> | ||
</> | ||
) | ||
} |
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 |
---|---|---|
@@ -1,34 +1,35 @@ | ||
--- | ||
import { RichContent } from 'astro-theme-docs/components'; | ||
import SchemaLink from '@components/explorer/SchemaLink.astro'; | ||
const { schema } = Astro.props; | ||
const { schema, ...rest } = Astro.props; | ||
const parents = schema.getExtends(); | ||
--- | ||
|
||
<div> | ||
<h2 class="beta">Extends</h2> | ||
<div {...rest}> | ||
<RichContent> | ||
<h2 class="beta">Inheritance</h2> | ||
|
||
{ | ||
parents.length > 0 && ( | ||
<> | ||
<p class="mb-xs"> | ||
The {schema.label} schema extends the following schemata: | ||
</p> | ||
{ | ||
parents.length > 0 && ( | ||
<> | ||
<p>The {schema.label} schema extends the following schemata:</p> | ||
|
||
<ul class="unordered-list"> | ||
{parents.map((parent) => ( | ||
<li> | ||
<SchemaLink schema={parent} /> | ||
</li> | ||
))} | ||
</ul> | ||
</> | ||
) | ||
} | ||
<ul class="unordered-list"> | ||
{parents.map((parent) => ( | ||
<li> | ||
<SchemaLink schema={parent} /> | ||
</li> | ||
))} | ||
</ul> | ||
</> | ||
) | ||
} | ||
|
||
{ | ||
parents.length <= 0 && ( | ||
<p>The {schema.label} schema does not extend any other schemata.</p> | ||
) | ||
} | ||
{ | ||
parents.length <= 0 && ( | ||
<p>The {schema.label} schema does not extend any other schemata.</p> | ||
) | ||
} | ||
</RichContent> | ||
</div> |
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
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,49 @@ | ||
--- | ||
import { RichContent } from 'astro-theme-docs/components'; | ||
import PropertyList from '@components/explorer/PropertyList.astro'; | ||
const { schema, ...rest } = Astro.props; | ||
const start = schema.getTemporalStartProperties(); | ||
const end = schema.getTemporalEndProperties(); | ||
--- | ||
|
||
<div {...rest}> | ||
<RichContent> | ||
<h2 class="beta">Semantics</h2> | ||
<p> | ||
FollowTheMoney has well-defined semantics for different representations of | ||
entities, for example in a network graph or in a timeline. | ||
|
||
<ul class="unordered-list"> | ||
<li> | ||
In a network graph, entities should be represented as { | ||
schema.isEdge ? 'an edge' : 'a vertex' | ||
}. | ||
</li> | ||
|
||
{ | ||
start.length > 0 && ( | ||
<li> | ||
In a timeline, <PropertyList properties={start} /> should be used | ||
as the temporal start. | ||
{end.length > 0 && ( | ||
<> | ||
<PropertyList properties={end} /> should be used as the | ||
temporal end. | ||
</> | ||
)} | ||
</li> | ||
) | ||
} | ||
|
||
{ | ||
start <= 0 && ( | ||
<li> | ||
{schema.label} entites have no temporal extent, i.e. they are not | ||
suitable for representation in a timeline. | ||
</li> | ||
) | ||
} | ||
</ul> | ||
</p> | ||
</RichContent> | ||
</div> |
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
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
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