grom 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9833c1d5114eb808c5f60023b2fe62547b132b73
4
- data.tar.gz: 4ee263710c46ce0a5c2ad86b240f1d788bbc7f95
3
+ metadata.gz: 6142d087bf21472d8a4b38d1dd2579dfe1d7e0cc
4
+ data.tar.gz: 238b550001a0f4dbe14c1e8e3686260a9d6d3e2a
5
5
  SHA512:
6
- metadata.gz: 40aefc68a2222bdd48c1aee64365973d4a856d97d06f1b2633017839f1499a9aa7a8ec600fba7b283aee866db3a6758eaf0430313099342d61e11382be74e907
7
- data.tar.gz: def6fb6667d607503b40566cef8d64406790017552a30fb576460c14706908df57fff9c86b70af4d4b82dbd15cf8166c1f869bc808cb486418c545d965ba8880
6
+ metadata.gz: 4b0cae2d8c1210ad7b6a3afcf4659d8afd27d242593a8d034234f440f4006405eb65062d749e644c3f833867f33544d5bc4957449ce805063e50342829cfc4ac
7
+ data.tar.gz: 32fe3f4c9c93289584393edb4a042a8a6be1331fd8a52b72d714afc70013bbd90396c2ae522069f75716d9a9989daf18da3697ab31bf1cac78393f7b09fdda6c
data/.gitignore CHANGED
@@ -6,4 +6,6 @@ pkg/
6
6
  .DS_Store
7
7
  Gemfile.lock
8
8
  /coverage
9
- *.gem
9
+ *.gem
10
+ doc
11
+ .yardoc/
@@ -2,9 +2,6 @@ Metrics/LineLength:
2
2
  Description: 'Limit lines to 120 characters.'
3
3
  Max: 120
4
4
 
5
- Style/Documentation:
6
- Enabled: false
7
-
8
5
  Style/SpaceBeforeFirstArg:
9
6
  Enabled: false
10
7
 
data/README.md CHANGED
@@ -1,113 +1,95 @@
1
- # Graph Object Mapper (Grom)
2
- ALL QUERIES MUST CONTAIN TYPES
3
- Grom is a custom ORM that takes graph data and deserializes it into objects. It uses the [RDF.rb](https://github.com/ruby-rdf/rdf) library. It was created in the context
4
- of UK Parliament's new website.
1
+ # [![Graph Object Mapper (GROM)][grom-logo]][grom]
2
+ [GROM][grom] is a gem created by the [Parliamentary Digital Service][pds] to take [ntriple][ntriple] files representing graph data and deserialise them into ruby objects.
5
3
 
6
- ## Installation
7
- ```apple js
8
- gem install grom
9
- ```
10
- Add this line to your application's Gemfile:
11
-
12
- ```ruby
13
- gem 'grom'
14
- ```
4
+ [![Build Status][shield-travis]][info-travis] [![Test Coverage][shield-coveralls]][info-coveralls] [![License][shield-license]][info-license]
15
5
 
16
- Then execute:
17
- ```bash
18
- $ bundle
19
- ```
6
+ > **NOTE:** This gem is in active development and is likely to change at short notice. It is not recommended that you use this in any production environment.
20
7
 
21
- ## Usage
8
+ ### Contents
9
+ <!-- START doctoc generated TOC please keep comment here to allow auto update -->
10
+ <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
22
11
 
23
- #### Set up
24
- You will need to set three constants in order for the gem to work.
25
12
 
26
- ```
27
- API_ENDPOINT = 'http://example.com'
28
- API_ENDPOINT_HOST = 'example.com'
29
- DATA_URI_PREFIX = 'http://id.example.com'
30
- ```
13
+ - [Requirements](#requirements)
14
+ - [Installation](#installation)
15
+ - [Usage](#usage)
16
+ - [Getting Started with Development](#getting-started-with-development)
17
+ - [Running the tests](#running-the-tests)
18
+ - [Contributing](#contributing)
19
+ - [License](#license)
31
20
 
32
- The API Endpoint will be the endpoint where you are making the calls to get graph data. <br>
33
- The Data URI prefix is the prefix that you use to define the entities in your triple store.
21
+ <!-- END doctoc generated TOC please keep comment here to allow auto update -->
34
22
 
35
23
 
36
- #### Models
37
- Models inherit from `Grom::Base` and need a `self.property_translator` hash defined. The keys are predicates (without the prefix) and the values are the translated object properties.
24
+ ## Requirements
25
+ [GROM][grom] requires the following:
26
+ * [Ruby][ruby] - [click here][ruby-version] for the exact version
27
+ * [Bundler][bundler]
38
28
 
39
- An example of a Person class.
40
29
 
41
- ```
42
- class Person < Grom::Base
43
-
44
- def self.property_translator
45
- {
46
- id: 'id',
47
- forename: 'forename',
48
- surname: 'surname',
49
- middleName: 'middle_name',
50
- dateOfBirth: 'date_of_birth'
51
- }
52
- end
53
- end
30
+ ## Installation
31
+ ```bash
32
+ gem 'grom'
54
33
  ```
55
34
 
56
- #### Retrieving Objects
57
35
 
58
- ##### #all
59
- To return a collection of objects use the class method `all`.
60
- ```apple js
61
- people = Person.all #=> returns an array of People objects
62
- ```
36
+ ## Usage
37
+ This gem's main function is taking an [ntriple][ntriple] data stream and deserialising it into linked `Grom::Node` objects.
63
38
 
64
- This method can take unlimited parameters. Including a parameter appends it to the endpoint url creating a new url. For example,
39
+ ```ruby
40
+ file = File.read('people_members_current.nt')
41
+ data_stream = StringIO.new(file)
65
42
 
66
- ```apple js
67
- people = Person.all('current') #=> returns an array of current People
43
+ objects = Grom::Reader.new(data_stream).objects #=> [<#Grom::Node ...>, <#Grom::Node ...>, ...]
68
44
  ```
69
- This generates the endpoint url `http://#{API_ENDPOINT}/people/current.ttl` and returns a list of current people from there.
70
45
 
71
- ##### #find
72
- To return a single object use the class method `find` with an id.
73
- ```apple js
74
- person = Person.find('1') #=> returns a Person object
46
+
47
+ ## Getting Started with Development
48
+ To clone the repository and set up the dependencies, run the following:
49
+ ```bash
50
+ git clone https://github.com/ukparliament/grom.git
51
+ cd grom
52
+ bundle install
75
53
  ```
76
54
 
77
- #### Associations
55
+ ### Running the tests
56
+ We use [RSpec][rspec] as our testing framework and tests can be run using:
57
+ ```bash
58
+ bundle exec rake
59
+ ```
78
60
 
79
- ##### #has_many
80
- For a simple `has_many` association, declare the association at the top of the model. For example, if `Person` has many `contact_points`, create a `ContactPoint` class and declare the association at the top of the `Person` class.
81
61
 
82
- The name of the association must match the name of the class but it needs to be underscored and pluralized just like in ActiveRecord.
62
+ ## Contributing
63
+ If you wish to submit a bug fix or feature, you can create a pull request and it will be merged pending a code review.
83
64
 
84
- ```
85
- class Person < Grom::Base
86
- has_many :contact_points
87
- ```
65
+ 1. Fork the repository
66
+ 1. Create your feature branch (`git checkout -b my-new-feature`)
67
+ 1. Commit your changes (`git commit -am 'Add some feature'`)
68
+ 1. Push to the branch (`git push origin my-new-feature`)
69
+ 1. Ensure your changes are tested using [Rspec][rspec]
70
+ 1. Create a new Pull Request
88
71
 
89
- It is then possible to retrieve the contact_points for a person in the following way:
90
72
 
91
- ```apple js
92
- person = Person.find('1')
93
- person.contact_points #=> returns an array of contact_points related to person
94
- ```
73
+ ## License
74
+ [grom][grom] is licensed under the [Open Parliament Licence][info-license].
95
75
 
96
- ##### #has_many_through
97
- For a `has_many_through` association, declare the association at the top of the model. For example, if `Person` has many `parties` through `party_memberships`, create a `Party` class and a `PartyMembership` class, then declare the association at the top of the `Person` class.
76
+ Logo design by [Anna Vámos][anna-vamos].
98
77
 
99
- ```
100
- class Person < Grom::Base
101
- has_many_through :parties, via: :party_memberships
102
- ```
78
+ [ruby]: https://www.ruby-lang.org/en/
79
+ [bundler]: http://bundler.io
80
+ [rspec]: http://rspec.info
81
+ [grom-logo]: https://cdn.rawgit.com/ukparliament/grom/85df4d355313358930cea8aa2fbfc53dd3e4f8d3/docs/logo.svg
82
+ [grom]: https://github.com/ukparliament/grom
83
+ [pds]: https://www.parliament.uk/mps-lords-and-offices/offices/bicameral/parliamentary-digital-service/
84
+ [ruby-version]: https://github.com/ukparliament/grom/blob/master/.ruby-version
85
+ [anna-vamos]: https://www.linkedin.com/in/annavamos
86
+ [ntriple]: https://en.wikipedia.org/wiki/N-Triples
103
87
 
104
- It is then possible to retrieve the parties for a person in the following way:
105
-
106
- ```apple js
107
- person = Person.find('1')
108
- person.parties #=> returns an array of parties with the party_memberships stored as a hash
109
- ```
88
+ [info-travis]: https://travis-ci.org/ukparliament/grom
89
+ [shield-travis]: https://img.shields.io/travis/ukparliament/grom.svg
110
90
 
91
+ [info-coveralls]: https://coveralls.io/github/ukparliament/grom
92
+ [shield-coveralls]: https://img.shields.io/coveralls/ukparliament/grom.svg
111
93
 
112
- ## License
113
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
94
+ [info-license]: http://www.parliament.uk/site-information/copyright/open-parliament-licence/
95
+ [shield-license]: https://img.shields.io/badge/license-Open%20Parliament%20Licence-blue.svg
@@ -0,0 +1,254 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1"
5
+ id="svg4274" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:dc="http://purl.org/dc/elements/1.1/" inkscape:version="0.92.0 r15299" sodipodi:docname="GROM.svg"
6
+ xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="612px" height="250px"
7
+ viewBox="0 0 612 250" enable-background="new 0 0 612 250" xml:space="preserve">
8
+ <g>
9
+ <path id="path4935" inkscape:connector-curvature="0" d="M191.127,156.855l10.437,11.138l0.578-0.537l-36.877,48.078
10
+ c-0.278-0.3-0.526-0.631-0.774-1.033c-0.403-0.661-0.796-1.457-1.571-2.098c-0.299-0.248-0.63-0.518-1.002-0.775l17.917-48.242
11
+ l3.988,1.839L191.127,156.855z M88.783,148.434c0.713,0.073,1.209,0.444,1.746,1.18c0.526,0.732,1.002,1.787,1.487,2.893
12
+ c0.486,1.105,0.972,2.263,1.664,3.244c0.692,0.982,1.663,1.819,2.976,2.005c1.116,0.155,2.129-0.258,2.935-0.837
13
+ c0.806-0.589,1.478-1.354,2.118-2.098c1.292-1.487,2.459-2.77,3.658-2.853c-0.135,0.012,0.154,0.041,0.475,0.207
14
+ c0.311,0.165,0.703,0.402,1.064,0.661c0.589,0.413,0.92,0.682,1.096,0.826l0.713,25.047l10.022-4.402l29.447,41.248
15
+ c-0.299,0.229-0.599,0.435-0.898,0.589c-0.641,0.342-1.116,0.403-1.674,0.177c-0.548-0.229-1.25-0.849-2.015-2.17
16
+ c-0.972-1.694-2.677-2.531-4.351-2.604c-1.674-0.083-3.357,0.526-4.515,1.715c-1.137,1.157-1.385,2.625-0.889,3.782
17
+ c0.506,1.146,1.529,2.004,2.676,2.696c1.044,0.631,1.922,1.239,2.531,1.881c0.61,0.641,0.961,1.302,1.054,2.211
18
+ c0.031,0.289-0.041,0.465-0.299,0.754c-0.259,0.29-0.734,0.631-1.323,0.982c-0.981,0.589-2.242,1.229-3.348,2.169L54.53,162.362
19
+ l10.591-0.217l-6.623-6.747c0.259-0.466,0.651-1.116,1.22-1.901c0.909-1.24,2.169-2.387,2.81-2.479
20
+ c1.023-0.146,1.953,0.165,2.945,0.815c1.002,0.651,2.015,1.644,3.059,2.677c1.043,1.044,2.118,2.128,3.327,2.955
21
+ c1.209,0.837,2.593,1.426,4.153,1.302c1.653-0.124,2.996-1.013,4.123-2.129c1.126-1.114,2.066-2.479,2.996-3.771
22
+ c0.93-1.292,1.829-2.512,2.759-3.327C86.819,148.724,87.698,148.32,88.783,148.434z M141.82,126.384l5.724,9.94l5.684,74.757
23
+ c-0.692,0.382-1.344,0.826-1.87,1.384c-0.61,0.642-1.229,1.302-1.84,1.901l-29.127-40.804l7.594-3.327l-10.363-17.906
24
+ L141.82,126.384z M152.194,124.122l22.111,19.982l-4.298,5.518l2.976,10.611l5.238,2.407l-17.865,48.089
25
+ c-0.815-0.384-1.735-0.683-2.811-0.733c-0.898-0.042-1.767,0.113-2.604,0.361l-5.642-74.24L152.194,124.122z M200.323,96.729
26
+ l-2.831,9.031l5.797,1.147l-3.018,8.731l11.635-1.746l1.994,16.737c-1.974,2.583-2.459,6.272-1.901,9.774
27
+ c0.527,3.327,2.005,6.521,4.34,8.535l-13.587,17.71l-10.777-11.49l-0.393-8.999l-11.583-9.353l-0.558,0.714l-4.04,5.177
28
+ l-22.732-20.552l2.356-9.784l42.085-15.158L200.323,96.729z M103.372,96.44l32.972,20.438l4.547,7.895l-24.21,25.944l-7.47-12.896
29
+ l-0.031,0.011l-11.687-37.104c0.93-0.196,1.829-0.486,2.625-0.951C101.461,98.993,102.546,97.826,103.372,96.44L103.372,96.44z
30
+ M82.346,91.74c0.083,0.878,0.259,1.745,0.63,2.552c1.312,2.852,4.288,4.918,7.543,5.962c1.694,0.548,3.472,0.806,5.188,0.724
31
+ l11.861,37.642l0.362,12.75c-0.011,0,0,0-0.011-0.01c-0.403-0.279-0.827-0.56-1.261-0.775c-0.424-0.217-0.806-0.434-1.405-0.393
32
+ c-2.222,0.145-3.616,1.993-4.887,3.462c-0.631,0.732-1.24,1.404-1.819,1.817c-0.578,0.413-1.054,0.6-1.643,0.518
33
+ c-0.713-0.093-1.229-0.507-1.767-1.262c-0.538-0.754-1.003-1.817-1.488-2.924c-0.485-1.105-0.971-2.253-1.674-3.224
34
+ c-0.702-0.961-1.694-1.777-3.007-1.901c-1.653-0.154-3.079,0.537-4.236,1.55c-1.146,1.003-2.098,2.324-3.027,3.628
35
+ c-0.93,1.302-1.839,2.593-2.8,3.544c-0.961,0.949-1.912,1.528-3.007,1.61c-1.033,0.083-1.994-0.289-3.007-0.991
36
+ c-1.013-0.702-2.036-1.716-3.09-2.759c-1.054-1.044-2.128-2.107-3.337-2.903s-2.625-1.312-4.175-1.085
37
+ c-0.578,0.083-1.085,0.342-1.57,0.661l2.056-4.929l-9.144,2.128l-6.438-10.527l-0.589,1.858l-2.666,8.452l-20.634-29.902
38
+ c1.332-0.796,3.296-1.621,5.031-2.231c2.077-0.733,3.803-1.21,3.803-1.21l0.692-0.186l-0.311-6.044L82.346,91.74z M207.505,80.642
39
+ l18.195,4.217l11.8,6.25l-7.099,37.962c-2.18-1.374-4.949-2.107-7.708-2.107c-2.624,0-5.229,0.651-7.191,2.099l-2.046-17.184
40
+ l-10.539,1.581l2.728-7.884l-5.858-1.157l2.655-8.483v-0.01L207.505,80.642z M163.198,61.217l28.456,15.364l4.205,19.197
41
+ l-41.278,14.859l-9.082-11.863c0.165-0.629,1.229-4.814,2.18-6.715c0.176-0.353,0.703-0.816,1.271-1.365
42
+ c0.568-0.547,1.261-1.321,1.188-2.406c-0.062-0.951-0.63-1.686-1.261-2.211c-0.63-0.527-1.354-0.93-2.015-1.312
43
+ c-0.661-0.382-1.261-0.754-1.591-1.074c-0.331-0.32-0.393-0.465-0.331-0.766c0.062-0.32,0.238-0.475,0.837-0.671
44
+ c0.6-0.207,1.509-0.31,2.438-0.424c0.93-0.104,1.891-0.196,2.738-0.527c0.424-0.166,0.837-0.393,1.168-0.765
45
+ c0.33-0.372,0.526-0.909,0.526-1.447c0-0.589-0.237-1.156-0.609-1.54c-0.372-0.383-0.826-0.608-1.302-0.774
46
+ c-0.951-0.332-2.035-0.414-3.079-0.518c-1.044-0.104-2.057-0.217-2.677-0.434c-0.31-0.104-0.506-0.237-0.599-0.331
47
+ c-0.093-0.093-0.114-0.134-0.114-0.32c0-0.403,0.062-0.455,0.476-0.661c0.414-0.205,1.157-0.382,2.005-0.517
48
+ c0.847-0.146,1.787-0.269,2.687-0.527c0.898-0.258,1.787-0.672,2.387-1.487c0.63-0.869,0.682-1.922,0.723-2.832
49
+ c0.011-0.207-0.01-0.195-0.01-0.371c0.279,0.072,0.548,0.154,0.847,0.186c1.974,0.217,3.793-0.434,5.312-1.591
50
+ c1.509-1.157,2.759-2.79,3.792-4.649C162.754,62.24,162.961,61.724,163.198,61.217L163.198,61.217z M200.313,29.62l33.983,34.48
51
+ l-8.782,18.897l-18.382-4.257h-0.011l-14.362-3.575l0,0l-28.817-15.562c1.178-2.976,1.891-6.157,2.107-8.812
52
+ c0.021-0.186,0.011-0.402,0.021-0.6l26.524-19.353L200.313,29.62z M211.183,27.896l28.456,24.685l-4.557,9.795l-32.62-33.106
53
+ L211.183,27.896z M86.768,26.086l0.703,10.302l14.518-1.437L93.32,78.09c-1.416,0.093-2.79,0.413-3.989,1.023
54
+ c-2.511,1.271-4.618,3.761-5.868,6.561c-0.61,1.354-1.003,2.79-1.137,4.206L32.42,105.472l-0.29-5.642l-0.795-0.052
55
+ c0,0-3.41-0.207-7.491,0.031c-1.736,0.092-3.575,0.289-5.363,0.588l7.615-30.306c0.651-0.145,1.323-0.341,1.984-0.62
56
+ c1.87-0.785,3.709-1.983,4.929-3.162c1.735-1.693,4.329-3.088,5.155-3.513c0.444,0.538,1.147,1.354,2.284,2.408
57
+ c1.684,1.56,3.978,3.306,6.571,3.864c5.032,1.085,9.816-1.344,12.761-5.115c1.54-1.975,2.397-4.701,2.552-7.389
58
+ c0.155-2.687-0.382-5.362-1.994-7.149c-1.591-1.756-4.391-3.079-6.829-4.071c-0.961-0.393-1.757-0.66-2.501-0.918L86.768,26.086z
59
+ M114.077,23.11l33.416,16.346c-1.323,3.068-2.149,6.458-2.438,9.248c-0.372,3.544-0.207,8.246,0.961,12.275
60
+ c0.578,2.015,1.415,3.863,2.613,5.299c0.61,0.734,1.323,1.354,2.129,1.82c0.011,0.248,0.041,0.454,0.011,0.98
61
+ c-0.031,0.775-0.248,1.674-0.383,1.859c-0.248,0.342-0.733,0.621-1.446,0.828s-1.602,0.33-2.479,0.485
62
+ c-0.879,0.146-1.747,0.299-2.521,0.692c-0.775,0.393-1.457,1.229-1.446,2.263c0,0.589,0.248,1.147,0.619,1.54
63
+ c0.372,0.393,0.827,0.609,1.303,0.775c0.95,0.33,2.035,0.412,3.079,0.517c1.043,0.104,2.056,0.217,2.676,0.435
64
+ c0.31,0.103,0.506,0.236,0.6,0.33c0.093,0.094,0.113,0.135,0.113,0.32c0,0.165-0.021,0.195-0.083,0.27
65
+ c-0.062,0.071-0.206,0.176-0.465,0.278c-0.506,0.196-1.374,0.31-2.304,0.414c-0.93,0.103-1.912,0.196-2.811,0.496
66
+ c-0.889,0.299-1.809,0.95-2.015,2.024c-0.176,0.94,0.258,1.809,0.837,2.377c0.568,0.558,1.271,0.961,1.942,1.343
67
+ c0.672,0.393,1.322,0.765,1.757,1.126c0.434,0.361,0.609,0.65,0.63,0.971c0.021,0.27-0.165,0.547-0.651,1.014
68
+ c-0.485,0.465-1.188,0.98-1.622,1.849c-1.25,2.489-2.376,7.264-2.407,7.409l-7.088,16.264L104.149,94.83
69
+ c0.393-0.94,0.733-1.912,0.94-2.925c0.65-3.254,0.341-6.756-1.292-9.329c-1.395-2.201-3.916-3.575-6.603-4.175
70
+ c-0.671-0.155-1.363-0.248-2.056-0.299l8.7-43.326l11.221-1.104L114.077,23.11z M113.312,14.958l81.845,4.257l-3.658,10.229
71
+ L166.122,47.95c-0.062-2.914-0.558-6.159-1.591-9.021c-0.692-1.922-1.622-3.678-2.883-5.021c-1.261-1.344-2.872-2.273-4.794-2.428
72
+ c-1.881-0.146-3.575,0.506-4.98,1.621c-1.405,1.116-2.553,2.666-3.493,4.412c-0.051,0.104-0.093,0.217-0.154,0.332l-34.346-16.812
73
+ L113.312,14.958z M112.683,8.118l-26.989,2.128l0.062,0.878l0.889,13.04L49.767,43.083c0.062-0.506,0.083-0.579,0.135-1.281
74
+ c0.113-1.623,0.176-3.523-0.228-4.949c-0.413-1.437-1.426-2.47-2.572-3.183c-1.147-0.713-2.429-1.157-3.575-1.487
75
+ c-2.459-0.703-5.363-0.435-7.667,1.094c-1.157,0.766-2.594,2.129-3.803,3.328c-1.064,1.054-1.705,1.756-1.901,1.953
76
+ c-0.371,0.021-2.635,0.166-4.236,0.248c-0.867,0.041-1.952,0.082-3.027,0.495c-1.074,0.413-2.107,1.292-2.645,2.749
77
+ c-1.023,2.811,0.01,5.383,1.767,7.43c1.446,1.694,3.585,4.422,4.081,5.041c-0.361,0.403-1.085,1.199-2.252,2.625
78
+ c-1.426,1.746-2.945,3.627-3.472,5.084c-0.961,2.645-0.021,6.002,2.396,7.584c0.444,0.289,0.94,0.402,1.457,0.455l-7.677,30.553
79
+ c-1.685,0.402-3.266,0.93-4.505,1.715c-2.79,1.777-5.156,5.568-6.954,8.938c-1.798,3.369-2.966,6.324-2.966,6.324l-0.258,0.65
80
+ l12.854,8.896l0.496-0.785c0,0,1.074-1.715,2.552-3.729c1.251-1.705,2.801-3.585,4.112-4.773l21.11,30.595l-7.398,4.813l9,5.395
81
+ l-2.356,13.102l9.909-9.268l81.793,66.335c-0.909,1.063-1.809,2.324-2.139,3.885c-0.414,1.922,0.154,4.175,2.324,6.2
82
+ c1.116,1.043,2.305,1.581,3.472,1.652c1.168,0.072,2.253-0.311,3.203-0.879c1.912-1.146,3.441-3.079,4.64-4.524
83
+ c1.126-1.354,2.914-2.903,4.691-3.947c1.787-1.043,3.544-1.487,4.505-1.137c0.548,0.195,0.847,0.465,1.095,0.837
84
+ c0.238,0.372,0.414,0.879,0.527,1.509c0.228,1.25,0.217,2.935,0.62,4.629c0.454,1.881,1.88,3.244,3.44,3.979
85
+ c1.561,0.732,3.348,0.93,4.753,0.145c1.312-0.744,2.242-2.17,2.738-3.72s0.558-3.317-0.331-4.723
86
+ c-0.702-1.115-1.322-1.942-1.746-2.666c-0.423-0.724-0.661-1.312-0.723-2.088c-0.052-0.618,0.227-1.188,0.733-1.734
87
+ c0.506-0.537,1.24-1.002,1.859-1.262c0.807-0.341,1.612-0.837,2.264-1.487c0.65-0.642,1.178-1.456,1.239-2.429
88
+ c0.093-1.633-0.692-2.924-1.663-3.833c-0.62-0.578-1.344-0.724-1.892-0.815c-0.258-0.052-0.506-0.093-0.764-0.176l51.001-66.501
89
+ c2.356,1.302,5.353,1.478,8.184,0.879c3.131-0.662,6.106-2.265,7.812-4.66c1.653-2.325,2.107-5.486,1.694-8.504
90
+ c-0.393-2.821-1.581-5.538-3.492-7.389l7.16-38.312l4.03,2.128l14.196-33.157l-16.118-9.33l-29.148-25.285L198.7,9.308
91
+ l-0.537,1.508l-2.377,6.644l-82.64-4.298L112.683,8.118z"/>
92
+ <path id="path4987" inkscape:connector-curvature="0" fill="#B50000" d="M111.07,10.028l2.057,22.051l-24.003,2.365l-1.54-22.565
93
+ L111.07,10.028z"/>
94
+ <path id="path4985" inkscape:connector-curvature="0" fill="#FF6600" d="M199.301,12.933l10.528,13.381l-16.242,2.574
95
+ L199.301,12.933z"/>
96
+ <path id="path4973" inkscape:connector-curvature="0" fill="#9ADE00" d="M156.72,33.247c1.437,0.113,2.604,0.766,3.637,1.87
97
+ c1.023,1.095,1.87,2.646,2.511,4.411c1.271,3.523,1.685,7.904,1.416,11.119c-0.279,3.336-1.446,7.801-3.348,11.221
98
+ c-0.95,1.705-2.077,3.15-3.316,4.102c-1.24,0.94-2.542,1.405-4.04,1.24c-1.468-0.166-2.614-0.878-3.586-2.057
99
+ c-0.971-1.166-1.735-2.811-2.273-4.659c-1.074-3.709-1.25-8.276-0.898-11.593c0.33-3.151,1.395-7.315,3.131-10.529
100
+ c0.868-1.602,1.901-2.965,3.037-3.864C154.116,33.587,155.325,33.133,156.72,33.247z"/>
101
+ <path id="path4971" inkscape:connector-curvature="0" fill="#0084C8" d="M41.49,33.619c0.538,0.042,1.055,0.124,1.55,0.269
102
+ c1.064,0.301,2.212,0.713,3.121,1.281c0.909,0.568,1.55,1.25,1.808,2.17c0.259,0.919,0.279,2.79,0.166,4.34
103
+ c-0.114,1.551-0.3,2.812-0.3,2.812l-0.114,0.765l0.744,0.217c0,0,2.015,0.58,4.36,1.529c2.345,0.95,5.032,2.335,6.179,3.616
104
+ c1.127,1.25,1.675,3.493,1.54,5.858c-0.135,2.365-0.95,4.814-2.181,6.396c-2.593,3.327-6.705,5.383-10.983,4.464
105
+ c-2.046-0.443-4.174-1.975-5.744-3.431c-1.571-1.457-2.562-2.779-2.562-2.779l-0.444-0.589l-0.662,0.331c0,0-3.822,1.86-6.21,4.174
106
+ c-0.991,0.961-2.728,2.108-4.381,2.8c-0.826,0.352-1.632,0.579-2.283,0.661c-0.651,0.072-1.126-0.021-1.364-0.176
107
+ c-1.55-1.013-2.335-3.72-1.694-5.486c0.279-0.754,1.788-2.862,3.183-4.567c1.395-1.704,2.696-3.131,2.696-3.131l0.507-0.558
108
+ l-0.465-0.589c0,0-2.914-3.709-4.588-5.662c-1.529-1.788-2.231-3.513-1.446-5.663c0.372-1.022,0.909-1.437,1.611-1.704
109
+ c0.703-0.279,1.602-0.332,2.47-0.383c1.746-0.093,4.588-0.27,4.588-0.27l0.352-0.021l0.237-0.258c0,0,0.92-1.002,2.098-2.16
110
+ c1.178-1.167,2.635-2.511,3.533-3.101C38.194,33.867,39.889,33.505,41.49,33.619L41.49,33.619z"/>
111
+ <path id="path4969" inkscape:connector-curvature="0" fill="#9EABB0" d="M241.127,53.603l13.979,8.101l-12.812,29.944
112
+ l-15.116-8.008L241.127,53.603z"/>
113
+ <path id="path4965" inkscape:connector-curvature="0" fill="#19AEFF" d="M193.607,77.202l12.161,3.027l-4.846,14.621l-3.338,0.496
114
+ L193.607,77.202z"/>
115
+ <path id="path4963" inkscape:connector-curvature="0" fill="#FF4141" d="M95.023,79.867c0.6,0.042,1.188,0.124,1.777,0.258
116
+ c2.346,0.517,4.443,1.747,5.487,3.39c1.281,2.024,1.632,5.135,1.054,8.028c-0.579,2.894-2.077,5.507-4.112,6.695
117
+ c-2.088,1.219-5.26,1.25-8.163,0.319c-2.903-0.93-5.466-2.811-6.479-5.011c-0.909-1.983-0.62-4.67,0.485-7.14
118
+ c1.116-2.479,3.038-4.691,5.053-5.704C91.47,80.022,93.236,79.744,95.023,79.867z"/>
119
+ <path id="path4953" inkscape:connector-curvature="0" fill="#804D00" d="M144.744,100.708l8.565,11.2l-5.248,21.781l-10.064-17.493
120
+ L144.744,100.708z"/>
121
+ <path id="path4951" inkscape:connector-curvature="0" fill="#9ADE00" d="M29.071,101.504c0.837,0.011,1.002,0.031,1.363,0.042
122
+ l0.537,10.508c-0.475,0.135-1.467,0.403-3.233,1.023c-2.14,0.754-4.629,1.747-6.23,2.936c-1.788,1.332-3.669,3.698-5.188,5.766
123
+ c-1.209,1.652-1.767,2.552-2.098,3.067L4.034,117.8c0.31-0.765,1.167-2.8,2.614-5.496c1.746-3.266,4.174-6.893,6.344-8.277
124
+ c2.346-1.498,6.985-2.211,10.953-2.438C25.93,101.483,27.748,101.483,29.071,101.504z"/>
125
+ <path id="path4945" inkscape:connector-curvature="0" fill="#009100" d="M222.693,128.729c2.924,0,5.931,0.931,7.76,2.501
126
+ c1.705,1.457,2.894,4.02,3.266,6.685c0.371,2.666-0.083,5.415-1.375,7.233c-1.343,1.891-3.957,3.367-6.736,3.957
127
+ c-2.779,0.589-5.652,0.278-7.532-1.033c-2.191-1.529-3.792-4.649-4.319-7.937c-0.527-3.285,0.041-6.664,1.746-8.688
128
+ C217,129.66,219.77,128.74,222.693,128.729z"/>
129
+ <path id="path4943" inkscape:connector-curvature="0" fill="#FFFF3E" d="M180.288,139.331l9.558,7.719l0.362,8.173l-6.841,7.844
130
+ l-8.886-4.093l-2.511-8.959L180.288,139.331z"/>
131
+ <path id="path4941" inkscape:connector-curvature="0" fill="#BA00FF" d="M47.7,140.84l5.073,8.297l7.017-1.633l-3.431,8.245
132
+ l4.618,4.712l-9.247,0.188l-6.819,6.375l1.622-9.041l-7.615-4.567l6.055-3.937L47.7,140.84z"/>
133
+ <path id="path4939" inkscape:connector-curvature="0" fill="#005C94" d="M109.428,141.738l16.016,27.66l-15.045,6.603
134
+ L109.428,141.738z"/>
135
+ <path id="path4927" inkscape:connector-curvature="0" fill="#FF9900" d="M157.474,211.772c1.809,0.071,3.162,1.044,4.31,1.993
136
+ c0.413,0.343,0.743,0.932,1.178,1.645c0.434,0.713,0.991,1.56,1.974,2.159c0.919,0.559,1.735,0.713,2.283,0.815
137
+ c0.558,0.104,0.754,0.136,0.992,0.361c0.754,0.713,1.167,1.385,1.105,2.438c-0.021,0.372-0.259,0.827-0.713,1.271
138
+ c-0.455,0.444-1.085,0.847-1.705,1.116c-0.816,0.341-1.715,0.897-2.459,1.674c-0.734,0.773-1.312,1.849-1.209,3.089
139
+ c0.082,1.085,0.465,1.994,0.961,2.842s1.105,1.663,1.777,2.717c0.485,0.766,0.526,2.017,0.134,3.226s-1.188,2.294-1.922,2.717
140
+ c-0.65,0.372-1.942,0.352-3.12-0.206c-1.178-0.559-2.17-1.55-2.47-2.79c-0.341-1.416-0.33-3.027-0.6-4.536
141
+ c-0.134-0.754-0.351-1.498-0.785-2.159c-0.434-0.66-1.095-1.22-1.974-1.539c-1.88-0.683-4.019,0.104-6.013,1.271
142
+ c-1.995,1.167-3.886,2.8-5.167,4.35c-1.209,1.457-2.696,3.234-4.185,4.134c-0.744,0.455-1.467,0.683-2.18,0.631
143
+ c-0.713-0.042-1.478-0.353-2.366-1.179c-1.829-1.716-2.098-3.161-1.798-4.535c0.289-1.386,1.291-2.738,2.283-3.782
144
+ c0.889-0.94,2.314-1.653,3.596-2.428c0.641-0.384,1.24-0.785,1.726-1.323c0.485-0.537,0.826-1.291,0.744-2.118
145
+ c-0.135-1.312-0.713-2.396-1.52-3.254c-0.806-0.858-1.818-1.529-2.903-2.191c-0.971-0.589-1.726-1.312-1.974-1.891
146
+ c-0.248-0.578-0.258-1.013,0.527-1.818c0.765-0.774,1.994-1.24,3.162-1.188c1.167,0.052,2.231,0.559,2.883,1.716
147
+ c0.867,1.529,1.798,2.49,2.883,2.935c1.074,0.444,2.221,0.259,3.172-0.248c1.818-0.961,3.234-2.646,4.536-4.029
148
+ C153.775,212.485,155.646,211.7,157.474,211.772z"/>
149
+ <path fill="#0084C8" stroke="#000000" stroke-width="2" stroke-miterlimit="10" d="M338.388,106.288h12.192v24.695
150
+ c-6.819,7.512-16.563,11.263-29.241,11.263c-10.674,0-19.611-3.514-26.813-10.539c-7.201-7.026-10.797-15.912-10.797-26.658
151
+ c0-10.745,3.668-19.704,11.004-26.864c7.336-7.162,16.201-10.746,26.606-10.746c10.404,0,19.043,3.027,25.936,9.093l-6.511,9.299
152
+ c-2.819-2.407-5.662-4.081-8.523-5.011c-2.862-0.93-6.18-1.396-9.972-1.396c-7.306,0-13.433,2.355-18.392,7.078
153
+ c-4.96,4.722-7.439,10.921-7.439,18.599c0,7.679,2.407,13.847,7.232,18.495c4.825,4.649,10.663,6.976,17.514,6.976
154
+ c6.852,0,12.585-1.479,17.204-4.443V106.288z"/>
155
+ <path fill="#B50000" stroke="#000000" stroke-width="2" stroke-miterlimit="10" d="M424.251,92.649
156
+ c0,11.914-5.197,19.425-15.602,22.524l18.907,26.244h-15.499l-17.255-24.28h-16.016v24.28h-12.192V69.194h26.864
157
+ c11.025,0,18.909,1.859,23.662,5.58C421.874,78.494,424.251,84.455,424.251,92.649z M408.029,102.878
158
+ c2.479-2.139,3.72-5.559,3.72-10.281c0-4.722-1.271-7.955-3.823-9.713c-2.552-1.756-7.099-2.635-13.639-2.635h-15.499v25.832
159
+ h15.188C400.858,106.081,405.549,105.017,408.029,102.878z"/>
160
+ <path fill="#FF6600" stroke="#000000" stroke-width="2" stroke-miterlimit="10" d="M502.263,131.447
161
+ c-7.306,7.13-16.325,10.693-27.07,10.693c-10.746,0-19.768-3.563-27.072-10.693c-7.305-7.129-10.952-16.015-10.952-26.658
162
+ s3.647-19.528,10.952-26.658c7.306-7.129,16.326-10.694,27.072-10.694c10.745,0,19.766,3.565,27.07,10.694
163
+ c7.306,7.13,10.952,16.017,10.952,26.658S509.558,124.318,502.263,131.447z M493.324,86.243
164
+ c-4.928-5.094-10.974-7.646-18.133-7.646c-7.161,0-13.205,2.553-18.135,7.646c-4.929,5.094-7.389,11.283-7.389,18.547
165
+ s2.46,13.453,7.389,18.546c4.93,5.094,10.974,7.646,18.135,7.646c7.159,0,13.205-2.554,18.133-7.646
166
+ c4.929-5.093,7.389-11.282,7.389-18.546S498.243,91.347,493.324,86.243z"/>
167
+ <path fill="#9ADE00" stroke="#000000" stroke-width="2" stroke-miterlimit="10" d="M540.803,141.418H528.61V69.194h19.012
168
+ l21.803,45.359l21.801-45.359h18.909v72.224h-12.191V85.002l-25.212,50.113h-6.819l-25.108-50.113L540.803,141.418L540.803,141.418
169
+ z"/>
170
+ <path d="M307.142,160.709v13.598c0,2.76-0.743,4.825-2.242,6.2c-1.498,1.374-3.409,2.066-5.755,2.066s-4.464-0.734-6.354-2.201
171
+ l1.55-2.49c1.519,1.157,3.059,1.727,4.618,1.727c1.55,0,2.78-0.403,3.689-1.198c0.909-0.807,1.363-2.077,1.363-3.844v-1.994
172
+ c-0.485,0.919-1.188,1.653-2.098,2.2c-0.909,0.548-1.932,0.815-3.058,0.815c-2.067,0-3.771-0.723-5.104-2.17
173
+ c-1.333-1.446-1.994-3.244-1.994-5.394c0-2.148,0.661-3.947,1.994-5.395s3.027-2.17,5.083-2.17c2.057,0,3.741,0.848,5.022,2.553
174
+ v-2.313h3.285L307.142,160.709L307.142,160.709z M294.98,167.9c0,1.28,0.393,2.387,1.188,3.316
175
+ c0.795,0.931,1.859,1.396,3.192,1.396s2.418-0.444,3.255-1.344c0.826-0.898,1.25-2.016,1.25-3.357c0-1.333-0.424-2.47-1.261-3.399
176
+ c-0.837-0.929-1.922-1.396-3.255-1.396c-1.332,0-2.387,0.476-3.182,1.437C295.373,165.504,294.98,166.63,294.98,167.9z"/>
177
+ <path d="M320.067,163.788c-1.622,0-2.842,0.527-3.668,1.581c-0.816,1.054-1.229,2.47-1.229,4.247v6.685h-3.286v-15.592h3.286v3.131
178
+ c0.527-0.98,1.25-1.776,2.149-2.407c0.908-0.619,1.87-0.95,2.883-0.972l0.031,3.317
179
+ C320.182,163.788,320.119,163.788,320.067,163.788z"/>
180
+ <path d="M336.011,176.301h-2.996v-2.076c-1.292,1.539-3.018,2.314-5.188,2.314c-1.622,0-2.965-0.455-4.029-1.375
181
+ c-1.063-0.919-1.602-2.139-1.602-3.678c0-1.529,0.567-2.688,1.705-3.441c1.137-0.765,2.665-1.146,4.598-1.146h4.247v-0.59
182
+ c0-2.065-1.157-3.109-3.462-3.109c-1.446,0-2.955,0.527-4.517,1.581l-1.467-2.058c1.892-1.508,4.04-2.252,6.447-2.252
183
+ c1.84,0,3.338,0.465,4.495,1.396c1.157,0.93,1.746,2.387,1.746,4.381v10.054L336.011,176.301L336.011,176.301z M332.725,170.505
184
+ v-1.323h-3.688c-2.366,0-3.544,0.744-3.544,2.232c0,0.765,0.289,1.343,0.878,1.746c0.589,0.402,1.405,0.599,2.449,0.599
185
+ s1.963-0.289,2.737-0.878S332.725,171.496,332.725,170.505z"/>
186
+ <path d="M348.927,160.472c2.087,0,3.875,0.724,5.362,2.17c1.488,1.446,2.232,3.368,2.232,5.775c0,2.408-0.734,4.36-2.213,5.859
187
+ c-1.478,1.508-3.191,2.252-5.154,2.252c-1.964,0-3.73-0.857-5.291-2.583v8.027h-3.285v-21.273h3.285v2.728
188
+ C345.155,161.464,346.84,160.472,348.927,160.472z M343.802,168.531c0,1.486,0.444,2.696,1.343,3.646
189
+ c0.899,0.95,1.994,1.427,3.286,1.427c1.291,0,2.418-0.466,3.368-1.405c0.961-0.94,1.438-2.149,1.438-3.647s-0.465-2.737-1.405-3.72
190
+ s-2.066-1.478-3.368-1.478c-1.312,0-2.418,0.495-3.316,1.478C344.256,165.813,343.802,167.054,343.802,168.531z"/>
191
+ <path d="M363.558,167.859v8.44h-3.285v-21.719h3.285v8.969c0.466-0.961,1.179-1.705,2.13-2.253
192
+ c0.949-0.547,1.963-0.815,3.058-0.815c1.757,0,3.183,0.537,4.268,1.611s1.622,2.624,1.622,4.66v9.559h-3.285v-8.557
193
+ c0-2.872-1.188-4.309-3.574-4.309c-1.138,0-2.118,0.372-2.955,1.126C363.971,165.317,363.558,166.413,363.558,167.859z"/>
194
+ <path d="M400.279,174.203c-1.561,1.55-3.514,2.325-5.858,2.325s-4.298-0.775-5.858-2.325c-1.56-1.55-2.346-3.45-2.346-5.703
195
+ c0-2.242,0.785-4.144,2.346-5.704c1.562-1.55,3.514-2.324,5.858-2.324s4.299,0.774,5.858,2.324
196
+ c1.561,1.551,2.346,3.451,2.346,5.704C402.615,170.753,401.84,172.653,400.279,174.203z M390.888,172.188
197
+ c0.931,0.95,2.107,1.426,3.533,1.426s2.604-0.476,3.534-1.426s1.395-2.171,1.395-3.679c0-1.509-0.465-2.729-1.395-3.679
198
+ c-0.931-0.951-2.108-1.426-3.534-1.426s-2.604,0.475-3.533,1.426c-0.931,0.95-1.396,2.17-1.396,3.679
199
+ C389.492,170.009,389.957,171.238,390.888,172.188z"/>
200
+ <path d="M414.693,160.472c2.087,0,3.875,0.724,5.362,2.17s2.231,3.368,2.231,5.775c0,2.408-0.733,4.36-2.211,5.859
201
+ c-1.479,1.508-3.193,2.252-5.156,2.252s-3.729-0.857-5.29-2.583v2.346h-3.286v-21.75h3.286v8.875
202
+ C410.912,161.464,412.606,160.472,414.693,160.472z M409.568,168.531c0,1.486,0.443,2.696,1.344,3.646
203
+ c0.897,0.95,1.994,1.427,3.285,1.427c1.292,0,2.418-0.466,3.369-1.405c0.961-0.94,1.436-2.149,1.436-3.647s-0.465-2.737-1.405-3.72
204
+ c-0.938-0.981-2.065-1.478-3.368-1.478c-1.312,0-2.418,0.495-3.315,1.478C410.013,165.813,409.568,167.054,409.568,168.531z"/>
205
+ <path d="M426.039,177.034v-16.325h3.285v16.439c0,1.643-0.496,2.943-1.479,3.916c-0.99,0.972-2.18,1.445-3.574,1.445
206
+ c-1.396,0-2.677-0.517-3.822-1.55l1.519-2.459c0.661,0.641,1.333,0.972,2.005,0.972c0.671,0,1.188-0.218,1.539-0.641
207
+ C425.863,178.389,426.039,177.799,426.039,177.034z M426.184,157.609c-0.412-0.413-0.619-0.899-0.619-1.468
208
+ c0-0.567,0.207-1.055,0.619-1.468c0.413-0.413,0.898-0.62,1.468-0.62c0.568,0,1.055,0.207,1.468,0.62s0.62,0.899,0.62,1.468
209
+ c0,0.567-0.207,1.055-0.62,1.468s-0.899,0.62-1.468,0.62C427.082,158.219,426.597,158.013,426.184,157.609z"/>
210
+ <path d="M448.574,169.946H436.35c0.083,1.137,0.601,2.046,1.551,2.737c0.961,0.692,2.057,1.044,3.285,1.044
211
+ c1.953,0,3.44-0.619,4.453-1.85l1.881,2.056c-1.685,1.736-3.863,2.604-6.562,2.604c-2.19,0-4.05-0.724-5.579-2.181
212
+ s-2.305-3.409-2.305-5.858s0.785-4.401,2.346-5.849c1.562-1.446,3.399-2.17,5.528-2.17c2.118,0,3.926,0.641,5.402,1.922
213
+ c1.488,1.28,2.232,3.049,2.232,5.291v2.252L448.574,169.946L448.574,169.946z M436.351,167.363h8.938
214
+ c0-1.312-0.413-2.314-1.229-3.018c-0.815-0.703-1.828-1.055-3.036-1.055c-1.199,0-2.284,0.362-3.234,1.096
215
+ C436.826,165.121,436.351,166.113,436.351,167.363z"/>
216
+ <path d="M459.093,176.539c-2.17,0-4.028-0.734-5.601-2.212c-1.561-1.479-2.346-3.399-2.346-5.786s0.815-4.318,2.448-5.817
217
+ c1.633-1.498,3.616-2.241,5.962-2.241c2.347,0,4.329,0.807,5.952,2.429l-1.933,2.376c-1.344-1.167-2.707-1.756-4.071-1.756
218
+ c-1.363,0-2.552,0.454-3.563,1.362c-1.003,0.909-1.51,2.077-1.51,3.515c0,1.436,0.496,2.655,1.498,3.646
219
+ c1.003,0.991,2.223,1.498,3.68,1.498s2.83-0.661,4.122-1.994l1.933,2.107C463.763,175.578,461.572,176.539,459.093,176.539z"/>
220
+ <path d="M473.104,163.344v7.915c0,0.744,0.196,1.333,0.59,1.777c0.393,0.444,0.939,0.661,1.644,0.661
221
+ c0.702,0,1.374-0.341,2.024-1.022l1.344,2.314c-1.157,1.033-2.428,1.55-3.823,1.55c-1.395,0-2.594-0.486-3.575-1.447
222
+ c-0.991-0.971-1.478-2.271-1.478-3.916v-7.82h-1.963v-2.636h1.963v-4.896h3.286v4.896h4.102v2.636h-4.111v-0.012H473.104z"/>
223
+ <path d="M492.622,167.859v8.44h-3.286v-15.591h3.286v2.842c0.465-0.961,1.178-1.705,2.129-2.253
224
+ c0.95-0.547,1.963-0.815,3.059-0.815c2.459,0,4.134,1.013,5.012,3.049c1.54-2.036,3.472-3.049,5.775-3.049
225
+ c1.756,0,3.183,0.538,4.268,1.611c1.085,1.074,1.623,2.624,1.623,4.66v9.559H511.2v-8.557c0-2.872-1.188-4.309-3.575-4.309
226
+ c-1.116,0-2.087,0.36-2.914,1.074c-0.826,0.713-1.261,1.757-1.302,3.12v8.68h-3.285v-8.556c0-1.487-0.271-2.572-0.796-3.266
227
+ c-0.527-0.692-1.354-1.043-2.49-1.043s-2.118,0.371-2.955,1.126C493.035,165.317,492.622,166.413,492.622,167.859z"/>
228
+ <path d="M531.68,176.301h-2.985v-2.076c-1.292,1.539-3.019,2.314-5.188,2.314c-1.622,0-2.965-0.455-4.029-1.375
229
+ c-1.063-0.919-1.602-2.139-1.602-3.678c0-1.529,0.568-2.688,1.705-3.441c1.137-0.765,2.665-1.146,4.598-1.146h4.247v-0.59
230
+ c0-2.065-1.157-3.109-3.462-3.109c-1.445,0-2.955,0.527-4.515,1.581l-1.468-2.058c1.891-1.508,4.039-2.252,6.446-2.252
231
+ c1.841,0,3.338,0.465,4.495,1.396c1.157,0.93,1.746,2.387,1.746,4.381v10.054L531.68,176.301L531.68,176.301z M528.404,170.505
232
+ v-1.323h-3.689c-2.366,0-3.544,0.744-3.544,2.232c0,0.765,0.289,1.343,0.879,1.746c0.589,0.402,1.404,0.599,2.448,0.599
233
+ s1.963-0.289,2.738-0.878C528.011,172.292,528.404,171.496,528.404,170.505z"/>
234
+ <path d="M544.605,160.472c2.087,0,3.875,0.724,5.361,2.17c1.488,1.446,2.232,3.368,2.232,5.775c0,2.408-0.734,4.36-2.212,5.859
235
+ c-1.479,1.508-3.192,2.252-5.155,2.252c-1.964,0-3.73-0.857-5.291-2.583v8.027h-3.285v-21.273h3.285v2.728
236
+ C540.823,161.464,542.519,160.472,544.605,160.472z M539.48,168.531c0,1.486,0.443,2.696,1.343,3.646
237
+ c0.898,0.95,1.994,1.427,3.286,1.427s2.418-0.466,3.367-1.405c0.961-0.94,1.438-2.149,1.438-3.647s-0.465-2.737-1.405-3.72
238
+ c-0.939-0.982-2.065-1.478-3.368-1.478c-1.312,0-2.418,0.495-3.316,1.478C539.925,165.813,539.48,167.054,539.48,168.531z"/>
239
+ <path d="M564.3,160.472c2.087,0,3.874,0.724,5.362,2.17c1.487,1.446,2.23,3.368,2.23,5.775c0,2.408-0.732,4.36-2.211,5.859
240
+ c-1.478,1.508-3.191,2.252-5.155,2.252s-3.729-0.857-5.29-2.583v8.027h-3.286v-21.273h3.286v2.728
241
+ C560.518,161.464,562.212,160.472,564.3,160.472z M559.175,168.531c0,1.486,0.443,2.696,1.343,3.646s1.994,1.427,3.286,1.427
242
+ c1.291,0,2.417-0.466,3.368-1.405c0.961-0.94,1.438-2.149,1.438-3.647s-0.467-2.737-1.405-3.72
243
+ c-0.94-0.981-2.067-1.478-3.369-1.478c-1.312,0-2.417,0.495-3.316,1.478C559.62,165.814,559.175,167.054,559.175,168.531z"/>
244
+ <path d="M590.151,169.946h-12.225c0.083,1.137,0.601,2.046,1.55,2.737c0.961,0.692,2.058,1.044,3.286,1.044
245
+ c1.953,0,3.44-0.619,4.453-1.85l1.881,2.056c-1.685,1.736-3.863,2.604-6.562,2.604c-2.19,0-4.05-0.724-5.579-2.181
246
+ s-2.305-3.409-2.305-5.858s0.784-4.401,2.346-5.849c1.561-1.446,3.399-2.17,5.528-2.17c2.117,0,3.926,0.641,5.402,1.922
247
+ c1.488,1.28,2.232,3.049,2.232,5.291v2.252L590.151,169.946L590.151,169.946z M577.928,167.363h8.938
248
+ c0-1.312-0.414-2.314-1.23-3.018c-0.814-0.703-1.828-1.055-3.037-1.055c-1.198,0-2.283,0.362-3.233,1.096
249
+ C578.403,165.121,577.928,166.113,577.928,167.363z"/>
250
+ <path d="M601.931,163.788c-1.622,0-2.842,0.527-3.668,1.581c-0.815,1.054-1.229,2.47-1.229,4.247v6.685h-3.286v-15.592h3.286v3.131
251
+ c0.525-0.98,1.25-1.776,2.148-2.407c0.909-0.619,1.87-0.95,2.884-0.972l0.029,3.317
252
+ C602.044,163.788,601.993,163.788,601.931,163.788z"/>
253
+ </g>
254
+ </svg>
@@ -7,5 +7,7 @@ require_relative 'grom/node'
7
7
  require_relative 'grom/helper'
8
8
  require_relative 'grom/builder'
9
9
 
10
+ # Namespace for graph object mapper that converts n-triple data to Ruby objects.
11
+ # @since 0.1.0
10
12
  module Grom
11
13
  end
@@ -1,13 +1,21 @@
1
1
  module Grom
2
+ # Builds Grom::Node objects from a Grom::Reader instance.
3
+ #
4
+ # @since 0.1.0
5
+ # @attr_reader [Array] objects Grom::Node objects generated from n-triple data.
2
6
  class Builder
3
7
  attr_reader :objects
4
8
 
9
+ # @param [Grom::Reader] reader a Grom::Reader instance populated with data.
5
10
  def initialize(reader)
6
11
  @reader = reader
7
12
 
8
13
  build_objects
9
14
  end
10
15
 
16
+ # Builds and links Grom::Node objects from n-triple data.
17
+ #
18
+ # @return [Array] array of linked Grom::Node objects.
11
19
  def build_objects
12
20
  build_objects_by_subject
13
21
  link_objects
@@ -15,12 +23,13 @@ module Grom
15
23
  @objects
16
24
  end
17
25
 
18
- def initialize_objects_hashes
19
- @objects, @objects_by_subject = [], {}
20
- end
21
-
26
+ # Builds Grom::Node objects from n-triple data grouping by their subject.
27
+ #
28
+ # @return [Grom::Builder] an instance of self.
22
29
  def build_objects_by_subject
23
- initialize_objects_hashes
30
+ @objects = []
31
+ @objects_by_subject = {}
32
+
24
33
  @reader.statements_by_subject.each do |subject, statements|
25
34
  object = Grom::Node.new(statements)
26
35
  @objects_by_subject[subject] = object
@@ -30,21 +39,21 @@ module Grom
30
39
  self
31
40
  end
32
41
 
42
+ # Links Grom::Node objects together by predicate and object.
43
+ #
44
+ # @return [Grom::Builder] an instance of self.
33
45
  def link_objects
34
46
  @reader.edges_by_subject.each do |subject, predicates|
35
47
  predicates.each do |predicate, object_uris|
36
48
  current_node = @objects_by_subject[subject]
37
49
 
38
50
  object_uris.each do |object_uri|
39
-
40
51
  predicate_name_symbol = "@#{predicate}".to_sym
41
52
  object_array = current_node.instance_variable_get(predicate_name_symbol)
42
53
  object_array = [] if object_array.is_a?(String)
43
54
  object_array << @objects_by_subject[object_uri]
44
-
45
- current_node.instance_variable_set(predicate_name_symbol, object_array)
46
55
 
47
- # TODO: Not sure about the above conditional
56
+ current_node.instance_variable_set(predicate_name_symbol, object_array)
48
57
  end
49
58
  end
50
59
  end
@@ -1,5 +1,13 @@
1
1
  module Grom
2
+ # Namespace for helper methods.
2
3
  module Helper
4
+ # Creates a symbol in instance variable format which has been underscored, pluralized and downcased.
5
+ #
6
+ # @param [String] string instance variable name.
7
+ # @example Create a pluralized instance variable symbol
8
+ # Grom::Helper.pluralize_instance_variable_symbol('sittingHasPerson') #=> :@sitting_has_people
9
+ #
10
+ # @return [Symbol] instance variable name as a symbol.
3
11
  def self.pluralize_instance_variable_symbol(string)
4
12
  string = ActiveSupport::Inflector.underscore(string)
5
13
  string = ActiveSupport::Inflector.pluralize(string).downcase
@@ -7,11 +15,28 @@ module Grom
7
15
  "@#{string}".to_sym
8
16
  end
9
17
 
18
+ # Creates or inserts an array and values into a hash.
19
+ #
20
+ # @param [Hash] hash
21
+ # @param [String, Symbol] key the key to use in the hash.
22
+ # @param [Object] value the value to attribute to the key.
23
+ # @example Adding values to an existing array within the hash
24
+ # Grom::Helper.lazy_array_insert({ :numbers => [1, 2, 3] }, :numbers, 4) #=> [1, 2, 3, 4]
25
+ #
26
+ # @example Adding values to a hash with no existing array
27
+ # Grom::Helper.lazy_array_insert({}, :numbers, 4) #=> [4]
28
+ #
29
+ # @return [Array] array with values inserted
10
30
  def self.lazy_array_insert(hash, key, value)
11
31
  hash[key] ||= []
12
32
  hash[key] << value
13
33
  end
14
34
 
35
+ # Returns the last part of a uri
36
+ #
37
+ # @param [String] uri uri
38
+ # @return [String] the last part of the uri or 'type' if the uri is an RDF type uri
39
+ # @return [nil] if the uri is not valid
15
40
  def self.get_id(uri)
16
41
  return nil if uri.to_s['/'].nil?
17
42
 
@@ -1,21 +1,76 @@
1
1
  module Grom
2
+ # A Ruby object populated with n-triple data.
3
+ #
4
+ # @since 0.1.0
5
+ # @attr_reader [Array] statements an array of n-triple statements.
2
6
  class Node
7
+ BLANK = 'blank_node'.freeze
8
+
3
9
  attr_reader :statements
4
10
 
11
+ # @param [Array] statements an array of n-triple statements.
5
12
  def initialize(statements)
6
13
  @statements = statements
7
14
 
8
15
  populate
9
16
  end
10
17
 
18
+ # Allows the user to access instance variables as methods or raise an error if the variable is not defined.
19
+ #
20
+ # @param [Symbol] method name of method.
21
+ # @param [Array] *params extra arguments to pass to super.
22
+ # @param [Block] &block block to pass to super.
23
+ # @example Accessing instance variables populated from statements
24
+ # statements = [
25
+ # RDF::Statement.new(RDF::URI.new('http://example.com/123'), RDF.type, 'Person'),
26
+ # RDF::Statement.new(RDF::URI.new('http://example.com/123'), RDF::URI.new('http://example.com/forename'), 'Jane'),
27
+ # RDF::Statement.new(RDF::URI.new('http://example.com/123'), RDF::URI.new('http://example.com/surname'), 'Smith')
28
+ # ]
29
+ #
30
+ # node = Grom::Node.new(statements)
31
+ #
32
+ # node.forename #=> 'Jane'
33
+ #
34
+ # @example Accessing instance variables created on the fly
35
+ # statements = [RDF::Statement.new(RDF::URI.new('http://example.com/123'), RDF.type, 'Person')]
36
+ #
37
+ # node = Grom::Node.new(statements)
38
+ # node.instance_variable_set('@foo', 'bar')
39
+ #
40
+ # node.foo #=> 'bar'
41
+ #
42
+ # @raise [NoMethodError] raises error if the method does not exist.
11
43
  def method_missing(method, *params, &block)
12
44
  instance_variable_get("@#{method}".to_sym) || super
13
45
  end
14
46
 
15
- def respond_to_missing?(method, include_private = false)
47
+ # Allows the user to check if a Grom::Node responds to an instance variable
48
+ #
49
+ # @param [Symbol] method name of method.
50
+ # @param [Boolean] include_all indicates whether to include private and protected methods (defaults to false).
51
+ # @example Using respond_to?
52
+ #
53
+ # statements = [
54
+ # RDF::Statement.new(RDF::URI.new('http://example.com/123'), RDF.type, 'Person'),
55
+ # RDF::Statement.new(RDF::URI.new('http://example.com/123'), RDF::URI.new('http://example.com/forename'), 'Jane'),
56
+ # RDF::Statement.new(RDF::URI.new('http://example.com/123'), RDF::URI.new('http://example.com/surname'), 'Smith')
57
+ # ]
58
+
59
+ # node = Grom::Node.new(statements)
60
+ #
61
+ # node.respond_to?(:forename) #=> 'Jane'
62
+ # node.respond_to?(:foo) #=> false
63
+ def respond_to_missing?(method, include_all = false)
16
64
  instance_variable_get("@#{method}".to_sym) || super
17
65
  end
18
66
 
67
+ # Checks if Grom::Node is a blank node
68
+ #
69
+ # @return [Boolean] a boolean depending on whether or not the Grom::Node is a blank node
70
+ def blank?
71
+ @statements.first.subject.anonymous?
72
+ end
73
+
19
74
  private
20
75
 
21
76
  def set_graph_id
@@ -1,7 +1,15 @@
1
1
  module Grom
2
+ # Reads n-triple data and passes it to a Grom::Builder instance to create objects
3
+ #
4
+ # @since 0.1.0
5
+ # @attr_reader [String] data n-triple data.
6
+ # @attr_reader [Hash] statements_by_subject statements grouped by subject.
7
+ # @attr_reader [Hash] edges_by_subject subjects connected to objects which are uris via their predicates.
8
+ # @attr_reader [Array] objects Grom::Node objects generated from n-triple data.
2
9
  class Reader
3
- attr_reader :data, :statements_by_subject, :subjects_by_type, :edges_by_subject, :objects
10
+ attr_reader :data, :statements_by_subject, :edges_by_subject, :objects
4
11
 
12
+ # @param [String] data n-triple data.
5
13
  def initialize(data)
6
14
  @data = data
7
15
 
@@ -10,23 +18,23 @@ module Grom
10
18
  @objects = Grom::Builder.new(self).objects
11
19
  end
12
20
 
21
+ # Reads the n-triple data and separates the statements by subject.
22
+ #
23
+ # @return [Grom::Reader] an instance of self.
13
24
  def read_data
14
- # Reset all our hashes just in case
15
- @statements_by_subject = {}
25
+ @statements_by_subject = {}
16
26
 
17
- # TODO: Find a better name for this hash!
18
27
  @edges_by_subject = {}
19
28
 
20
29
  RDF::NTriples::Reader.new(@data) do |reader|
21
30
  reader.each_statement do |statement|
22
31
  subject = statement.subject.to_s
23
32
 
24
- # TODO: Use Ruby key value syntax in below method.
25
33
  Grom::Helper.lazy_array_insert(@statements_by_subject, subject, statement)
26
34
 
27
35
  predicate = statement.predicate.to_s
28
36
 
29
- if (statement.object =~ URI.regexp) == 0 && predicate != RDF.type.to_s
37
+ if statement.object.uri? && predicate != RDF.type.to_s
30
38
  predicate = Grom::Helper.get_id(predicate)
31
39
  @edges_by_subject[subject] ||= {}
32
40
  @edges_by_subject[subject][predicate] ||= []
@@ -1,3 +1,3 @@
1
1
  module Grom
2
- VERSION = '0.3.5'.freeze
2
+ VERSION = '0.3.6'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grom
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rebecca Appleyard
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2017-02-06 00:00:00.000000000 Z
13
+ date: 2017-03-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rdf
@@ -132,6 +132,7 @@ files:
132
132
  - Rakefile
133
133
  - bin/console
134
134
  - bin/setup
135
+ - docs/logo.svg
135
136
  - grom.gemspec
136
137
  - lib/grom.rb
137
138
  - lib/grom/builder.rb
@@ -159,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
159
160
  version: '0'
160
161
  requirements: []
161
162
  rubyforge_project:
162
- rubygems_version: 2.5.1
163
+ rubygems_version: 2.6.6
163
164
  signing_key:
164
165
  specification_version: 4
165
166
  summary: Grom is a Graph Object Mapper