You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**NOTE**: You will need to be off the NREL VPN to import a schema, otherwise you'll get an error related to http://www.gbxml.org/schema}Area' as the gbxml schema cannot be imported when on the NREL VPN.
55
+
**NOTE**: You will need to be _off_ the NREL VPN to import a schema, otherwise you'll get an error related to http://www.gbxml.org/schema}Area' as the gbXML schema cannot be imported when on the NREL VPN.
57
56
58
-
### Precommit
57
+
### Pre-commit
59
58
60
59
This project used `pre-commit <https://pre-commit.com/>`_ to ensure code consistency. To enable pre-commit, run the following from the command line.
61
60
@@ -73,9 +72,9 @@ pre-commit run --all-files
73
72
### Testing
74
73
75
74
* To run test:
76
-
```bash
77
-
./manage.py test
78
-
```
75
+
```bash
76
+
./manage.py test
77
+
```
79
78
80
79
* To calculate coverage:
81
80
```bash
@@ -85,7 +84,7 @@ pre-commit run --all-files
85
84
86
85
### Pep
87
86
88
-
* Run the following command to clean-up your code before committing:
87
+
* Run the following command to cleanup your code before committing:
The BuildingSync Schema Viewer can support multiple versions of the BuildingSync schema. Admin users can manage schemas from the Django Administration console. Click on the 'Admin' link in the top navigation bar to access the Django Administration pages.
98
+
The BuildingSync Schema Viewer can support multiple versions of the BuildingSync schema. Admin users can manage schemas from the Django Administration console. Click on the 'Admin' link in the top navigation bar to access the Django Administration pages.
100
99
101
-
To add a schema, specify the name, version, and schema file (XSD) to parse and save the record. The schema file will be parsed automatically. **NOTE**: You will need to be off the NREL VPN to import a schema, otherwise you'll get an error related to http://www.gbxml.org/schema}Area' as the gbxml schema cannot be imported when on the NREL VPN.
100
+
To add a schema, specify the name, version, and schema file (XSD) to parse and save the record. The schema file will be parsed automatically. **NOTE**: You will need to be _off_ the NREL VPN to import a schema, otherwise you'll get an error related to http://www.gbxml.org/schema}Area' as the gbXML schema cannot be imported when on the NREL VPN.
102
101
103
-
To modify an existing schema, click on the edit link. If changes are made to the uploaded XSD schema file and re-uploaded, ensure that the 'schema parsed' checkbox is unchecked before saving the record. This will trigger the automatic schema parsing.
102
+
To modify an existing schema, click on the edit link. If changes are made to the uploaded XSD schema file and re-uploaded, ensure that the 'schema parsed' checkbox is unchecked before saving the record. This will trigger the automatic schema parsing.
104
103
105
104
### Use Cases
106
105
107
-
Authenticated users can add private use cases to the BuildingSync Schema Viewer. Use cases are represented by a schematron file that defines a set of rules and patterns.
106
+
Authenticated users can add private use cases to the BuildingSync Schema Viewer. Use cases are represented by a schematron file that defines a set of rules and patterns.
108
107
109
108
To add a use case, click on the 'Use Case' link in the top navigation bar, then click on the '+ New Use Case' button.
110
-
Select a name and a BuildingSync schema version. Select your use case definitions schematron file and upload, then click 'Submit'.
109
+
Select a name and a BuildingSync schema version. Select your use case definitions schematron file and upload, then click 'Submit'.
111
110
112
111
Once ready, contact a BuildingSync admin to make the use case public. Public use cases will be available on the 'Validator' page to validate XML files submitted by users.
113
112
114
-
Admin users: Find the use casein the Django Administration console and click the edit button. Check the 'Make public' checkbox and save.
113
+
Admin users: Find the use casein the Django Administration console and click the edit button. Check the 'Make public' checkbox and save.
115
114
116
115
### Validator
117
116
118
-
The validator page allows users to validate XMLs against the BuildingSync schema and its public use cases. It can be tried with selected example files, or custom XML files can be uploaded for validation.
117
+
The validator page allows users to validate XMLs against the BuildingSync schema and its public use cases. It can be tried with selected example files, or custom XML files can be uploaded for validation.
119
118
120
119
#### Validator API
121
120
@@ -124,7 +123,7 @@ There is also a validator endpoint to validate XML files against the BuildingSyn
124
123
#### SINGLE XML
125
124
126
125
Request: POST to https://buildingsync.net/api/validate
127
-
Use form-data to specify the following parameters for schema version and XML file: ```schema_version``` and ```file```.
126
+
Use form-data to specify the following parameters for schema version and XML file: `schema_version` and `file`.
128
127
129
128
Example Response:
130
129
```json
@@ -165,7 +164,7 @@ Example Response:
165
164
#### ZIP with multiple XMLs
166
165
167
166
Request: POST to https://buildingsync.net/api/validate
168
-
Use form-data to specify the following parameters for schema version and XML file: ```schema_version``` and ```file```.
167
+
Use form-data to specify the following parameters for schema version and XML file: `schema_version` and `file`.
169
168
170
169
Example Response:
171
170
```json
@@ -236,25 +235,24 @@ Example Response:
236
235
}
237
236
```
238
237
239
-
240
238
### BEDES
241
239
242
240
BEDES parsing and mapping to the BuildingSync schema is not an automated process, due to the manual inspections/corrections required.
243
241
244
242
To parse and map a new BEDES version:
245
243
246
-
1. Download the ```bedes_online_dictionary_uuid-lo.xml``` and the ```bedes_online_dictionary_uuid-terms.xml``` files from the BEDES website.
244
+
1. Download the bedes_online_dictionary_uuid-lo.xml` and the `bedes_online_dictionary_uuid-terms.xml` files from the BEDES website.
247
245
248
-
1. Place these new BEDES XMLs in the lib/bedes/vX.X directory. vX.X refers to the BEDES version here.
246
+
1. Place these new BEDES XMLs in the lib/bedes/vX.X directory. vX.X refers to the BEDES version here.
249
247
250
248
1. Parse the BEDES XMLs into a JSON file and map the BEDES terms to the BuildingSync attributes:
Note that the bedes_version contains a v, ex: v2.2.
255
-
This will create a ```bedes_vX.X.json``` file in the lib/bedes/vX.X directory. It will also create 2 CSV files: ```bedes-mappings-enumerations.csv``` and ```bedes-mappings-terms.csv``` in the lib/bedes/vX.X/schemaX.X directory.
253
+
This will create a bedes_vX.X.json` file in the lib/bedes/vX.X directory. It will also create 2 CSV files: `bedes-mappings-enumerations.csv` and `bedes-mappings-terms.csv` in the lib/bedes/vX.X/schemaX.X directory.
256
254
257
-
*Note* — The BEDES terms must be mapped for each version of the BuildingSync schema by calling the ```python manage.py bedes``` command above.
255
+
_Note_ — The BEDES terms must be mapped for each version of the BuildingSync schema by calling the python manage.py bedes` command above.
258
256
259
257
1. Review these mapping files and make changes as needed.
260
258
@@ -273,8 +271,8 @@ Admin interface is available at `/admin`
273
271
274
272
Follow these steps to add a new schema version to the selection tool:
275
273
276
-
1. Add the schema file in the admin interface. Must have admin privileges. The schema will get automatically parsed.
277
-
1. Convert existing use cases schematron files to the new schema. Add the new use cases.
274
+
1. Add the schema file in the admin interface. Must have admin privileges. The schema will get automatically parsed.
275
+
1. Convert existing use cases schematron files to the new schema. Add the new use cases.
278
276
1. When the use cases have been reviewed, make them public in the admin interface.
279
277
1. Create XML example files and place them in the `lib/validator/examples/schema<VERSION>` directory.
280
278
1. Test the validator with the new XML example files.
@@ -287,14 +285,14 @@ Follow these steps to add new example tables from the TestSuite repo
287
285
1. Clone the [TestSuite](https://github.com/BuildingSync/TestSuite) repo
4. Copy the tables part of the README.html and paste to replace the old content in ```bsyncviewer/templates/examples.html```.
288
+
`pandoc README.md -s -o README.html`
289
+
4. Copy the tables part of the README.html and paste to replace the old content in `bsyncviewer/templates/examples.html`.
292
290
293
291
### Adding an OpenStudio Simulation Use Case from the TestSuite repo
294
292
295
-
1. The relevant files are currently on the `develop` branch of the [TestSuite](https://github.com/BuildingSync/TestSuite/tree/develop) repo. Clone the repo locally.
296
-
1. OpenStudio Simulation use case schematron files include patterns from a [library of schematron files](https://github.com/BuildingSync/TestSuite/tree/develop/lib). Copy these files from the TestSuite repo into the selection-tool at the following location: ```bsyncviewer/testsuitelib```.
297
-
1. Open the relevant use case file from the TestSuite repo. For example: [L00_OpenStudio_Simulation.sch](https://github.com/BuildingSync/TestSuite/blob/develop/schematron/v2.2.0/v2-2-0_L000_OpenStudio_Simulation.sch). Edit the include statements at the top of the file with relative paths to the buildingsync-website testsuitelib directory. Save the file.
293
+
1. The relevant files are currently on the `develop` branch of the [TestSuite](https://github.com/BuildingSync/TestSuite/tree/develop) repo. Clone the repo locally.
294
+
1. OpenStudio Simulation use case schematron files include patterns from a [library of schematron files](https://github.com/BuildingSync/TestSuite/tree/develop/lib). Copy these files from the TestSuite repo into the selection-tool at the following location: `bsyncviewer/testsuitelib`.
295
+
1. Open the relevant use case file from the TestSuite repo. For example: [L00_OpenStudio_Simulation.sch](https://github.com/BuildingSync/TestSuite/blob/develop/schematron/v2.2.0/v2-2-0_L000_OpenStudio_Simulation.sch). Edit the include statements at the top of the file with relative paths to the buildingsync-website testsuitelib directory. Save the file.
1. Add the use case to the selection-tool by browsing to the ```/use_cases``` URL and clicking the *New Use Case* button.
306
+
1. Add the use case to the selection-tool by browsing to the `/use_cases` URL and clicking the _New Use Case_ button.
309
307
1. Fill out the name, description, and schema version
310
308
1. Upload the file that was modified in the previous step
311
309
1. Save
312
310
1. Make the use case public from the selection-tool admin interface.
313
-
1. If you have any example files to add to the selection-tool (for example, for the L000 OpenStudio Simulation use case, there are [2 examples files](https://github.com/BuildingSync/TestSuite/tree/develop/spec/use_cases/schema2.0.0/examples)), add them in the appropriate schema directory in ```bsyncviewer/lib/validator/examples```. Regenerate the ```example_files.zip``` archive. This will make the files available as examples at the ```/validator``` URL.
311
+
1. If you have any example files to add to the selection-tool (for example, for the L000 OpenStudio Simulation use case, there are [2 examples files](https://github.com/BuildingSync/TestSuite/tree/develop/spec/use_cases/schema2.0.0/examples)), add them in the appropriate schema directory in `bsyncviewer/lib/validator/examples`. Regenerate the `example_files.zip` archive. This will make the files available as examples at the `/validator` URL.
314
312
1. You can now validate XMLs against the new use case.
Copy file name to clipboardExpand all lines: bsyncviewer/templates/about.html
+1-1
Original file line number
Diff line number
Diff line change
@@ -110,7 +110,7 @@ <h6>Leverage expert support from DOE and the National Renewable Energy Laborator
110
110
</div>
111
111
</section>
112
112
113
-
<p>Get started by downloading the <ahref="https://github.com/BuildingSync/schema/releases" target="_blank" rel="noopener">BuildingSync schema</a> or
113
+
<p>Get started by downloading the <ahref="https://github.com/BuildingSync/schema/releases/latest" target="_blank" rel="noopener">BuildingSync schema</a> or
114
114
<ahref="https://buildingsync.net/validator" target="_blank" rel="noopener">validating</a> your use case.</p>
0 commit comments