foaf_stone 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/License.txt +63 -0
- data/Manifest.txt +19 -0
- data/README.txt +7 -0
- data/Rakefile +4 -0
- data/config/hoe.rb +71 -0
- data/config/requirements.rb +17 -0
- data/lib/foaf_stone.rb +6 -0
- data/lib/foaf_stone/parse.rb +12 -0
- data/lib/foaf_stone/person.rb +134 -0
- data/lib/foaf_stone/search.rb +33 -0
- data/lib/foaf_stone/version.rb +9 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/script/txt2html +74 -0
- data/setup.rb +1585 -0
- data/test/foafs/don_park.rdf +57 -0
- data/test/person_spec.rb +51 -0
- data/test/search_spec.rb +19 -0
- metadata +68 -0
@@ -0,0 +1,57 @@
|
|
1
|
+
<rdf:RDF
|
2
|
+
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
3
|
+
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
|
4
|
+
xmlns:contact="http://www.w3.org/2000/10/swap/pim/contact#"
|
5
|
+
xmlns:wn="http://xmlns.com/wordnet/1.6/"
|
6
|
+
xmlns:air="http://www.daml.org/2001/10/html/airport-ont#"
|
7
|
+
xmlns:foaf="http://xmlns.com/foaf/0.1/"
|
8
|
+
xmlns:admin="http://webns.net/mvcb/">
|
9
|
+
|
10
|
+
<foaf:PersonalProfileDocument rdf:about="">
|
11
|
+
<foaf:maker rdf:resource="#me"/>
|
12
|
+
<foaf:primaryTopic rdf:resource="#me"/>
|
13
|
+
</foaf:PersonalProfileDocument>
|
14
|
+
|
15
|
+
<!-- Me -->
|
16
|
+
<foaf:Person rdf:ID="me">
|
17
|
+
<foaf:name>Don Park</foaf:name>
|
18
|
+
<foaf:givenname>Don</foaf:givenname>
|
19
|
+
<foaf:family_name>Park</foaf:family_name>
|
20
|
+
<foaf:mbox_sha1sum>fbdabb4248bed16133d580c0beafc4c67573239d</foaf:mbox_sha1sum>
|
21
|
+
<foaf:homepage rdf:resource="http://donpark.org"/>
|
22
|
+
<foaf:depiction rdf:resource="http://donpark.org/images/profile.jpg"/>
|
23
|
+
<contact:nearestAirport>
|
24
|
+
<wn:Airport air:icao="KPDX" air:iata="PDX"/>
|
25
|
+
</contact:nearestAirport>
|
26
|
+
<foaf:holdsAccount>
|
27
|
+
<foaf:OnlineAccount>
|
28
|
+
<foaf:accountServiceHomepage>http://facebook.com</foaf:accountServiceHomepage>
|
29
|
+
<foaf:accountName>692421751</foaf:accountName>
|
30
|
+
</foaf:OnlineAccount>
|
31
|
+
</foaf:holdsAccount>
|
32
|
+
<foaf:knows rdf:resource="#caleb"/>
|
33
|
+
<foaf:knows rdf:resource="#tomh"/>
|
34
|
+
<foaf:knows>
|
35
|
+
<foaf:Person>
|
36
|
+
<foaf:name>Darrin Eden</foaf:name>
|
37
|
+
<foaf:homepage rdf:resource="http://dje.typepad.com/"/>
|
38
|
+
<rdfs:seeAlso rdf:resource="http://dje.typepad.com/foaf.rdf"/>
|
39
|
+
</foaf:Person>
|
40
|
+
</foaf:knows>
|
41
|
+
</foaf:Person>
|
42
|
+
|
43
|
+
<!-- Friends -->
|
44
|
+
<foaf:Person rdf:ID="caleb">
|
45
|
+
<foaf:name>Caleb Phillips</foaf:name>
|
46
|
+
<foaf:homepage rdf:resource="http://www.smallwhitecube.com/"/>
|
47
|
+
<rdfs:seeAlso rdf:resource="http://smallwhitecube.com/foaf.xrdf"/>
|
48
|
+
</foaf:Person>
|
49
|
+
|
50
|
+
<foaf:Person rdf:ID="tomh">
|
51
|
+
<foaf:name>Tom Higgins</foaf:name>
|
52
|
+
<foaf:homepage rdf:resource="http://www.wsmf.com/"/>
|
53
|
+
<rdfs:seeAlso rdf:resource="http://wsmf.com/foaf.xrdf"/>
|
54
|
+
</foaf:Person>
|
55
|
+
|
56
|
+
|
57
|
+
</rdf:RDF>
|
data/test/person_spec.rb
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
require File.dirname(__FILE__)+'/../lib/foaf_stone.rb'
|
2
|
+
describe FoafStone::Person do
|
3
|
+
before(:each) do
|
4
|
+
@foaf_url = "test/foafs/don_park.rdf"
|
5
|
+
@person = FoafStone::Person.new(@foaf_url)
|
6
|
+
end
|
7
|
+
|
8
|
+
it "should load a foaf profile from a url" do
|
9
|
+
@person.loaded?.should == true
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should parse the name field" do
|
13
|
+
@person.name.should == "Don Park"
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should set the name field" do
|
17
|
+
new_name = "New Name"
|
18
|
+
@person.name = new_name
|
19
|
+
@person.name.should == new_name
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should parse the homepage field" do
|
23
|
+
@person.homepage.should == "http://donpark.org"
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should parse the picture url" do
|
27
|
+
@person.image_uri.to_s.should == "http://donpark.org/images/profile.jpg"
|
28
|
+
end
|
29
|
+
|
30
|
+
it "should parse the rdf:seeAlso field" do
|
31
|
+
@person.knows.first.see_also.should == "http://smallwhitecube.com/foaf.xrdf"
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should remember from where it was loaded" do
|
35
|
+
@person.uri_base.to_s.should == @foaf_url
|
36
|
+
end
|
37
|
+
|
38
|
+
it "should provide an array of known people" do
|
39
|
+
friends = @person.knows
|
40
|
+
friends.size.should == 3
|
41
|
+
end
|
42
|
+
|
43
|
+
it "should load a known foaf:Person from an #rdf_id" do
|
44
|
+
@person.knows.select {|person| person.name == "Caleb Phillips"}.size.should == 1
|
45
|
+
end
|
46
|
+
|
47
|
+
it "should load a known foaf:Person from a child element" do
|
48
|
+
@person.knows.select {|person| person.name == "Darrin Eden"}.size.should == 1
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
data/test/search_spec.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
require File.dirname(__FILE__)+'/../lib/foaf_stone.rb'
|
2
|
+
describe FoafStone::Search do
|
3
|
+
before(:each) do
|
4
|
+
@foaf_url = "test/foafs/don_park.rdf"
|
5
|
+
end
|
6
|
+
|
7
|
+
it "should start a search" do
|
8
|
+
FoafStone::Search.start(@foaf_url, "don", self)
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should notify when the search is complete"
|
12
|
+
|
13
|
+
it "should find the correct people"
|
14
|
+
|
15
|
+
def search_done
|
16
|
+
puts "search finished!"
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
metadata
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
rubygems_version: 0.9.4
|
3
|
+
specification_version: 1
|
4
|
+
name: foaf_stone
|
5
|
+
version: !ruby/object:Gem::Version
|
6
|
+
version: 0.0.3
|
7
|
+
date: 2007-11-12 00:00:00 -08:00
|
8
|
+
summary: manage personal information and social contacts in FOAF documents
|
9
|
+
require_paths:
|
10
|
+
- lib
|
11
|
+
email: don.park@gmail.com
|
12
|
+
homepage: http://foafstone.rubyforge.org
|
13
|
+
rubyforge_project: foafstone
|
14
|
+
description: manage personal information and social contacts in FOAF documents
|
15
|
+
autorequire:
|
16
|
+
default_executable:
|
17
|
+
bindir: bin
|
18
|
+
has_rdoc: true
|
19
|
+
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.0.0
|
24
|
+
version:
|
25
|
+
platform: ruby
|
26
|
+
signing_key:
|
27
|
+
cert_chain:
|
28
|
+
post_install_message:
|
29
|
+
authors:
|
30
|
+
- Don Park
|
31
|
+
files:
|
32
|
+
- History.txt
|
33
|
+
- License.txt
|
34
|
+
- Manifest.txt
|
35
|
+
- README.txt
|
36
|
+
- Rakefile
|
37
|
+
- config/hoe.rb
|
38
|
+
- config/requirements.rb
|
39
|
+
- lib/foaf_stone.rb
|
40
|
+
- lib/foaf_stone/parse.rb
|
41
|
+
- lib/foaf_stone/person.rb
|
42
|
+
- lib/foaf_stone/search.rb
|
43
|
+
- lib/foaf_stone/version.rb
|
44
|
+
- script/destroy
|
45
|
+
- script/generate
|
46
|
+
- script/txt2html
|
47
|
+
- setup.rb
|
48
|
+
- test/person_spec.rb
|
49
|
+
- test/search_spec.rb
|
50
|
+
- test/foafs/don_park.rdf
|
51
|
+
test_files: []
|
52
|
+
|
53
|
+
rdoc_options:
|
54
|
+
- --main
|
55
|
+
- README.txt
|
56
|
+
extra_rdoc_files:
|
57
|
+
- History.txt
|
58
|
+
- License.txt
|
59
|
+
- Manifest.txt
|
60
|
+
- README.txt
|
61
|
+
executables: []
|
62
|
+
|
63
|
+
extensions: []
|
64
|
+
|
65
|
+
requirements: []
|
66
|
+
|
67
|
+
dependencies: []
|
68
|
+
|