openstudio-metadata 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +49 -0
- data/.rakeTasks +7 -0
- data/.rspec +1 -0
- data/.rubocop.yml +9 -0
- data/.travis.yml +20 -0
- data/.yardopts +1 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile +23 -0
- data/README.md +66 -0
- data/Rakefile +22 -0
- data/doc_templates/LICENSE.md +27 -0
- data/doc_templates/README.md.erb +42 -0
- data/doc_templates/copyright_erb.txt +36 -0
- data/doc_templates/copyright_js.txt +4 -0
- data/doc_templates/copyright_ruby.txt +34 -0
- data/lib/.DS_Store +0 -0
- data/lib/files/brick/1.1/Brick.ttl +11144 -0
- data/lib/files/haystack/3.9.9/defs.ttl +5205 -0
- data/lib/files/mappings.json +388 -0
- data/lib/files/templates.yaml +361 -0
- data/lib/measures/haystack/measure.rb +574 -0
- data/lib/measures/haystack/measure.xml +83 -0
- data/lib/openstudio/metadata/controls.rb +220 -0
- data/lib/openstudio/metadata/creator.rb +432 -0
- data/lib/openstudio/metadata/helpers.rb +184 -0
- data/lib/openstudio/metadata/serializer.rb +141 -0
- data/lib/openstudio/metadata/version.rb +40 -0
- data/lib/openstudio/metadata/writer.rb +107 -0
- data/lib/openstudio/metadata.rb +55 -0
- data/lib/openstudio-metadata.rb +1 -0
- data/openstudio-metadata.gemspec +32 -0
- data/test.rb +15 -0
- metadata +165 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d6fdea47b8724a5a2111f66496d40f3aab6d804ce0aa0aaf1ca04a14ea5d1d34
|
4
|
+
data.tar.gz: 5556e0d06d18329cb90b3ab7778b7304cb63533e11694a7601c946e82e51620b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7a006e65a4699f42dd1c562aff7b4b7d615bd59500bafc968597d3c08e1392535817af930d6c94073f631655a00fe1e398270723d4c832e0aed3c2879fea03af
|
7
|
+
data.tar.gz: 8fec5de8c97a432c56a9817977429d2440f33f84431cc848d92f7798effbdb7dfa4a82f511bff41a5ba291995f90a0552452e44f83cd3dc4c634e5e9fff73151
|
data/.gitignore
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
/.bundle/
|
2
|
+
/.yardoc
|
3
|
+
/.ruby-version
|
4
|
+
/Gemfile.lock
|
5
|
+
/gems
|
6
|
+
/_yardoc/
|
7
|
+
/coverage/
|
8
|
+
/doc/
|
9
|
+
/pkg/
|
10
|
+
/spec/reports/
|
11
|
+
/spec/test/
|
12
|
+
/tmp/
|
13
|
+
/test/
|
14
|
+
/lib/measures/test_results
|
15
|
+
/lib/measures/.rubocop*
|
16
|
+
ruby
|
17
|
+
rubocop-results.xml
|
18
|
+
|
19
|
+
# rspec failure tracking
|
20
|
+
.rspec_status
|
21
|
+
|
22
|
+
# Ignore IDE files
|
23
|
+
/.idea
|
24
|
+
*.rubocop-http*
|
25
|
+
|
26
|
+
# measures tests
|
27
|
+
lib/measures/.rubocop.yml
|
28
|
+
lib/measures/test_results/*
|
29
|
+
|
30
|
+
# runner conf
|
31
|
+
runner.conf
|
32
|
+
|
33
|
+
outputs
|
34
|
+
|
35
|
+
# macs
|
36
|
+
.DS_Store
|
37
|
+
|
38
|
+
#rbtagger
|
39
|
+
TAGS*
|
40
|
+
.TAGS
|
41
|
+
.ruby_tags_commit_hash
|
42
|
+
|
43
|
+
#projectile
|
44
|
+
.projectile
|
45
|
+
|
46
|
+
#emacs
|
47
|
+
*~
|
48
|
+
\#*\#
|
49
|
+
.\#*
|
data/.rakeTasks
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<Settings><!--This file was automatically generated by Ruby plugin.
|
3
|
+
You are allowed to:
|
4
|
+
1. Remove rake task
|
5
|
+
2. Add existing rake tasks
|
6
|
+
To add existing rake tasks automatically delete this file and reload the project.
|
7
|
+
--><RakeGroup description="" fullCmd="" taksId="rake" /></Settings>
|
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--require spec_helper
|
data/.rubocop.yml
ADDED
data/.travis.yml
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
---
|
2
|
+
sudo: false
|
3
|
+
dist: bionic
|
4
|
+
language: ruby
|
5
|
+
rvm:
|
6
|
+
- 2.5.5
|
7
|
+
matrix:
|
8
|
+
include:
|
9
|
+
- env: OPENSTUDIO_VERSION=3.0.1 OPENSTUDIO_SHA=09b7c8a554 RUBYLIB=/usr/local/openstudio-3.0.1/Ruby:/usr/Ruby
|
10
|
+
before_install:
|
11
|
+
- gem install bundler
|
12
|
+
- bundle -v
|
13
|
+
install:
|
14
|
+
- bundle install
|
15
|
+
before_script:
|
16
|
+
- curl -LO https://github.com/NREL/OpenStudio/releases/download/v3.0.1/OpenStudio-3.0.1+09b7c8a554-Linux.deb
|
17
|
+
- sudo apt install ./OpenStudio-3.0.1+09b7c8a554-Linux.deb
|
18
|
+
script:
|
19
|
+
# run all tests together
|
20
|
+
- bundle exec rspec
|
data/.yardopts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--exclude lib/measures/*
|
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
source 'http://rubygems.org'
|
2
|
+
|
3
|
+
gemspec
|
4
|
+
|
5
|
+
gem 'linkeddata'
|
6
|
+
gem 'sparql-client'
|
7
|
+
|
8
|
+
# Local gems are useful when developing and integrating the various dependencies.
|
9
|
+
# To favor the use of local gems, set the following environment variable:
|
10
|
+
# Mac: export FAVOR_LOCAL_GEMS=1
|
11
|
+
# Windows: set FAVOR_LOCAL_GEMS=1
|
12
|
+
# Note that if allow_local is true, but the gem is not found locally, then it will
|
13
|
+
# checkout the latest version (develop) from github.
|
14
|
+
# allow_local = ENV['FAVOR_LOCAL_GEMS']
|
15
|
+
allow_local = false
|
16
|
+
|
17
|
+
if allow_local && File.exist?('../openstudio-extension-gem')
|
18
|
+
gem 'openstudio-extension', path: '../openstudio-extension-gem'
|
19
|
+
else
|
20
|
+
gem 'openstudio-extension', github: 'NREL/OpenStudio-extension-gem', branch: 'develop'
|
21
|
+
end
|
22
|
+
|
23
|
+
gem 'openstudio_measure_tester', '= 0.2.3' # This includes the dependencies for running unit tests, coverage, and rubocop
|
data/README.md
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
# Openstudio Metadata Gem
|
2
|
+
|
3
|
+
This gem produces semantic data representations for OpenStudio models
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'openstudio-metadata'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install 'openstudio-metadata'
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
Find documentation at https://www.rubydoc.info/gems/openstudio-metadata
|
24
|
+
|
25
|
+
## Note
|
26
|
+
|
27
|
+
This Gem requires OpenStudio@3.0 or greater
|
28
|
+
|
29
|
+
# Developing
|
30
|
+
|
31
|
+
## Environment Setup
|
32
|
+
|
33
|
+
- Prereqs:
|
34
|
+
[bundle](https://bundler.io/), [OpenStudio](https://www.openstudio.net/), [ruby](https://www.ruby-lang.org/), [rbenv](https://github.com/rbenv/rbenv) (not technically required, but it will greately reduce headaches)
|
35
|
+
|
36
|
+
1. Install ruby with `rbenv`
|
37
|
+
|
38
|
+
$ rbenv install 2.5.5
|
39
|
+
|
40
|
+
check [compatability matrix](https://github.com/NREL/OpenStudio/wiki/OpenStudio-SDK-Version-Compatibility-Matrix) for which ruby version is supported by your version of OpenStudio
|
41
|
+
|
42
|
+
2. Set project project to use specific ruby version:
|
43
|
+
|
44
|
+
$ rbenv local 2.5.5
|
45
|
+
|
46
|
+
3. Install required gems with `bundle`
|
47
|
+
|
48
|
+
$ bundle install
|
49
|
+
|
50
|
+
## Contributing
|
51
|
+
1. Create branch
|
52
|
+
2. Work on feature, add tests
|
53
|
+
3. Make sure tests are passing: `bundle exec rspec`
|
54
|
+
4. Add commits
|
55
|
+
5. Run `bundle exec rake rubocop:auto_correct`
|
56
|
+
6. Commit and push
|
57
|
+
7. Add PR to feature
|
58
|
+
|
59
|
+
## Releasing
|
60
|
+
|
61
|
+
1. Update change log
|
62
|
+
2. Update version in `/lib/openstudio/openstudio-metadata/version.rb`
|
63
|
+
3. Run `bundle exec rake rubocop:auto_correct`
|
64
|
+
3. Merge develop down to master and confirm tests pass
|
65
|
+
4. Release via github
|
66
|
+
5. run `rake release` from master
|
data/Rakefile
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
require 'rspec/core/rake_task'
|
3
|
+
|
4
|
+
RSpec::Core::RakeTask.new(:spec)
|
5
|
+
|
6
|
+
require 'rubocop/rake_task'
|
7
|
+
desc 'Run RuboCop on the lib directory'
|
8
|
+
RuboCop::RakeTask.new(:rubocop) do |task|
|
9
|
+
task.options = ['--no-color', '--out=rubocop-results.xml', '--format', 'simple']
|
10
|
+
task.formatters = ['RuboCop::Formatter::CheckstyleFormatter']
|
11
|
+
task.requires = ['rubocop/formatter/checkstyle_formatter']
|
12
|
+
# don't abort rake on failure
|
13
|
+
task.fail_on_error = false
|
14
|
+
end
|
15
|
+
|
16
|
+
# Load in the rake tasks from the base openstudio-extension gem
|
17
|
+
require 'openstudio/extension/rake_task'
|
18
|
+
require 'openstudio/metadata'
|
19
|
+
os_extension = OpenStudio::Extension::RakeTask.new
|
20
|
+
os_extension.set_extension_class(OpenStudio::Metadata::Metadata)
|
21
|
+
|
22
|
+
task default: :spec
|
@@ -0,0 +1,27 @@
|
|
1
|
+
OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC. All rights reserved.
|
2
|
+
|
3
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted
|
4
|
+
provided that the following conditions are met:
|
5
|
+
|
6
|
+
(1) Redistributions of source code must retain the above copyright notice, this list of conditions
|
7
|
+
and the following disclaimer.
|
8
|
+
|
9
|
+
(2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions
|
10
|
+
and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
11
|
+
|
12
|
+
(3) Neither the name of the copyright holder nor the names of any contributors may be used to endorse
|
13
|
+
or promote products derived from this software without specific prior written permission from the
|
14
|
+
respective party.
|
15
|
+
|
16
|
+
(4) Other than as required in clauses (1) and (2), distributions in any form of modifications or other
|
17
|
+
derivative works may not use the "OpenStudio" trademark, "OS", "os", or any other confusingly similar
|
18
|
+
designation without specific prior written permission from Alliance for Sustainable Energy, LLC.
|
19
|
+
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
|
21
|
+
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
22
|
+
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER, THE UNITED STATES GOVERNMENT,
|
23
|
+
OR ANY CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
24
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
25
|
+
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
26
|
+
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
27
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
@@ -0,0 +1,42 @@
|
|
1
|
+
<%#= README.md.erb is used to auto-generate README.md. %>
|
2
|
+
<%#= To manually maintain README.md throw away README.md.erb and manually edit README.md %>
|
3
|
+
###### (Automatically generated documentation)
|
4
|
+
|
5
|
+
# <%= name %>
|
6
|
+
|
7
|
+
## Description
|
8
|
+
<%= description %>
|
9
|
+
|
10
|
+
## Modeler Description
|
11
|
+
<%= modelerDescription %>
|
12
|
+
|
13
|
+
## Measure Type
|
14
|
+
<%= measureType %>
|
15
|
+
|
16
|
+
## Taxonomy
|
17
|
+
<%= taxonomy %>
|
18
|
+
|
19
|
+
## Arguments
|
20
|
+
|
21
|
+
<% arguments.each do |argument| %>
|
22
|
+
### <%= argument[:display_name] %>
|
23
|
+
<%= argument[:description] %>
|
24
|
+
**Name:** <%= argument[:name] %>,
|
25
|
+
**Type:** <%= argument[:type] %>,
|
26
|
+
**Units:** <%= argument[:units] %>,
|
27
|
+
**Required:** <%= argument[:required] %>,
|
28
|
+
**Model Dependent:** <%= argument[:model_dependent] %>
|
29
|
+
<% end %>
|
30
|
+
|
31
|
+
<% if arguments.size == 0 %>
|
32
|
+
<%= "This measure does not have any user arguments" %>
|
33
|
+
<% end %>
|
34
|
+
|
35
|
+
<% if outputs.size > 0 %>
|
36
|
+
## Outputs
|
37
|
+
<% output_names = [] %>
|
38
|
+
<% outputs.each do |output| %>
|
39
|
+
<% output_names << output[:display_name] %>
|
40
|
+
<% end %>
|
41
|
+
<%= output_names.join(", ") %>
|
42
|
+
<% end %>
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<%
|
2
|
+
# *******************************************************************************
|
3
|
+
# OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
|
4
|
+
# All rights reserved.
|
5
|
+
# Redistribution and use in source and binary forms, with or without
|
6
|
+
# modification, are permitted provided that the following conditions are met:
|
7
|
+
#
|
8
|
+
# (1) Redistributions of source code must retain the above copyright notice,
|
9
|
+
# this list of conditions and the following disclaimer.
|
10
|
+
#
|
11
|
+
# (2) Redistributions in binary form must reproduce the above copyright notice,
|
12
|
+
# this list of conditions and the following disclaimer in the documentation
|
13
|
+
# and/or other materials provided with the distribution.
|
14
|
+
#
|
15
|
+
# (3) Neither the name of the copyright holder nor the names of any contributors
|
16
|
+
# may be used to endorse or promote products derived from this software without
|
17
|
+
# specific prior written permission from the respective party.
|
18
|
+
#
|
19
|
+
# (4) Other than as required in clauses (1) and (2), distributions in any form
|
20
|
+
# of modifications or other derivative works may not use the "OpenStudio"
|
21
|
+
# trademark, "OS", "os", or any other confusingly similar designation without
|
22
|
+
# specific prior written permission from Alliance for Sustainable Energy, LLC.
|
23
|
+
#
|
24
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS
|
25
|
+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
26
|
+
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
27
|
+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE
|
28
|
+
# UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF
|
29
|
+
# THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
30
|
+
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
31
|
+
# OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
32
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
33
|
+
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
34
|
+
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
35
|
+
# *******************************************************************************
|
36
|
+
%>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# *******************************************************************************
|
2
|
+
# OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
|
3
|
+
# All rights reserved.
|
4
|
+
# Redistribution and use in source and binary forms, with or without
|
5
|
+
# modification, are permitted provided that the following conditions are met:
|
6
|
+
#
|
7
|
+
# (1) Redistributions of source code must retain the above copyright notice,
|
8
|
+
# this list of conditions and the following disclaimer.
|
9
|
+
#
|
10
|
+
# (2) Redistributions in binary form must reproduce the above copyright notice,
|
11
|
+
# this list of conditions and the following disclaimer in the documentation
|
12
|
+
# and/or other materials provided with the distribution.
|
13
|
+
#
|
14
|
+
# (3) Neither the name of the copyright holder nor the names of any contributors
|
15
|
+
# may be used to endorse or promote products derived from this software without
|
16
|
+
# specific prior written permission from the respective party.
|
17
|
+
#
|
18
|
+
# (4) Other than as required in clauses (1) and (2), distributions in any form
|
19
|
+
# of modifications or other derivative works may not use the "OpenStudio"
|
20
|
+
# trademark, "OS", "os", or any other confusingly similar designation without
|
21
|
+
# specific prior written permission from Alliance for Sustainable Energy, LLC.
|
22
|
+
#
|
23
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS
|
24
|
+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
25
|
+
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
26
|
+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE
|
27
|
+
# UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF
|
28
|
+
# THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
29
|
+
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
30
|
+
# OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
31
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
32
|
+
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
33
|
+
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
34
|
+
# *******************************************************************************
|
data/lib/.DS_Store
ADDED
Binary file
|