Skip to content

Commit

Permalink
Social code written, needs tests
Browse files Browse the repository at this point in the history
  • Loading branch information
timbl committed Nov 3, 2024
1 parent 89e4c05 commit ea48b39
Show file tree
Hide file tree
Showing 7 changed files with 1,370 additions and 126 deletions.
260 changes: 134 additions & 126 deletions package-lock.json

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions src/integration-tests/SocialPresenter.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { presentCV} from "../CVPresenter";
import { blankNode, sym } from "rdflib";
import { ns } from "solid-ui";
import { store } from "solid-logic";

describe("CVPresenter", () => {
const jane = sym("https://jane.doe.example/profile/card#me");
const doc = jane.doc();

beforeEach(() => {
store.removeDocument(doc);
});

it.skip("presents minimum available info", () => {
const result = presentCV(jane, store);
expect(result.rolesByType).toBeNull();
expect(result.skills).toBeNull();
});

it.skip("presents minimum available info", () => {
const organization = blankNode();
store.add(jane, ns.org("member"), organization, doc);
store.add(organization, ns.schema("name"), "Inrupt", doc);
const result = presentCV(jane, store);
expect(result.rolesByType).toBe('Inrupt');
});
});
172 changes: 172 additions & 0 deletions src/integration-tests/examples/testingsolidos.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
@prefix : <#>.
@prefix acl: <http://www.w3.org/ns/auth/acl#>.
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
@prefix ldp: <http://www.w3.org/ns/ldp#>.
@prefix org: <http://www.w3.org/ns/org#>.
@prefix schema: <http://schema.org/>.
@prefix solid: <http://www.w3.org/ns/solid/terms#>.
@prefix space: <http://www.w3.org/ns/pim/space#>.
@prefix vcard: <http://www.w3.org/2006/vcard/ns#>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
@prefix l: <https://www.w3.org/ns/iana/language-code/>.
@prefix not: <https://notthereal.apple.com/>.
@prefix www: <https://www.thebeatles.com/>.
@prefix ww: <https://www.nasa.gov/>.
@prefix occup: <http://data.europa.eu/esco/occupation/>.
@prefix skill: <http://data.europa.eu/esco/skill/>.
@prefix tes: </>.
@prefix wd: <http://www.wikidata.org/entity/>.
@prefix prof: <./>.
@prefix inb: </inbox/>.
@prefix c: <https://solidos.solidcommunity.net/profile/card#>.
@prefix c0: <https://timbl.inrupt.net/profile/card#>.

occup:50af07f0-7a75-424e-a66d-5a9deea10f4c
schema:name
"testeur d\u2019accessibilit\u00e9/testeuse d\u2019accessibilit\u00e9".
occup:6b0ad7c0-a37f-45c6-a486-ee943a11429e schema:name "astrologue".

occup:807a1ac3-4f56-41f3-a68c-d653d558eb0a schema:name "copilote".

occup:88990bdf-4f6b-4411-82c9-9eecad1db8fb
schema:name "professeur de musique/professeure de musique".
skill:aec4c9bf-9c44-4f9d-99f1-70011cebe1a8
schema:name "tester du mat\u00e9riel d\u2019instrumentation".
skill:b805f989-14d5-46ad-80b0-755634b66dba
schema:name "travailler dans de mauvaises conditions m\u00e9t\u00e9orologiques".
wd:Q23548 schema:name "NASA"@yo.

wd:Q312 schema:name "Apple"@fr.

prof:card a foaf:PersonalProfileDocument; foaf:maker :me; foaf:primaryTopic :me.

:id1621179872094 solid:publicId l:fr.

:id1621182189397 solid:publicId l:de.

:id1621182208190
a solid:CurrentRole;
schema:startDate "2021-04-01"^^xsd:date;
vcard:role "Testeuse des Apps Solid";
org:member :me;
org:organization :id1621182234226;
org:role occup:50af07f0-7a75-424e-a66d-5a9deea10f4c.
:id1621182234226
a schema:Corporation;
schema:name "Apple";
schema:uri not:;
solid:publicId wd:Q312 .
:id1621182452881
a solid:PastRole;
schema:description "This was an imaginary but fun gig.";
schema:endDate "1963-04-01"^^xsd:date;
schema:startDate "1960-04-01"^^xsd:date;
vcard:role "Directed the white album";
org:member :me;
org:organization :id1621182460879;
org:role occup:88990bdf-4f6b-4411-82c9-9eecad1db8fb.
:id1621182460879 a schema:MusicGroup; schema:name "The Beatles"; schema:uri www: .

:id1621183757035
a solid:FutureRole;
schema:description "Imaginary future roles are sometimes the best";
schema:endDate "1993-04-01"^^xsd:date;
schema:startDate "1990-05-01"^^xsd:date;
vcard:role "Dream: Fly a couple of missions";
org:member :me;
org:organization :id1621183860447;
org:role occup:807a1ac3-4f56-41f3-a68c-d653d558eb0a.
:id1621183860447
a schema:GovernmentOrganization;
schema:name "National Aeronautical and Space Administration";
schema:uri ww:;
solid:publicId wd:Q23548 .
:id1621184812427
a solid:FutureRole;
schema:description "Second future role";
schema:startDate "2023-12-25"^^xsd:date;
vcard:role "Mission a Mars";
org:member :me;
org:organization :id1621184844320;
org:role occup:6b0ad7c0-a37f-45c6-a486-ee943a11429e.
:id1621184844320
a schema:GovernmentOrganization;
schema:name "NASA";
schema:uri ww:;
solid:publicId wd:Q23548 .
:id1622021411833
vcard:country-name "USA";
vcard:locality "Testingville";
vcard:region "Texas";
vcard:street-address "The testing tree house".
:id1622021761923 solid:publicId skill:aec4c9bf-9c44-4f9d-99f1-70011cebe1a8 .

:id1622021775187 solid:publicId skill:b805f989-14d5-46ad-80b0-755634b66dba.

:id1629201755476 solid:publicId l:el.

:id1629201830484 solid:publicId l:el.

:me
a schema:Person, foaf:Person;
schema:knowsLanguage
( :id1629201755476 ), ( :id1629201755476 :id1629201806315 ),
( :id1629201755476 :id1629201806315 :id1629201830484 );
schema:skills :id1622021761923, :id1622021775187;
vcard:bday "2021-05-14"^^xsd:date;
vcard:fn "Testing SolidOS Test";
vcard:hasAddress :id1622021411833;
vcard:hasPhoto <noun-test-2974484-B50F22.svg>;
vcard:note
"This is a test account for testing versions of the SolidOS operating system for solid.";
vcard:organization-name "Solid";
vcard:role "foobarbaz";
acl:trustedApp
[
acl:mode acl:Append, acl:Control, acl:Read, acl:Write;
acl:origin <https://oxfordhcc.github.io>
],
[
acl:mode acl:Append, acl:Control, acl:Read, acl:Write;
acl:origin <https://timbl.com>
],
[
acl:mode acl:Append, acl:Read, acl:Write;
acl:origin <http://localhost:3000>
],
[
acl:mode acl:Append, acl:Read, acl:Write;
acl:origin <http://localhost:8080>
],
[
acl:mode acl:Append, acl:Read, acl:Write;
acl:origin <https://noeldemartin.github.io>
],
[
acl:mode acl:Append, acl:Read, acl:Write;
acl:origin <https://solidcommunity.net:8443>
];
ldp:inbox inb:;
space:preferencesFile </settings/prefs.ttl>;
space:storage tes:;
solid:account tes:;
solid:oidcIssuer <https://solidcommunity.net>;
solid:preferredObjectPronoun "them";
solid:preferredRelativePronoun "theirs";
solid:preferredSubjectPronoun "they";
solid:privateTypeIndex </settings/privateTypeIndex.ttl>;
solid:profileBackgroundColor "#c2f5c2"^^xsd:color;
solid:profileHighlightColor "#b70606"^^xsd:color;
solid:publicTypeIndex </settings/publicTypeIndex.ttl>;
foaf:knows c:me, c0:me;
foaf:name "Testing SolidOS";
foaf:nick "tester1";
:otherPurplePhoto <noun_test_2974484.svg>.
l:de schema:name "germano"@ia.

l:el
schema:name
"Modern Greek"@en,
"\u039d\u03ad\u03b1 \u03b5\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ae \u03b3\u03bb\u03ce\u03c3\u03c3\u03b1"@el.
l:fr schema:name "French"@en.

56 changes: 56 additions & 0 deletions src/integration-tests/examples/tim-social-2.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#Processed by Id
# using base file:///Users/timbl_1/src/github.com/solidos/solidos/workspaces/profile-pane/src/integration-tests/examples/tim-social.ttl
@prefix : <#> .
@prefix Ber: <https://www.w3.org/People/Berners-Lee/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix prof: <https://solidos.github.io/solid-panes/dashboard/profileStyle.ttl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

:id1729675527480 a prof:BlueSkyAccount;
foaf:id "timbl.bsky.social" .

:id1729912807298 a prof:FacebookAccount;
foaf:id "tim.bernerslee.9" .

:id1729912986863 a prof:InstagramAccount;
foaf:id "timblee" .

:id1730055928507 a prof:MastodonAccount;
foaf:id "@[email protected]" .

:id1730056067040 a prof:RedditAccount .

:id1730056125033 a prof:RedditAccount;
foaf:id "timbl" .

:id1730056175230 a prof:TwitterAccount;
foaf:id "@timberners_lee" .

:id1730056248989 a prof:OtherAccount;
rdfs:label "My homepage at W3C";
foaf:homepage Ber:;
foaf:icon <https://www.w3.org/assets/logos/w3c/w3c-bars.svg> .

:id1730058497607 a prof:SnapchatAccount .

:id1730059685809 a prof:TiktokAccount .

:id1730387315524 a prof:GithubAccount;
foaf:id "timbl" .

:id1730387353050 a prof:MatrixAccount;
foaf:id " @timbl-54d26c98db8155e6700f7312:gitter.im" .

:me foaf:account (
:id1729675527480
:id1729912807298
:id1729912986863
:id1730055928507
:id1730056067040
:id1730056100390
:id1730056125033
:id1730056175230
:id1730056248989
:id1730058497607
:id1730059685809 ) .

106 changes: 106 additions & 0 deletions src/integration-tests/examples/tim-social.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
@prefix : <#>.
@prefix acl: <http://www.w3.org/ns/auth/acl#>.
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
@prefix ldp: <http://www.w3.org/ns/ldp#>.
@prefix org: <http://www.w3.org/ns/org#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix schema: <http://schema.org/>.
@prefix solid: <http://www.w3.org/ns/solid/terms#>.
@prefix space: <http://www.w3.org/ns/pim/space#>.
@prefix vcard: <http://www.w3.org/2006/vcard/ns#>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
@prefix c43: <https://mats.inrupt.net/profile/card#>.
@prefix c48: <https://stijntaelemans.inrupt.net/profile/card#>.
@prefix c49: <https://techny.inrupt.net/profile/card#>.
@prefix c50: <https://timojkankaanpaa.solidcommunity.net/profile/card#>.
@prefix inr: <https://inrupt.com/>.
@prefix mit: <https://mit.edu/>.
@prefix w: <https://www.oxfordmartin.ox.ac.uk/>.
@prefix c53: <https://jenni.inrupt.net/profile/card#>.
@prefix c31: <https://jollyorc.solidcommunity.net/profile/card#>.
@prefix c34: <https://karlhrichter.inrupt.net/profile/card#>.
@prefix c30: <https://dimou.solidcommunity.net/profile/card#>.
@prefix c33: <https://hindia.solidcommunity.net/profile/card#>.
@prefix Ber: <https://www.w3.org/People/Berners-Lee/>.
@prefix c28: <https://worrallp.inrupt.net/profile/card#>.
@prefix c39: <https://testingsolidos.solidcommunity.net/profile/card#>.
@prefix c5: <https://jholleran.inrupt.net/profile/card#>.
@prefix c36: <https://bourgeoa.solidcommunity.net/profile/card#>.
@prefix occup: <http://data.europa.eu/esco/occupation/>.
@prefix l: <https://www.w3.org/ns/iana/language-code/>.
@prefix c9: <https://justin.inrupt.net/profile/card#>.
@prefix c10: <https://kellyo.inrupt.net/profile/card#>.
@prefix c18: <https://nseydoux.inrupt.net/profile/card#>.
@prefix c19: <https://oz.inrupt.net/profile/card#>.
@prefix c22: <https://sharonstrats.inrupt.net/profile/card#>.
@prefix c24: <https://solid.zwifi.eu/profile/card#>.
@prefix c4: <https://acoburn.inrupt.net/profile/card#>.
@prefix c7: <https://angelo.veltens.org/profile/card#>.
@prefix c15: <https://csarven.inrupt.net/profile/card#>.
@prefix c16: <https://davi.inrupt.net/profile/card#>.
@prefix c23: <https://emmettownsend.inrupt.net/profile/card#>.
@prefix c25: <https://jackson.solidcommunity.net/profile/card#>.
@prefix c26: <https://janschill.net/profile/card#>.
@prefix c27: <https://johnb.inrupt.net/profile/card#>.
@prefix c29: <https://megoth.inrupt.net/profile/card#>.
@prefix c32: <https://michielbdejong.inrupt.net/profile/card#>.
@prefix c35: <https://rubenverborgh.inrupt.net/profile/card#>.
@prefix c42: <https://solid.kjernsmo.net/profile/card#>.
@prefix c44: <https://timea.solidcommunity.net/profile/card#>.
@prefix c45: <https://vincentt.inrupt.net/profile/card#>.
@prefix inbox: </inbox/>.
@prefix pro: <./>.
@prefix c0: <https://solidproject.solidcommunity.net/profile/card#>.
@prefix ent: <http://www.wikidata.org/entity/>.
@prefix skill: <http://data.europa.eu/esco/skill/>.
@prefix tim: </>.
@prefix ww: <https://www.cern.ch/>.
@prefix prof: <https://solidos.github.io/solid-panes/dashboard/profileStyle.ttl#>.
@prefix n6: <https://>.
@prefix c1: <https://solidos.solidcommunity.net/profile/card#>.


@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .


<#me> foaf:account

( :id1729675527480 :id1729912807298 :id1729912986863
:id1730055928507 :id1730056067040 :id1730056100390 :id1730056125033
:id1730056175230 :id1730056248989 :id1730058497607 :id1730059685809
) .



:id1729675527480 a prof:BlueSkyAccount; foaf:id "timbl.bsky.social".

:id1729912807298 a prof:FacebookAccount; foaf:id "tim.bernerslee.9".

:id1729912986863 a prof:InstagramAccount; foaf:id "timblee".

:id1730055928507 a prof:MastodonAccount; foaf:id "@[email protected]".

:id1730056067040 a prof:RedditAccount.

:id1730056125033 a prof:RedditAccount; foaf:id "timbl".

:id1730056175230 a prof:TwitterAccount; foaf:id "@timberners_lee".

:id1730056248989
a prof:OtherAccount;
rdfs:label "My homepage at W3C";
foaf:homepage Ber:;
foaf:icon <https://www.w3.org/assets/logos/w3c/w3c-bars.svg>.
:id1730058497607 a prof:SnapchatAccount.

:id1730059685809 a prof:TiktokAccount.

:id1730387315524 a prof:GithubAccount; foaf:id "timbl".

:id1730387353050
a prof:MatrixAccount; foaf:id " @timbl-54d26c98db8155e6700f7312:gitter.im".
:me .




Loading

0 comments on commit ea48b39

Please sign in to comment.