subject 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/LICENSE +20 -0
  2. data/README.markdown +88 -0
  3. metadata +159 -0
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2010 Benjamin Bock, Topic Maps Lab, http://www.topicmapslab.de
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,88 @@
1
+ # subj3ct - The DNS for the Semantic Web
2
+
3
+ This is a Ruby adapter for the subj3ct.com webservice.
4
+
5
+ Subj3ct is an infrastructure technology for Web 3.0 applications. These are
6
+ applications that are organised around subjects and semantics rather than
7
+ documents and links. Subj3ct provides the technology and services to enable
8
+ Web 3.0 applications to define and exchange subject definitions.
9
+
10
+ Or in other words: Subj3ct.com is for the Semantic Web what DNS is for the internet.
11
+
12
+ ## Quick Links
13
+
14
+ * [Subj3ct.com](http://www.subj3ct.com/)
15
+ * [Wiki](http://wiki.github.com/bb/subj3ct)
16
+ * [Bugs](http://github.com/bb/subj3ct/issues)
17
+ * [Gem](http://rubygems.org/gems/subj3ct)
18
+
19
+ ## Installing
20
+
21
+ Install the gem:
22
+
23
+ gem install subj3ct
24
+
25
+ ## Usage
26
+
27
+ First, you have to require the library in your Ruby project (or directly in IRB):
28
+
29
+ require 'subj3ct'
30
+
31
+ Then you can query the subj3ct.com webservice with different queries:
32
+
33
+ Query a specific subject - to be specific: its subject identity record - using it's identifier:
34
+
35
+ Subj3ct.identifier("http://www.topicmapslab.de/publications/TMRA_2009_subj3ct_a_subject_identity_resolution_service")
36
+
37
+ Query all subjects associated with a given resource (i.e. with a given web address). The result is a list of subjects (without representation or equivalence statements):
38
+
39
+ Subj3ct.resource("http://en.wikipedia.org/wiki/Topic_Maps")
40
+
41
+ To get the representation and equivalence statements for one of the results you can fetch the complete subject record:
42
+
43
+ result = Subj3ct.resource("http://en.wikipedia.org/wiki/Topic_Maps")
44
+ full_subject = result.subjects.first.fetch
45
+
46
+ If you don't know a web address or identifier URI for the thing you're interested in, try a full text search:
47
+
48
+ Subj3ct.search("my query")
49
+
50
+ To query a specific number of items at a time, the query methods `identifier`, `resource`, `starts_with` and `search` accept a keyword parameter `:take` to specify the maximum number of items to query. The maximum allowed take is 50.
51
+ To display the results paginated, an offset, may be passed using the `:skip` keyword. The search results also feature methods like `fetch_next` to get the next page etc.. The following example fetches the first 5 pages, each page showing 3 results, then it fetches page 20:
52
+
53
+ result = Subj3ct.search("benjamin bock", :take => 3)
54
+ while result.next? && result.current_page < 5
55
+ result = result.fetch_next
56
+ end
57
+
58
+ result.fetch_page(20)
59
+
60
+ ## Subj3ct vs. Subject
61
+
62
+ The official name is "Subj3ct", however in this API, you can also use "Subject" which may be easier to remember or to type for normal, n0n-1337 people. It should work for the gem, for the require and for the main module.
63
+
64
+ ## Plans
65
+
66
+ * starts_with doesn't work at all. It looks like this is a server side problem.
67
+ * Documentation. Currently the code is barely documented, this should be changed soon.
68
+ * Write tests. Uh... of course we have tests... they're almost done...
69
+ * Write support. Currently this lib is only reading subj3ct.com. It should be able to register feeds with the service and to create a feed from existing data.
70
+ * Caching. A minimal caching solution should be built in.
71
+ * Reduce dependencies. Currently this lib uses active_support only for `blank?`. Instead of open-uri a direct HTTP call could be done.
72
+ * Threadsafe use of unencrypted and SSL usage in parallel. Due to the current architecture, you can't do SSL-encrypted and unencrypted queries in parallel in a threadsafe way. To work around that, the class methods should be moved to a query processor which should be instantiated and configured if this is needed.
73
+
74
+ ## Contribute!
75
+
76
+ Subj3ct is a young and ambitious service. It's free, will stay free and needs your help. Contribute to this library! Create bindings for other languages! Publish your data as linked data to the web and register it with subj3ct.com.
77
+
78
+ ## Note on Patches/Pull Requests
79
+
80
+ * Fork the project.
81
+ * Make your feature addition or bug fix.
82
+ * Add tests for it. This is important so I don't break it in a future version unintentionally.
83
+ * Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
84
+ * Send me a pull request. Bonus points for topic branches.
85
+
86
+ ## Copyright
87
+
88
+ Copyright (c) 2010 Benjamin Bock, [Topic Maps Lab](http://www.topicmapslab.de/). See LICENSE for details.
metadata ADDED
@@ -0,0 +1,159 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: subject
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Benjamin Bock
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-06-15 00:00:00 +02:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: rspec
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 13
30
+ segments:
31
+ - 1
32
+ - 2
33
+ - 9
34
+ version: 1.2.9
35
+ type: :development
36
+ version_requirements: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ name: yard
39
+ prerelease: false
40
+ requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ hash: 3
46
+ segments:
47
+ - 0
48
+ version: "0"
49
+ type: :development
50
+ version_requirements: *id002
51
+ - !ruby/object:Gem::Dependency
52
+ name: subj3ct
53
+ prerelease: false
54
+ requirement: &id003 !ruby/object:Gem::Requirement
55
+ none: false
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ hash: 29
60
+ segments:
61
+ - 0
62
+ - 0
63
+ - 1
64
+ version: 0.0.1
65
+ type: :runtime
66
+ version_requirements: *id003
67
+ description: |
68
+ ==== subj3ct - The DNS for the Semantic Web
69
+
70
+ This is a Ruby adapter for the subj3ct.com webservice.
71
+
72
+ Subj3ct is an infrastructure technology for Web 3.0 applications. These are
73
+ applications that are organised around subjects and semantics rather than
74
+ documents and links. Subj3ct provides the technology and services to enable
75
+ Web 3.0 applications to define and exchange subject definitions.
76
+
77
+ Or in other words: Subj3ct.com is for the Semantic Web what DNS is for the internet.
78
+
79
+ ==== Installing
80
+
81
+ Install the gem:
82
+
83
+ gem install subj3ct
84
+
85
+ ==== Usage
86
+
87
+ Query a specific subject - to be specific: its subject identity record - using it's identifier:
88
+
89
+ Subj3ct.identifier("http://www.topicmapslab.de/publications/TMRA_2009_subj3ct_a_subject_identity_resolution_service")
90
+
91
+ See the README or the github page for more examples.
92
+
93
+ ==== Subj3ct vs. Subject
94
+
95
+ The official name is "Subj3ct", however in this API, you can also use "Subject" which may be easier to remember or to type for normal, n0n-1337 people. It should work for the gem, for the require and for the main module.
96
+
97
+ ==== Contribute!
98
+
99
+ Subj3ct is a young and ambitious service. It's free, will stay free and needs your help. Contribute to this library! Create bindings for other languages! Publish your data as linked data to the web and register it with subj3ct.com.
100
+
101
+ ==== Note on Patches/Pull Requests
102
+
103
+ * Fork the project on http://github.bb/subj3ct
104
+ * Make your feature addition or bug fix.
105
+ * Add tests for it. This is important so I don't break it in a future version unintentionally.
106
+ * Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
107
+ * Send me a pull request. Bonus points for topic branches.
108
+
109
+ ==== Copyright
110
+
111
+ Copyright (c) 2010 Benjamin Bock, Topic Maps Lab. See LICENSE for details.
112
+
113
+ email: bb--github.com@bock.be
114
+ executables: []
115
+
116
+ extensions: []
117
+
118
+ extra_rdoc_files:
119
+ - LICENSE
120
+ - README.markdown
121
+ files:
122
+ - LICENSE
123
+ - README.markdown
124
+ has_rdoc: true
125
+ homepage: http://github.com/bb/subj3ct
126
+ licenses: []
127
+
128
+ post_install_message:
129
+ rdoc_options:
130
+ - --charset=UTF-8
131
+ require_paths:
132
+ - lib
133
+ required_ruby_version: !ruby/object:Gem::Requirement
134
+ none: false
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ hash: 3
139
+ segments:
140
+ - 0
141
+ version: "0"
142
+ required_rubygems_version: !ruby/object:Gem::Requirement
143
+ none: false
144
+ requirements:
145
+ - - ">="
146
+ - !ruby/object:Gem::Version
147
+ hash: 3
148
+ segments:
149
+ - 0
150
+ version: "0"
151
+ requirements: []
152
+
153
+ rubyforge_project:
154
+ rubygems_version: 1.3.7
155
+ signing_key:
156
+ specification_version: 3
157
+ summary: Ruby bindings for Subj3ct.com, the DNS for the semantic web.
158
+ test_files: []
159
+