├── .editorconfig ├── CONTRIBUTING.md ├── README.md ├── docs ├── browser.md ├── contribute.md ├── converters.md ├── directory.md ├── editor.md ├── index.md ├── plugins.md ├── prototypes.md └── provider.md └── plp.jsonld /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = tab 6 | end_of_line = lf 7 | insert_final_newline = true 8 | trim_trailing_whitespace = true 9 | 10 | [*.js] 11 | indent_size = 2 12 | 13 | [*.json] 14 | indent_size = 2 15 | 16 | [*.py] 17 | indent_size = 2 18 | indent_style = tab 19 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Please see our documentation on [how to contribute](http://hackers4peace.viewdocs.io/plp-docs/contribute). 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Portable Linked Profiles 2 | 3 | [![Gitter](http://img.shields.io/badge/chat-Gitter-blue.svg?style=flat)](https://gitter.im/hackers4peace/plp-docs) 4 | 5 | ## in general 6 | 7 | This documentation is [`viewdocs`](http://hackers4peace.viewdocs.io/plp-docs) and `previewdocs` compatible. 8 | 9 | It is being used as a `docs` submodule in hacker4peace's `plp-` repositories. 10 | 11 | ## About 12 | 13 | Please see [Open Distributed Data slides](http://www.slideshare.net/alexwhitcroft/oddp-oui-share-fest-presentation-laid-out-export) 14 | 15 | [![Open Distributed Data slides](http://image.slidesharecdn.com/oddpouisharefestpresentation-laidoutexport-140515045459-phpapp01/95/the-lovechild-of-social-media-the-sharing-economy-and-bitcoin-the-open-decentralised-data-project-21-638.jpg)](http://www.slideshare.net/alexwhitcroft/oddp-oui-share-fest-presentation-laid-out-export) 16 | 17 | and [Data Portability video](https://vimeo.com/610179) 18 | 19 | [![Data Portability video](https://i.vimeocdn.com/video/21002671.webp?mw=638)](https://vimeo.com/610179) 20 | 21 | ### Portability 22 | 23 | * [ ] HTTP 3XX 24 | * [ ] plp:Redirect document 25 | 26 | For types, see the data [prototypes](http://hackers4peace.viewdocs.io/plp-docs/prototypes). 27 | 28 | ## JSON-LD Context 29 | 30 | JSON-LD is being used as format for storing and inter-operating with profile data. 31 | 32 | See [Context](http://ld.hackers4peace.net/contexts/plp.jsonld) 33 | 34 | ## Reference Implementations 35 | 36 | ### Apps 37 | 38 | * PLP **Editor** 39 | * https://github.com/hackers4peace/plp-editor 40 | * PLP **Browser** 41 | * https://github.com/hackers4peace/plp-browser 42 | 43 | ### Services 44 | 45 | * PLP **Provider** 46 | * https://github.com/hackers4peace/plp-provider 47 | * PLP **Directory** 48 | * https://github.com/hackers4peace/plp-directory 49 | 50 | ## Similar Projects 51 | 52 | * https://github.com/3-Round-Stones/directory 53 | * http://dir.w3.org 54 | * http://spaceapi.net/ 55 | * http://jsonresume.org/ 56 | * http://hcardcreator.com 57 | * http://sharedstuff.org/ 58 | * http://webfinger.net/ 59 | * http://webfinger.net/rel/profile-page/ 60 | 61 | ## Platforms that could benefit from implementing PLP 62 | 63 | * http://directory.open-steps.org (first early adopter & contributor!) 64 | * http://jplusplus.github.io/global-directory/ 65 | * http://codefor.de/ 66 | * https://github.com/codeforamerica/cfapi (powering http://www.codeforamerica.org/brigade/ ) 67 | * https://mozillians.org/en-US/ 68 | * http://hackerspaces.org/wiki/List_of_ALL_Hacker_Spaces 69 | * already adoptiong SpaceAPI http://spaceapi.net/directory 70 | * http://thisisnetneutrality.org/ 71 | * http://map.ogunte.com/ 72 | * http://johnjohndoe.github.io/CodeForFreedom2014/ 73 | 74 | ## CC0 — No Rights Reserved 75 | 76 | [![CC0](http://i.creativecommons.org/p/zero/1.0/88x31.png)](http://creativecommons.org/about/cc0) 77 | -------------------------------------------------------------------------------- /docs/browser.md: -------------------------------------------------------------------------------- 1 | ###### [Portable Linked Profiles](http://hackers4peace.net/plp) 2 | 3 | # Browser 4 | 5 | ## About 6 | 7 | Portable Linked Profile Browser. This repo will host definitions and implementations for Browsers working with PLP. 8 | PLP Browser represent the information contained in one or more profiles, pulled from PLP-Directories. An example would be http://directory.open-steps.org 9 | 10 | ## Source 11 | 12 | The source code can be found at 13 | 14 | > https://github.com/hackers4peace/plp-browser 15 | 16 | # Installation of this example browser 17 | 18 | Install dependencies 19 | 20 | ```bash 21 | $ bower install 22 | ``` 23 | edit *config.js* to specify the URL of the directory this browser links to. 24 | 25 | ```bash 26 | $ cp config.example.js config.js 27 | ``` 28 | Serve it with the webserver of your choice. 29 | 30 | # Reference implementations of PLP Browser? 31 | 32 | * http://directory.open-steps.org (http://github.com/open-steps/ok-directory) 33 | -------------------------------------------------------------------------------- /docs/contribute.md: -------------------------------------------------------------------------------- 1 | ###### [Portable Linked Profiles](http://hackers4peace.net/plp) 2 | 3 | # How to contribute? 4 | 5 | > *stub* 6 | 7 | Get in touch with us via various channels. 8 | -------------------------------------------------------------------------------- /docs/converters.md: -------------------------------------------------------------------------------- 1 | ###### [Portable Linked Profiles](http://hackers4peace.net/plp) 2 | 3 | # Converters 4 | 5 | ## About 6 | 7 | The converters are used to transform already extracted datasets from various sources into the respective PLP prototypes. 8 | 9 | ## Source 10 | 11 | The source code can be found at 12 | 13 | > https://github.com/hackers4peace/plp-converters 14 | -------------------------------------------------------------------------------- /docs/directory.md: -------------------------------------------------------------------------------- 1 | ###### [Portable Linked Profiles](http://hackers4peace.net/plp) 2 | 3 | # Directory 4 | 5 | ## What is a PLP directory? 6 | 7 | PLP Directories add logic around the profiles. They pull profiles from providers and serve them to Browsers. Possible logic could be validation, authentication, notification, etc... 8 | 9 | ## Source 10 | 11 | The source code can be found at 12 | 13 | > https://github.com/hackers4peace/plp-directory 14 | 15 | ## API 16 | 17 | Supports CORS ([Cross-Origin Resource Sharing](http://enable-cors.org/)) 18 | 19 | We evaluate [Hydra](http://www.hydra-cg.com/) and [LDP](http://www.w3.org/TR/ldp/), for now simple Level-3 REST 20 | 21 | ### GET / 22 | 23 | status: *implementing* 24 | 25 | returns all listings in directory 26 | 27 | request: *currently expects no parameters, in a future we can 28 | enable filtering by "@type" of listed profile (Person, Organization, 29 | Event, Place, Asset etc.)* 30 | 31 | content-type: *application/ld+json* (or not recommended *application/json*) 32 | 33 | response: *JSON-LD object with graph including all listings each with embeded profile* 34 | 35 | ```js 36 | { 37 | "@context": "http://plp.hackers4peace.net/context.jsonld", 38 | "@graph": [ 39 | { 40 | "@id": "http://directory-domain.tld/faa52ac0-c9f5-4b8c-be1c-4480f353315f" 41 | "@type": "Listing", 42 | "about": { 43 | "@id": "http://provider-domain.tld/449b829a-0fbd-420a-bbe4-70d11527d62b", 44 | "@type": "Person", 45 | "name": "Alice Wonder", 46 | ... 47 | } 48 | }, 49 | { 50 | "@id": "http://directory-domain.tld/a43057b8-134f-49a4-991a-bf910f0803e9" 51 | "@type": "Listing", 52 | "about": { 53 | "@id": "http://provider-domain.tld/11055695-8a65-4284-a6e7-ab96884e7658", 54 | "@type": "Person", 55 | "name": "Bob Secure", 56 | ... 57 | } 58 | }, 59 | ... 60 | ] 61 | } 62 | ``` 63 | 64 | ### POST / 65 | 66 | status: *implementing* 67 | 68 | adds listing to directory, only URI needed since directory will fetch 69 | full profile data from provider 70 | 71 | request: expects JSON-LD object with profile to list 72 | 73 | 74 | ```js 75 | { 76 | "@context": "http://plp.hackers4peace.net/context.jsonld", 77 | "@id": "http://provider-domain.tld/449b829a-0fbd-420a-bbe4-70d11527d62b", 78 | "@type": "Person" 79 | } 80 | ``` 81 | 82 | content-type: *application/ld+json* (or not recommended *application/json*) 83 | 84 | response: *JSON-LD object with URI of newly created listing based on 85 | directory's domain name and generated [UUID](http://en.wikipedia.org/wiki/Universally_unique_identifier)* 86 | 87 | ```js 88 | { 89 | "@context": "http://plp.hackers4peace.net/context.jsonld", 90 | "@id": "http://directory-domain.tld/faa52ac0-c9f5-4b8c-be1c-4480f353315f", 91 | "@type": "Listing" 92 | } 93 | ``` 94 | 95 | ### GET /:uuid 96 | 97 | status: *planned* 98 | 99 | gets single listing 100 | 101 | ### PUT /:uuid 102 | 103 | status: *planned* 104 | 105 | requests update of a listing 106 | 107 | ### DELETE /:uuid 108 | 109 | status: *planned* 110 | 111 | requests deletion of a listing 112 | -------------------------------------------------------------------------------- /docs/editor.md: -------------------------------------------------------------------------------- 1 | ###### [Portable Linked Profiles](http://hackers4peace.net/plp) 2 | 3 | # Editor 4 | 5 | ## About 6 | 7 | PLP Editors are apps which allows the user to create or update PLPs, and 8 | manage listings in Directories. For broader overview see [PLP 9 | Docs](https://github.com/hackers4peace/plp-docs) 10 | 11 | ## Source 12 | 13 | The source code can be found at 14 | 15 | > https://github.com/hackers4peace/plp-editor 16 | 17 | ## Interfaces to 18 | 19 | * [PLP Provider](https://github.com/hackers4peace/plp-provider) - operations on profile itself 20 | * [ ] create 21 | * [ ] read 22 | * [ ] update 23 | * [ ] delete 24 | * [PLP Directory](https://github.com/hackers4peace/plp-directory) - operations on listings of profiles 25 | * [ ] create 26 | * [ ] read 27 | * [ ] update 28 | * [ ] delete 29 | -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | # Portable Linked Profiles 2 | 3 | Documentation of [Portable Linked Profiles](http://hackers4peace.net/plp/). 4 | 5 | Read about 6 | 7 | * [browser](http://hackers4peace.viewdocs.io/plp-docs/browser) 8 | * [converters](http://hackers4peace.viewdocs.io/plp-docs/converters) 9 | * [directory](http://hackers4peace.viewdocs.io/plp-docs/directory) 10 | * [editor](http://hackers4peace.viewdocs.io/plp-docs/editor) 11 | * [plugins](http://hackers4peace.viewdocs.io/plp-docs/plugins) 12 | * [prototypes](http://hackers4peace.viewdocs.io/plp-docs/prototypes) 13 | * [provider](http://hackers4peace.viewdocs.io/plp-docs/provider) 14 | 15 | or 16 | 17 | * how to [contribute](http://hackers4peace.viewdocs.io/plp-docs/contribute) 18 | -------------------------------------------------------------------------------- /docs/plugins.md: -------------------------------------------------------------------------------- 1 | ###### [Portable Linked Profiles](http://hackers4peace.net/plp) 2 | 3 | # Plugins 4 | 5 | ## About 6 | 7 | *[discussion](https://github.com/hackers4peace/plp-docs/issues/9)* 8 | 9 | ### Frameworks 10 | * Ruby on Rails 11 | * http://ouishare.net 12 | * http://makesense.org 13 | 14 | ### CMS 15 | * Wordpress 16 | * http://okfn.org 17 | * Drupal 18 | * http://edgeryders.eu 19 | -------------------------------------------------------------------------------- /docs/prototypes.md: -------------------------------------------------------------------------------- 1 | ###### [Portable Linked Profiles](http://hackers4peace.net/plp) 2 | 3 | # Prototypes 4 | 5 | ## About 6 | 7 | The family of Portable Linked Profiles Services is built around a modular microservice architecture. Everything has its place, so it doesn't need to be doubled, if it merely can be referenced. 8 | 9 | The Prototypes define the general data models used with Portable Linked Profiles. 10 | 11 | ## Source 12 | 13 | The source code can be found at 14 | 15 | > https://github.com/hackers4peace/plp-prototypes 16 | 17 | ## Types 18 | 19 | ### Person 20 | 21 | * status *implementing* 22 | * schemas 23 | * [x] http://schema.org/Person 24 | * [ ] http://smiy.sourceforge.net/cco/spec/cognitivecharacteristics.html 25 | * [ ] http://microformats.org/wiki/h-card 26 | * [ ] http://microformats.org/wiki/h-resume 27 | 28 | http://profiles.open-steps.org/provider/7ce5f07a-1c3c-4e35-90c9-e51bce25e04a 29 | ```json 30 | { 31 | "name": "Alex Corbi", 32 | "description": "Software developer based in Berlin since 2009. Co-Founder of the independent initiative Open Steps: A journey around the world discovering and showcasing Open Knowledge projects.", 33 | "website": "http://www.open-steps.org", 34 | "address": [ 35 | { 36 | "city": "Berlin", 37 | "country": "Germany" 38 | } 39 | ], 40 | "memberOf": [ 41 | { 42 | "name": "Open Steps" 43 | } 44 | ], 45 | "contactPoint": [ 46 | { 47 | "type": "Email", 48 | "id": "alex@open-steps.org" 49 | }, 50 | { 51 | "type": "Github", 52 | "id": "http://github.com/opensteps" 53 | }, 54 | { 55 | "type": "Twitter", 56 | "id": "http://www.twitter.com/acorbi" 57 | } 58 | ], 59 | "interest": [ 60 | { 61 | "name": "Open Data" 62 | }, 63 | { 64 | "name": "Open Source" 65 | }, 66 | { 67 | "name": "Software Development" 68 | }, 69 | { 70 | "name": "Data Visualisation" 71 | } 72 | ], 73 | "@id": "http://profiles.open-steps.org/provider/7ce5f07a-1c3c-4e35-90c9-e51bce25e04a", 74 | "@type": "Person", 75 | "@context": "http://plp.hackers4peace.net/context.jsonld" 76 | } 77 | ``` 78 | 79 | ### Organization 80 | 81 | * status *implementing* 82 | * schemas 83 | * [x] http://schema.org/Organization 84 | * [ ] http://microformats.org/wiki/h-card 85 | 86 | Example 87 | 88 | http://profiles.open-steps.org/provider/30fa6739-6440-45cf-abd5-e6d1c8810ece 89 | ```json 90 | { 91 | "name": "Aberdeen City Council", 92 | "description": "The Local Authority for the Aberdeen City geographic region", 93 | "telephone": "01224 522000", 94 | "website": "http://www.aberdeencity.gov.uk", 95 | "logo": "http://www.aberdeencity.gov.uk/web/Templates/acc-home-2011_files/acc-logo.gif", 96 | "address": [ 97 | { 98 | "street": "Marischal College, Broad Street", 99 | "code": "AB10 1Ab", 100 | "city": "Aberdeen", 101 | "country": "UK" 102 | } 103 | ], 104 | "member": [ 105 | { 106 | "name": "ian Watt", 107 | "jobtitle": "e-Government Manager", 108 | "description": "" 109 | } 110 | ], 111 | "contactPoint": [ 112 | { 113 | "type": "Email", 114 | "id": "webmonitor@aberdeencity.gov.uk" 115 | }, 116 | { 117 | "type": "Twitter", 118 | "id": "@aberdeencc" 119 | } 120 | ], 121 | "interest": [ 122 | { 123 | "name": "Open Data" 124 | }, 125 | { 126 | "name": "GIS" 127 | } 128 | ], 129 | "@type": "Organization", 130 | "@id": "http://profiles.open-steps.org/provider/30fa6739-6440-45cf-abd5-e6d1c8810ece" 131 | } 132 | ``` 133 | 134 | ### Event 135 | 136 | * status *implementing* 137 | * schemas 138 | * [x] http://schema.org/Event 139 | * [ ] http://microformats.org/wiki/h-event 140 | 141 | Example 142 | ```json 143 | { 144 | "name": "OK Lab Berlin", 145 | "description": "Regular Hacknight for the OK Lab Berlin members. Please join us if you are already working on a project. New members are warmly welcomed on every second Monday of the month to our open meet ups. ", 146 | "url": "http://www.meetup.com/OK-Lab-Berlin/", 147 | "image": "", 148 | "startDate": "19/01/2015 19:00", 149 | "endDate": "19/01/2015 24:00", 150 | "organizer": [ 151 | { 152 | "name": "Code For Germany", 153 | "website": "http://www.codefor.de" 154 | } 155 | ], 156 | "performer": [], 157 | "eventStatus": "Scheduled", 158 | "location": [ 159 | { 160 | "street": "Tempelhofer Ufer 23/24", 161 | "code": "10963", 162 | "city": "Berlin", 163 | "country": "Germany" 164 | } 165 | ], 166 | "workPerformed": [ 167 | { 168 | "name": "PLP: Portable Linked Profiles", 169 | "url": "http://profiles.allmende.io" 170 | } 171 | ], 172 | "@type": "Event", 173 | "@context": "http://plp.hackers4peace.net/context.jsonld" 174 | } 175 | ``` 176 | ### Place 177 | 178 | * status *implementing* 179 | * schemas 180 | * [x] http://schema.org/Place 181 | * [ ] http://microformats.org/wiki/h-geo 182 | 183 | Example 184 | ```json 185 | { 186 | "name": "Wikimedia Deutschland", 187 | "description": "Wikimedia ist eine internationale gemeinnützige Organisation, die Freies Wissen fördert. Durch die Sammlung, Entwicklung und Verbreitung von Freien Inhalten in allen Sprachen der Welt wird dieses Ziel verfolgt. Wikimedia Deutschland - Gesellschaft zur Förderung Freien Wissens e.V. unterstützt verschiedene Projekte. Das größte ist Wikipedia - die freie Enzyklopädie, deren Betreiberin die Wikimedia Foundation ist.", 188 | "telephone": "+49 (0)30-219 158 26-0 ", 189 | "url": "https://wikimedia.de/wiki/Kontakt", 190 | "image": "https://www.wikimedia.de/w/images.homepage/c/c9/Logo.png", 191 | "address": [ 192 | { 193 | "street": "Tempelhofer Ufer 23/24", 194 | "code": "10963", 195 | "city": "Berlin", 196 | "country": "Germany" 197 | } 198 | ], 199 | "event": [], 200 | "@type": "Place", 201 | "@context": "http://plp.hackers4peace.net/context.jsonld" 202 | } 203 | ``` 204 | ### Project 205 | 206 | * status *implementing* 207 | * schemas 208 | * [x] http://schema.org/CreativeWork 209 | 210 | Example 211 | ```json 212 | { 213 | "name": "PLP: Portable Linked Profiles", 214 | "description": "PLP proposes a pattern for the creation, storage, listing and representation of public profile data for people, groups, organizations, venues and a large etcetera. Based on Open Web Standards, Common Vocabularies and Open Source technologies, it offers users the possibility to own the their data diverging from current mainstream and centralized profile platforms.", 215 | "url": "https://github.com/hackers4peace/plp-docs", 216 | "image": "http://codefor.de/assets/projects/berlin/portablelinkedprofiles.png", 217 | "version": "0.1", 218 | "license": "http://unlicense.org/", 219 | "copyrightHolder": { 220 | "name": "", 221 | "url": "" 222 | }, 223 | "contributor": [ 224 | { 225 | "name": "Elf Pavlik", 226 | "website": "http://elf-pavlik.wwelves.org/" 227 | }, 228 | { 229 | "name": "Alex Corbi", 230 | "website": "http://www.open-steps.org" 231 | }, 232 | { 233 | "name": "Jon Richter", 234 | "website": "http://allmende.io/" 235 | }, 236 | { 237 | "name": "Lynn Foster", 238 | "website": "http://mikorizal.org/" 239 | }, 240 | { 241 | "name": "Tibor Katelbach", 242 | "website": "http://www.pixelhumain.com/" 243 | } 244 | ], 245 | "discussionUrl": [ 246 | { 247 | "url": "http://profiles.allmende.io/" 248 | }, 249 | { 250 | "url": "http://directory.open-steps.org/" 251 | }, 252 | { 253 | "url": "https://github.com/hackers4peace/plp-docs" 254 | } 255 | ], 256 | "isPartOf": [], 257 | "workExample": [], 258 | "workPerformed": [], 259 | "@type": "Project", 260 | "@context": "http://plp.hackers4peace.net/context.jsonld" 261 | } 262 | ``` 263 | 264 | ### Asset 265 | 266 | * status *planned* 267 | * schemas 268 | * [ ] http://schema.org/Product 269 | * [ ] http://schema.org/Service 270 | * [ ] http://microformats.org/wiki/h-product 271 | -------------------------------------------------------------------------------- /docs/provider.md: -------------------------------------------------------------------------------- 1 | ###### [Portable Linked Profiles](http://hackers4peace.net/plp) 2 | 3 | # Provider 4 | 5 | ## About 6 | 7 | PLP Providers store profiles. They interact with PLP-Directories, serving them profiles, and with PLP-Editors, which create/update/delete the profiles stored on them. 8 | 9 | ## Source 10 | 11 | The source code can be found at 12 | 13 | > https://github.com/hackers4peace/plp-provider 14 | 15 | ## API 16 | 17 | Supports CORS ([Cross-Origin Resource Sharing](http://enable-cors.org/)) 18 | 19 | *We evaluate [Hydra](http://www.hydra-cg.com/) and [LDP](http://www.w3.org/TR/ldp/)* 20 | 21 | 22 | ### GET /:uuid 23 | 24 | status: *basic implementation* 25 | 26 | gets single profile 27 | 28 | #### request 29 | 30 | * content-type: **application/ld+json** 31 | 32 | #### response 33 | 34 | * code: **200 OK** 35 | * payload: *JSON-LD object with full profile* 36 | 37 | ```js 38 | { 39 | "@context": "http://plp.hackers4peace.net/context.jsonld", 40 | "@id": "http://provider-domain.tld/449b829a-0fbd-420a-bbe4-70d11527d62b", 41 | "@type": "Person", 42 | "name": "Alice Wonder", 43 | "memberOf": [ 44 | { 45 | "@id": "http://wl.tld", 46 | "@type": "Organization", 47 | "name": "Wonderlanderians" 48 | }, 49 | ... 50 | ], 51 | ... 52 | } 53 | ``` 54 | 55 | * errors 56 | * *HTTP 301 Moved Permanently* - if profile moved elsewhere 57 | * *HTTP 404 Not Found* - if profile never existed 58 | * *HTTP 410 Gone* - if profile existed but got deleted 59 | * *HTTP 500 Internal Server Error* 60 | 61 | ### POST / 62 | 63 | status: *basic implementation* 64 | 65 | creates new profile 66 | 67 | #### request 68 | 69 | * content-type: **application/ld+json** 70 | * headers 71 | * *Authorization: Bearer [token]* 72 | * payload: *profile data* ([PLP 73 | Editor](https://github.com/hackers4peace/plp-editor) can 74 | generate it) 75 | 76 | 77 | ```js 78 | { 79 | "@context": "http://plp.hackers4peace.net/context.jsonld", 80 | "@type": "Person", 81 | "name": "Alice Wonderland", 82 | "memberOf": [ 83 | { 84 | "@id": "http://wl.tld", 85 | "@type": "Organization", 86 | "name": "Wonderlanderians" 87 | }, 88 | ... 89 | ], 90 | ... 91 | } 92 | ``` 93 | 94 | 95 | #### response 96 | 97 | * code: **201 Created** 98 | * content-type: **application/ld+json** 99 | * payload: *JSON-LD object with URI of newly created profile based on 100 | provider's domain name and generated [UUID](http://en.wikipedia.org/wiki/Universally_unique_identifier)* 101 | 102 | ```js 103 | { 104 | "@context": "http://plp.hackers4peace.net/context.jsonld", 105 | "@id": "http://provider-domain.tld/449b829a-0fbd-420a-bbe4-70d11527d62b", 106 | "@type" "Person" 107 | } 108 | ``` 109 | 110 | * errors 111 | * *HTTP 401 Unauthorized* - if authentication fails 112 | * *HTTP 409 Conflict* - if payload includes ```@id``` 113 | * *HTTP 500 Internal Server Error* 114 | 115 | ### PUT /:uuid 116 | 117 | status: *basic implementation* 118 | 119 | updates profile 120 | 121 | #### request 122 | 123 | * content-type: **application/ld+json** 124 | * headers 125 | * *Authorization: Bearer [token]* 126 | * payload: *same as POST but requires payload to have an @id matching one of stored profiles stored on this provider* 127 | 128 | #### response 129 | 130 | * code: **200 OK** 131 | * errors 132 | * *HTTP 401 Unauthorized* - if authentication fails 133 | * *HTTP 403 Forbidden* - if authorization fails 134 | * *HTTP 400 Bad Request* - if payload includes ```@id``` different then requested URI 135 | * *HTTP 500 Internal Server Error* 136 | 137 | ### DELETE /:uuid 138 | 139 | status: *basic implementation* 140 | 141 | deletes profile 142 | 143 | #### request 144 | 145 | * headers 146 | * *Authorization: Bearer [token]* 147 | 148 | #### response 149 | 150 | * code: *204 No Content* 151 | * errors 152 | * *HTTP 401 Unauthorized* - if authentication fails 153 | * *HTTP 403 Forbidden* - if authorization fails 154 | * *HTTP 500 Internal Server Error* 155 | 156 | 157 | ## Authentication 158 | 159 | Currently we use 160 | [Mozilla Persona](https://developer.mozilla.org/en-US/Persona) and 161 | [JSON Web Token (JWT)](http://jwt.io/) 162 | 163 | ### POST /auth/login 164 | 165 | status: *basic implementation* 166 | 167 | #### request 168 | 169 | * content-type: **application/json** 170 | * payload: [Mozilla Persona assertion](https://developer.mozilla.org/en-US/docs/Web/API/navigator.id.get) 171 | 172 | ```json 173 | { "assertion": "[assertion]" } 174 | ``` 175 | 176 | #### response 177 | 178 | * content-type: **application/json** 179 | * payload: [JSON Web Token (JWT)](http://jwt.io) 180 | 181 | ```json 182 | { "token": "[token]" } 183 | ``` 184 | 185 | ### POST /auth/logout 186 | 187 | status: *planned* 188 | 189 | -------------------------------------------------------------------------------- /plp.jsonld: -------------------------------------------------------------------------------- 1 | { 2 | "@context": [ 3 | "https://w3id.org/role/", 4 | { 5 | "plp": "http://ld.hackers4peace.net/ns/plp#", 6 | "git": "http://ld.hackers4peace.net/ns/git#", 7 | "schema": "http://schema.org/", 8 | "ianarel": "http://www.iana.org/assignments/relation/", 9 | "foaf": "http://xmlns.com/foaf/0.1/", 10 | "doap": "http://usefulinc.com/ns/doap#", 11 | "cco": "http://purl.org/ontology/cco/core#", 12 | "opo": "http://online-presence.net/opo/ns#", 13 | "sec": "https://w3id.org/security#", 14 | "ldp": "http://www.w3.org/ns/ldp#", 15 | "hydra": "http://www.w3.org/ns/hydra/core#", 16 | "as": "http://www.w3.org/ns/activitystreams#", 17 | "dcterms": "http://purl.org/dc/terms/", 18 | "void": "http://rdfs.org/ns/void#", 19 | "sioc": "http://rdfs.org/sioc/ns#", 20 | "org": "http://www.w3.org/ns/org#", 21 | "resource": { "@id": "ldp:membershipResource", "@type": "@id" }, 22 | "rel": { "@id": "ldp:hasMemberRelation", "@type": "@id" }, 23 | "rev": { "@id": "ldp:isMemberOfRelation", "@type": "@id" }, 24 | "contains": { "@id": "ldp:contains", "@type": "@id" }, 25 | "ianarel:describedby": { "@type": "@id" }, 26 | "ianarel:describes": { "@type": "@id" }, 27 | "dcterms:creator": { "@type": "@id" }, 28 | "dcterms:publisher": { "@type": "@id" }, 29 | "dcterms:license": { "@type": "@id" }, 30 | "void:inDataset": { "@type": "@id" }, 31 | "id":"@id", 32 | "type": "@type" 33 | } 34 | ] 35 | } 36 | --------------------------------------------------------------------------------