-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GitHub: New public repository for CLI
- Loading branch information
Showing
15 changed files
with
865 additions
and
1 deletion.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,2 +1,32 @@ | ||
# yama-cli | ||
A CLI utility to work with YAMA and YAMAML | ||
A CLI utility to work with YAMA and YAMAML files | ||
|
||
```bash | ||
usage : | ||
|
||
shex | ||
Generate ShEx from YAMA | ||
yama shex -i [path/to/yama/file] -o [path/to/output/shex/file] | ||
rdf | ||
Generate RDF from YAMAML | ||
yama rdf -i [path/to/yama/file] > [path/to/output/rdf/file] | ||
``` | ||
|
||
To run use Deno runtime: | ||
|
||
```bash | ||
deno run --unstable --allow-all --no-check yama.js | ||
``` | ||
|
||
Compile yama binary using Deno: | ||
|
||
```bash | ||
deno compile --unstable --allow-all --no-check --output yama yama.js | ||
``` | ||
|
||
### YAMA to RDF | ||
|
||
![YAMA to RDF](docs/images/yama-to-rdf.png) | ||
|
||
### YAMA to ShEx | ||
![YAMA to ShEx](docs/images/yama-to-shex.png) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,44 @@ | ||
@prefix foaf: <http://xmlns.com/foaf/0.1/> . | ||
@prefix schema: <http://schema.org/> . | ||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | ||
|
||
|
||
<sheldon-cooper> a foaf:Person ; | ||
foaf:name "Sheldon Cooper"@en ; | ||
foaf:familyName "Cooper"@en ; | ||
foaf:firstName "Sheldon"@en ; | ||
schema:parent <mary-cooper> ; | ||
foaf:knows <leonard-hofstadter> ; | ||
rdfs:seeAlso <http://www.wikidata.org/entity/Q629583> ; | ||
schema:byArtist <jim-parsons> . | ||
|
||
<mary-cooper> a foaf:Person ; | ||
foaf:name "Mary Cooper"@en ; | ||
foaf:familyName "Cooper"@en ; | ||
foaf:firstName "Mary"@en ; | ||
schema:children <sheldon-cooper> ; | ||
rdfs:seeAlso <http://www.wikidata.org/entity/Q56322967> ; | ||
schema:byArtist <laurie-metcalf> . | ||
|
||
<leonard-hofstadter> a foaf:Person ; | ||
foaf:name "Leonard"@en ; | ||
foaf:familyName "Hofstadter"@en ; | ||
foaf:firstName "Leonard"@en ; | ||
foaf:knows <mary-cooper> ; | ||
rdfs:seeAlso <http://www.wikidata.org/entity/Q512382> ; | ||
schema:byArtist <johnny-galecki> . | ||
|
||
<jim-parsons> a foaf:Person ; | ||
schema:name "Jim Parsons"@en ; | ||
rdfs:isDefinedBy <http://www.wikidata.org/entity/Q190972> . | ||
|
||
<laurie-metcalf> a foaf:Person ; | ||
schema:name "Laurie Metcalf"@en ; | ||
rdfs:isDefinedBy <http://www.wikidata.org/entity/Q236711> . | ||
|
||
<johnny-galecki> a foaf:Person ; | ||
schema:name "Johnny Galecki"@en ; | ||
rdfs:isDefinedBy <http://www.wikidata.org/entity/Q295739> . | ||
|
||
|
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,233 @@ | ||
%YAML 1.2 | ||
--- | ||
base: http://purl.org/yama/examples/2022/tbbt/0.1/ | ||
|
||
namespaces: | ||
foaf: http://xmlns.com/foaf/0.1/ | ||
schema: http://schema.org/ | ||
xsd: http://www.w3.org/2001/XMLSchema# | ||
rdfs: http://www.w3.org/2000/01/rdf-schema# | ||
|
||
defaults: | ||
mapping: | ||
source: tbbt_characters.csv | ||
type: csv | ||
|
||
descriptions: | ||
# Character | ||
character: | ||
a: foaf:Person | ||
label: Character | ||
note: Details of the character | ||
id: | ||
mapping: | ||
source: tbbt_characters.csv | ||
type: csv | ||
path: ID | ||
|
||
# Statements in character | ||
statements: | ||
# Name of the character | ||
name: | ||
label: Name | ||
property: foaf:name | ||
min: 1 | ||
max: 1 | ||
note: Name of the character | ||
type: literal | ||
datatype: xsd:string | ||
mapping: | ||
source: tbbt_characters.csv | ||
type: csv | ||
path: name | ||
|
||
# Family name of the character | ||
familyName: | ||
label: Family Name | ||
property: foaf:familyName | ||
min: 1 | ||
max: 1 | ||
note: Family Name of the character | ||
type: literal | ||
datatype: xsd:string | ||
mapping: | ||
source: tbbt_characters.csv | ||
type: csv | ||
path: familyName | ||
|
||
# First name of the character | ||
firstName: | ||
label: First Name | ||
property: foaf:firstName | ||
min: 1 | ||
max: 1 | ||
note: Firts Name of the character | ||
type: literal | ||
datatype: xsd:string | ||
mapping: | ||
source: tbbt_characters.csv | ||
type: csv | ||
path: firstName | ||
|
||
# Additional name of the character | ||
additionalName: | ||
label: Additional Name | ||
property: schema:additionalName | ||
min: 0 | ||
max: 1 | ||
note: First Name of the character | ||
type: literal | ||
datatype: xsd:string | ||
mapping: | ||
source: tbbt_characters.csv | ||
type: csv | ||
path: additionalName | ||
|
||
# Job Title | ||
jobTitle: | ||
label: Job Title | ||
property: schema:jobTitle | ||
min: 0 | ||
max: 1 | ||
note: Job title of the character | ||
type: literal | ||
datatype: xsd:string | ||
mapping: | ||
source: tbbt_characters.csv | ||
type: csv | ||
path: additionalName | ||
|
||
# Parents | ||
parents: | ||
label: Parents | ||
property: schema:parent | ||
min: 0 | ||
note: Parents of the character | ||
type: IRI | ||
mapping: | ||
source: tbbt_characters.csv | ||
type: csv | ||
path: parents | ||
|
||
# Children | ||
children: | ||
label: Children | ||
property: schema:children | ||
min: 0 | ||
note: Children of the character | ||
type: IRI | ||
mapping: | ||
source: tbbt_characters.csv | ||
type: csv | ||
path: children | ||
|
||
# Knows | ||
knows: | ||
label: Knows | ||
property: foaf:knows | ||
min: 0 | ||
note: This character knows these other characters | ||
type: IRI | ||
mapping: | ||
source: tbbt_characters.csv | ||
type: csv | ||
path: knows | ||
seperator: "," | ||
|
||
wikidata: | ||
label: Wikidata | ||
property: rdfs:seeAlso | ||
type: IRI | ||
mapping: | ||
source: tbbt_characters.csv | ||
type: csv | ||
path: wikidata | ||
prepend: http://www.wikidata.org/entity/ | ||
|
||
# This character is portrayed by | ||
byArtist: | ||
label: Portrayed by | ||
property: schema:byArtist | ||
type: IRI | ||
note: This character is portrayed by | ||
mapping: | ||
source: tbbt_characters.csv | ||
type: csv | ||
path: byArtist | ||
|
||
# Description - Address | ||
address: | ||
# Statements in address | ||
statements: | ||
street: | ||
label: Street | ||
property: schema:streetAddress | ||
note: Building and street address | ||
mapping: | ||
source: tbbt_characters.csv | ||
type: csv | ||
path: street | ||
|
||
locality: | ||
label: Locality | ||
property: schema:addressLocality | ||
mapping: | ||
source: tbbt_characters.csv | ||
type: csv | ||
path: locality | ||
|
||
region: | ||
label: State | ||
property: schema:addressRegion | ||
mapping: | ||
source: tbbt_characters.csv | ||
type: csv | ||
path: region | ||
|
||
country: | ||
label: Country | ||
property: schema:addressRegion | ||
mapping: | ||
source: tbbt_characters.csv | ||
type: csv | ||
path: country | ||
|
||
postalCode: | ||
label: Postal Code | ||
property: schema:postalCode | ||
mapping: | ||
source: tbbt_characters.csv | ||
type: csv | ||
path: postalCode | ||
|
||
# Description - Artist | ||
artist: | ||
# Statements in address | ||
a: foaf:Person | ||
label: Character | ||
note: Details of the character | ||
id: | ||
mapping: | ||
source: tbbt_actors.csv | ||
type: csv | ||
path: ID | ||
|
||
statements: | ||
name: | ||
label: Name | ||
property: schema:name | ||
note: Name of Artist | ||
mapping: | ||
source: tbbt_actors.csv | ||
type: csv | ||
path: name | ||
|
||
wikidata: | ||
label: Age | ||
property: rdfs:isDefinedBy | ||
type: IRI | ||
mapping: | ||
source: tbbt_actors.csv | ||
type: csv | ||
path: wikidata | ||
prepend: http://www.wikidata.org/entity/ |
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,4 @@ | ||
ID,name,wikidata | ||
jim-parsons,Jim Parsons,Q190972 | ||
laurie-metcalf,Laurie Metcalf,Q236711 | ||
johnny-galecki,Johnny Galecki,Q295739 |
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,4 @@ | ||
ID,wikidata,name,familyName,firstName,jobTitle,parents,children,knows,byArtist,street,locality,region,country,postalCode | ||
sheldon-cooper,Q629583,Sheldon Cooper,Cooper,Sheldon,Theoretical physicist,mary-cooper,,leonard-hofstadter,jim-parsons,"2311 North Los Robles Avenue, Apartment 4A",Pasadena,CA,US,91104 | ||
mary-cooper,Q56322967,Mary Cooper,Cooper,Mary,,,sheldon-cooper,,laurie-metcalf,,,TX,US, | ||
leonard-hofstadter,Q512382,Leonard,Hofstadter,Leonard,Experimental physicist,,,"sheldon-cooper,mary-cooper",johnny-galecki,"2311 North Los Robles Avenue, Apartment 4A",Pasadena,CA,US,91104 |
Oops, something went wrong.