Skip to content

Commit 7c12451

Browse files
committed
Add new Tools chapter to build from source with Haxall
1 parent 2cb9ca3 commit 7c12451

3 files changed

Lines changed: 98 additions & 0 deletions

File tree

src/docHaystack/doc/ChangeLog.fandoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- Authentication plaintext scheme
1515
- 776: biomasss, coal, diesel, propane
1616
- 776: biomassHeating, coalHeating, propaneHeating
17+
- New Tools chapter to build from source with Haxall
1718

1819
**Version 3.9.10 (23 Apr 2021)**
1920
- Rename weatherRef to weatherStationRef for consistency

src/docHaystack/doc/Tools.fandoc

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
**************************************************************************
2+
** title: Tools
3+
** author: Brian Frank
4+
** created: 10 Sep 2021
5+
** copyright: Copyright (c) 2021, Project-Haystack
6+
**************************************************************************
7+
8+
Overview [#overview]
9+
********************
10+
This chapter provides guidance to for open source tools available for
11+
to work with Project Haystack data.
12+
13+
Build from Source [#build]
14+
**************************
15+
To compile the ontology from source into HTML, Json, Turtle, etc follow
16+
these steps:
17+
18+
1. Checkout source from [GitHub]`#github`
19+
20+
2. Install [Haxall]`#haxall`
21+
22+
3. Run the [defc]`#defc` command line tool to compile the defs
23+
24+
GitHub [#github]
25+
****************
26+
All Haystack source material is managed on [GitHub]`https://github.com/Project-Haystack/haystack-defs`.
27+
28+
If you have [git]`https://git-scm.com/` installed on your machine, you
29+
can clone the Haystack repo to your local machine with this command:
30+
31+
git clone https://github.com/Project-Haystack/haystack-defs.git
32+
33+
This will create a 'haystack-defs/' directory under your current working
34+
directory.
35+
36+
Haxall [#haxall]
37+
****************
38+
[Haxall]`https://haxall.io` is an open source framework which includes the
39+
reference implementation used to generate the documentation and downloads
40+
found on `https://project-haystack.org/`. It provides several features for
41+
working with Project-Haystack data:
42+
- 'defc' command line tool to compile the ontology from source
43+
- 'hx convert' command line to convert between the different
44+
[file types]`Filetypes`
45+
- Haxall daemon which provides a full runtime to load and explore
46+
haystack data using a functional scripting langauge
47+
48+
Haxall requires a Java VM to run. So you will need Java installed on your
49+
machine as a prerequisite. To install Haxall download the latest release
50+
from [GitHub]`https://github.com/haxall/haxall/releases`. Releases are
51+
packaged as a zip file you can unzip to your machine. Once installed
52+
you can test using the "bin/hx" Bash script or "bin/hx.bat" Window's batch file
53+
as follows:
54+
55+
> bin/hx version
56+
57+
Defc [#defc]
58+
************
59+
The 'defc' command line tool is used to compile the ontology from source.
60+
It compiles the source [Trio]`Trio` files one or more of the following
61+
output files:
62+
- html: generate the HTML documentation as found on the website
63+
- csv: output defs as a [CSV]`Csv` file
64+
- zinc: output defs as a [Zinc]`Zinc` file
65+
- trio: output ontology as a [Trio]`Trio` file
66+
- json: output ontology as a [Json]`Json` file
67+
- turtle: output ontology as a [RDF Turtle]`Rdf` file
68+
69+
To use defc, first install [haxall]`#haxall` and verify its installed as follows
70+
71+
bin/fan defc -version
72+
73+
Run this command to print out command line syntax and examples:
74+
75+
bin/fan defc -?
76+
77+
If you have cloned the haystack git repo, then you can compile it as follows
78+
79+
// compile ontology to HTML docs
80+
bin/fan defc haystack-defs/src
81+
82+
// compile ontology to JSON
83+
bin/fan defc -output json haystack-defs/src
84+
85+
// compile ontology to Turtle
86+
bin/fan defc -output turtle haystack-defs/src
87+
88+
// compile ontology to JSON and Turtle
89+
bin/fan defc -output json,turtle haystack-defs/src
90+
91+
92+
93+
94+
95+
96+

src/docHaystack/doc/index.fog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
[`Auth`, "HTTP API authentication"],
6060

6161
"Appendix",
62+
[`Tools`, "Tools to work with Haystack data"],
6263
[`Docs`, "Guidance on reference documentation"],
6364
[`ChangeLog`, "Version history"],
6465
[`Changes3to4`, "Notes for upgrading from version 3 to 4"],

0 commit comments

Comments
 (0)