activerdf 1.1 → 1.2

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -9,15 +9,16 @@ See http://www.activerdf.org for more information.
9
9
 
10
10
  == Getting Started
11
11
 
12
- See http://wiki.activerdf.org/GettingStartedGuide for information on how to install
13
- ActiveRDF, get it running with some data sources, and start using it.
12
+ See http://wiki.activerdf.org/GettingStartedGuide for information on how to
13
+ install ActiveRDF, point to data sources, and use it. In brief: "gem install
14
+ activerdf_sparql".
14
15
 
15
16
  == Simple Example
16
17
 
17
18
  The following example uses a SPARQL endpoint with FOAF data and displays all
18
19
  people found in the data source:
19
20
 
20
- require 'active_rdf'
21
+ require 'activerdf'
21
22
  ConnectionPool.add_data_source :type => :sparql, :host => '...'
22
23
  Namespace.register :foaf, 'http://xmlns.com/foaf/0.1/'
23
24
  ObjectManager.construct_classes
data/Rakefile CHANGED
@@ -30,7 +30,7 @@ desc 'test and package gem'
30
30
  task :default => :install
31
31
 
32
32
  # get ActiveRdfVersion from commandline
33
- ActiveRdfVersion = ENV['REL'] || '1.0'
33
+ ActiveRdfVersion = '1.2'
34
34
  NAME="activerdf"
35
35
  GEMNAME="#{NAME}-#{ActiveRdfVersion}.gem"
36
36
 
@@ -53,7 +53,7 @@ class FederationManager
53
53
  results.flatten! if q.select_clauses.size == 1 or q.ask?
54
54
 
55
55
  # and remove array (return single value) unless asked not to
56
- if options[:flatten]
56
+ if options[:flatten] or q.count?
57
57
  case results.size
58
58
  when 0
59
59
  final_results = nil
@@ -290,10 +290,10 @@ module RDFS
290
290
  "<#{uri}>"
291
291
  end
292
292
 
293
- # label of resource (rdfs:label if available, uri otherwise)
294
- def label
295
- get_property_value(Namespace.lookup(:rdfs,:label)) || uri
296
- end
293
+ # # label of resource (rdfs:label if available, uri otherwise)
294
+ # def label
295
+ # get_property_value(Namespace.lookup(:rdfs,:label)) || uri
296
+ # end
297
297
 
298
298
  private
299
299
  def get_property_value(predicate, args=[])
@@ -102,7 +102,7 @@ class Query
102
102
  raise(ActiveRdfError, "cannot add a where clause with p #{p}: p must be a resource or a variable")
103
103
  end
104
104
 
105
- @where_clauses << [s,p,o,c].collect{|arg| parametrise(arg)}.compact
105
+ @where_clauses << [s,p,o,c].collect{|arg| parametrise(arg)}
106
106
  end
107
107
  self
108
108
  end
@@ -23,8 +23,9 @@ class Query2SPARQL
23
23
  # concatenate each where clause using space (e.g. 's p o')
24
24
  # and concatenate the clauses using dot, e.g. 's p o . s2 p2 o2 .'
25
25
  def self.where_clauses(query)
26
- where_clauses = query.where_clauses.collect do |triple|
27
- triple.collect {|term| construct_clause(term)}.join(' ')
26
+ where_clauses = query.where_clauses.collect do |s,p,o,c|
27
+ # ignore context parameter
28
+ [s,p,o].collect {|term| construct_clause(term) }.join(' ')
28
29
  end
29
30
  "#{where_clauses.join('. ')} ."
30
31
  end
@@ -43,5 +44,4 @@ class Query2SPARQL
43
44
  #declare the class level methods as private with these directives
44
45
  private_class_method :where_clauses
45
46
  private_class_method :construct_clause
46
-
47
47
  end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: activerdf
5
5
  version: !ruby/object:Gem::Version
6
- version: "1.1"
7
- date: 2006-12-08 00:00:00 +00:00
6
+ version: "1.2"
7
+ date: 2006-12-21 00:00:00 +01:00
8
8
  summary: Offers object-oriented access to RDF (with adapters to several datastores).
9
9
  require_paths:
10
10
  - lib