Your SlideShare is downloading. ×
  • Like
The Site is the API
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

The Site is the API

  • 826 views
Published

 

Published in Technology , Education
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
826
On SlideShare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
2
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. The Site is the API Nathan R. Yergler Creative Commons
  • 2. share, reuse, and remix— legally
  • 3.  
  • 4.  
  • 5. <a href=” http://creativecommons.org/licenses/by/3.0/ ” rel=”license”> Attribution 3.0 Unported </a>
  • 6. Why do we care? Programs should be able to answer simple questions about licensed works.
    • What is the work's license?
    • 7. Does it allow commercial use?
    • 8. Are derivative works allowed?
    • 9. How do we attribute the work?
  • 10.  
  • 11. CC Network
    • Launched October 2008
    • 12. A place creators to collect work references
    • 13. A platform for digital copyright registry exploration
    • 14. Free Software: AGPL 3, available from code.creativecommons.org
  • 15. Registry Requirements
    • Allow users to “claim” a work
      • Identify works by URL
      • 16. Wildcard claiming: http://yergler.net/*
    • Make registration information available to other applications/agents
    • 17. Allow applications to query registrations
    • 18. Allow creators to mark works as “registered”
  • 19. Deed Requirements
    • Integrate registration information on CC Deeds
    • 20. Support registries other than CC Network
  • 21.  
  • 22. How do other registries “play”?
    • Several commercial registries are CC Enabled
    • 23. This is an exploratory project; we probably don't have all the answers
    • 24. We should just get out of the way
  • 25. Key Requirements
    • Make registration information available to other applications/agents
    • 26. Integrate registration information on CC Deeds
    • 27. Allow others to play
  • 28. Prior Art
  • 29. Prior Art – Attribution Metadata
    • Users can assert a name and URL for Attribution
    • 30. We encode this in the generated HTML
    • 31. Our deeds look at the Referrer to find this
    • 32. “ Eating our own dogfood”
      • We recommend RDFa
      • 33. And we consume it
  • 34. Prior Art – Retrieving RDFa
    • Same-domain restriction complicates things
    • 35. We could parse the RDFa client side if not for that restriction
    • 36. Developed a “scraper” application
      • Takes a URL
      • 37. Retrieves it and extracts RDFa
      • 38. Returns a JSON serialization
    • Python WSGI application makes deployment and integration with existing app easy
  • 39. Registering Works
  • 40. Exposing Registration Information
    • We identify works by URI
    • 41. We also record the license URI
    • 42. Publish a single page per Registration
    • 43. A Registration may include multiple Works
    • 44. RDFa is used to encode the registration information
  • 45. Interface Considerations
    • Javascript is limited to progressive enhancement
      • RDFa builds on the existing DOM
      • 46. We could insert the RDFa with Javascript but that severely increases demand on consumers
  • 47.  
  • 48.  
  • 49. Published Assertions
      <https://creativecommons.net/nathan/> <http://rdfs.org/sioc/ns#owner_of> <http://labs.creativecommons.org/ ~nathan/info/decoupling.html> .
  • 50. Creator Identification
      <https://creativecommons.net/nathan/>
      <http://rdfs.org/sioc/ns#name>
      &quot;Nathan Yergler&quot;@en . <https://creativecommons.net/nathan/> <http://rdfs.org/sioc/ns#member_of>
      <https://creativecommons.net/> .
  • 51. Registry Identification
      <https://creativecommons.net/>
      <http://purl.org/dc/terms/title>
      &quot;CC Network&quot;@en .
  • 52. Testing
    • At this point we've implemented a basic “API”
    • 53. We want to make sure it doesn't break
    • 54. We can use a stock RDFa parser to test this
  • 55. Testing Example
      def testRegistration(self): # create a registration reg = Registration(url=”http://example.org/1”, title=”Test Registration”, license=”http://creativecommons.org/...”) # render & parse for RDFa triples = rdfdict.RdfaParser().parse_url( r.get_absolute_url()) # assert it contains the interesting triples assert “http://example.org/1” in triples[r.get_absolute_url()][SIOC(owner_of)]
  • 56. Querying Registrations
  • 57. Querying Registrations
    • Look up registration by URI
    • 58. Others may implement differently so useful to perform “discovery”
    • 59. We can publish assertions about the service
    • 60. Ideally the “protocol” assertion contains enough information for developers to build a client implementation
  • 61. Service Identification
      <https://creativecommons.net/>
      <sioc_services#has_service> <https://creativecommons.net/r/lookup/> . <https://creativecommons.net/r/lookup/> <http://rdfs.org/sioc/services#service_protocol> <http://wiki.creativecommons.org/work-lookup> .
  • 62. Query Results
    • We already have code for rendering the registration with RDFa
    • 63. We can re-use this:
      • On success, redirect to the actual Registration page
      • 64. On failure, HTTP 404
  • 65. “Validating” Registrations
  • 66. Network Membership Badge
    • Actually important!
    • 67. How can other agents trust claims we publish?
    • 68. Need an additional piece of “confirmation”
  • 69.  
  • 70. Published Assertions
      <> <http://rdfs.org/sioc/ns#has_owner> <https://creativecommons.net/nathan/> .
  • 71. Binding Work and Profile
      <https://creativecommons.net/nathan/> <http://rdfs.org/sioc/ns#owner_of> <http://labs.creativecommons.org/ ~nathan/info/decoupling.html> .
      <http://labs.creativecommons.org/ ~nathan/info/decoupling.html> <http://rdfs.org/sioc/ns#has_owner> <https://creativecommons.net/nathan/> .
  • 72. Reciprocal Ownership Metadata “ Identity” Work
  • 73. The Deeds Are An Application
  • 74. Network + License Badges
  • 75.  
  • 76. Metadata Instead of Coupling
    • Deeds request metadata from the referring page
      • Attribution Information
      • 77. Ownership information
    • Certain relationships are traversed
      • rdf:seeAlso
      • 78. sioc:memberOf
  • 79. Metadata Instead of Coupling
  • 80. Metadata Instead of Coupling
  • 81. Testing
    • Test individual pieces:
      • Make sure we're publishing assertions
      • 82. Scraper/Proxy has its own test suite
    • Remaining pieces to test:
      • Client publication
      • 83. Deed javascript
    • Currently:
      • Functional testing
  • 84. Challenges
    • Requires additional server side proxy
    • 85. Time outs
  • 86. General Principles
    • You're probably using templates already – make them useful for software, too.
    • 87. Vocab mix-n-match is fine: use established vocabularies whenever possible (DC, etc).
    • 88. If you're a market leader (or hope to be), commit to publishing a minimum set of information.
    • 89. Think about your URIs – you're making a commitment to maintain them.
  • 90. Ongoing Work & Improvements
  • 91. Science Commons MTA
    • Similar to our Attribution work
    • 92. More complex model:
      • Agreements are “parameterized”
      • 93. Need to supply the details of a specific Offer
      • 94. Want to do so in a machine readable way
    • Forms the basis for a more generic Javascript implementation
  • 95. Using SPARQL
    • Currently do pre-processing server side, return JSON representing nested arrays
    • 96. Would like to write assertions as SPARQL queries instead of JSON array traversal
    • 97. Ubiquity (Mark Birbeck) has a Javascript SPARQL implementation (jSPARQL)
      • http://code.google.com/p/ubiquity-rdfa/
  • 98. jSPARQL YAHOO.cc.mta.MTA_INFO = { select: [ &quot;offer&quot;, &quot;material&quot;, &quot;disease&quot;, &quot;offer_permits&quot;], where: [ { pattern: [ &quot;?offer&quot;, &quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&quot;, &quot;http://mta.sciencecommons.org/ns#Offer&quot; ] }, { pattern: [ &quot;?offer&quot;, &quot;http://mta.sciencecommons.org/ns#agreement&quot;, document.URL ] }, ... }
  • 99. JSPARQL Querying YAHOO.cc.mta.MTA_INFO = { select: [ &quot;offer&quot;, &quot;material&quot;, &quot;disease&quot;, &quot;offer_permits&quot;], where: [ { pattern: [ &quot;?offer&quot;, &quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&quot;, &quot;http://mta.sciencecommons.org/ns#Offer&quot; ] }, { pattern: [ &quot;?offer&quot;, &quot;http://mta.sciencecommons.org/ns#agreement&quot;, document.URL ] }, ... } var query = new RDFQuery(store); var results = query.query2(YAHOO.cc.mta.MTA_INFO); // iterate over our result set query.walk2(results, { action : function (obj) { // obj has attributes for each selected value document.write(obj.offer); }});
  • 100. Aggregate Data Access
    • Linked data provides a solution for individual level – tell me about this one thing
    • 101. What if I want to know about all the records?
    • 102. Sparken is a Python WSGI application that serves up SPARQL
      • Simple web crawler for easy data injection
      • 103. Easily deployed with WSGI
      • 104. [real soon now]
  • 105. Nathan R. Yergler Chief Technology Officer Creative Commons [email_address] http://wiki.creativecommons.org/The_Site_is_the_API