relaton-w3c 1.11.5 → 1.11.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/.github/workflows/rake.yml +1 -20
 - data/data/reference.W3C.DSig-label.xml +1 -1
 - data/data/reference.W3C.P3P-rdfschema.xml +1 -1
 - data/data/reference.W3C.P3P.xml +1 -1
 - data/data/reference.W3C.PICS-labels.xml +1 -1
 - data/data/reference.W3C.PICS-rules.xml +1 -1
 - data/data/reference.W3C.PICS-services.xml +1 -1
 - data/data/reference.W3C.daml-oil-reference.xml +1 -1
 - data/data/reference.W3C.soap11.xml +1 -1
 - data/data/reference.W3C.soap12-part1.xml +1 -1
 - data/data/reference.W3C.soap12-part2.xml +1 -1
 - data/data/reference.W3C.xkms.xml +1 -1
 - data/data/reference.W3C.xml-c14n.xml +1 -1
 - data/data/reference.W3C.xmldsig-core.xml +1 -1
 - data/data/reference.W3C.xmlenc-core.xml +1 -1
 - data/data/reference.W3C.xpath.xml +1 -1
 - data/lib/relaton_w3c/data_fetcher.rb +6 -1
 - data/lib/relaton_w3c/data_parser.rb +60 -28
 - data/lib/relaton_w3c/version.rb +1 -1
 - data/lib/relaton_w3c/workgroups.yaml +2 -0
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: faf78f2abf348e9aa6dd74f2f0fe94899d9d6fc34af3368849a818b6dd856e26
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: c4cabbd9559b9f122f34fbb204f7780606bfc87c9db999492fbdd2b6b02639b3
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: cc6e6c80914b8973091795b1f234ea57a49499bb0466ae04a14358c30e526c38a6f607031e9dd0d4963c2caccca26dd9418939c871b4f47016aa094156d783a3
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 041625ce66ae2949112bc20856de89b05fd4772c1dd1f3413a3a5b04059ec7cb84f8b92517a3634294080031760fca8795b7ae113bbfae03986f775c5f52acb0
         
     | 
    
        data/.github/workflows/rake.yml
    CHANGED
    
    | 
         @@ -10,23 +10,4 @@ on: 
     | 
|
| 
       10 
10 
     | 
    
         | 
| 
       11 
11 
     | 
    
         
             
            jobs:
         
     | 
| 
       12 
12 
     | 
    
         
             
              rake:
         
     | 
| 
       13 
     | 
    
         
            -
                 
     | 
| 
       14 
     | 
    
         
            -
                runs-on: ${{ matrix.os }}
         
     | 
| 
       15 
     | 
    
         
            -
                continue-on-error: ${{ matrix.experimental }}
         
     | 
| 
       16 
     | 
    
         
            -
                strategy:
         
     | 
| 
       17 
     | 
    
         
            -
                  fail-fast: false
         
     | 
| 
       18 
     | 
    
         
            -
                  matrix:
         
     | 
| 
       19 
     | 
    
         
            -
                    ruby: [ '3.0', '2.7', '2.6' ]
         
     | 
| 
       20 
     | 
    
         
            -
                    os: [ ubuntu-latest, windows-latest, macos-latest ]
         
     | 
| 
       21 
     | 
    
         
            -
                    experimental: [ false ]
         
     | 
| 
       22 
     | 
    
         
            -
                steps:
         
     | 
| 
       23 
     | 
    
         
            -
                  - uses: actions/checkout@v2
         
     | 
| 
       24 
     | 
    
         
            -
                    with:
         
     | 
| 
       25 
     | 
    
         
            -
                      submodules: true
         
     | 
| 
       26 
     | 
    
         
            -
             
     | 
| 
       27 
     | 
    
         
            -
                  - uses: ruby/setup-ruby@v1
         
     | 
| 
       28 
     | 
    
         
            -
                    with:
         
     | 
| 
       29 
     | 
    
         
            -
                      ruby-version: ${{ matrix.ruby }}
         
     | 
| 
       30 
     | 
    
         
            -
                      bundler-cache: true
         
     | 
| 
       31 
     | 
    
         
            -
             
     | 
| 
       32 
     | 
    
         
            -
                  - run: bundle exec rake
         
     | 
| 
      
 13 
     | 
    
         
            +
                uses: relaton/support/.github/workflows/rake.yml@master
         
     | 
    
        data/data/reference.W3C.P3P.xml
    CHANGED
    
    
    
        data/data/reference.W3C.xkms.xml
    CHANGED
    
    
| 
         @@ -68,7 +68,7 @@ module RelatonW3c 
     | 
|
| 
       68 
68 
     | 
    
         
             
                end
         
     | 
| 
       69 
69 
     | 
    
         | 
| 
       70 
70 
     | 
    
         
             
                #
         
     | 
| 
       71 
     | 
    
         
            -
                # Query RDF source for documents
         
     | 
| 
      
 71 
     | 
    
         
            +
                # Query RDF source for versioned documents
         
     | 
| 
       72 
72 
     | 
    
         
             
                #
         
     | 
| 
       73 
73 
     | 
    
         
             
                # @return [RDF::Query::Solutions] query results
         
     | 
| 
       74 
74 
     | 
    
         
             
                #
         
     | 
| 
         @@ -87,6 +87,11 @@ module RelatonW3c 
     | 
|
| 
       87 
87 
     | 
    
         
             
                  data.query sse
         
     | 
| 
       88 
88 
     | 
    
         
             
                end
         
     | 
| 
       89 
89 
     | 
    
         | 
| 
      
 90 
     | 
    
         
            +
                #
         
     | 
| 
      
 91 
     | 
    
         
            +
                # Query RDF source for unversioned documents
         
     | 
| 
      
 92 
     | 
    
         
            +
                #
         
     | 
| 
      
 93 
     | 
    
         
            +
                # @return [Array<RDF::Query::Solution>] query results
         
     | 
| 
      
 94 
     | 
    
         
            +
                #
         
     | 
| 
       90 
95 
     | 
    
         
             
                def query_unversioned_docs
         
     | 
| 
       91 
96 
     | 
    
         
             
                  sse = SPARQL.parse(%(
         
     | 
| 
       92 
97 
     | 
    
         
             
                    PREFIX doc: <http://www.w3.org/2000/10/swap/pim/doc#>
         
     | 
| 
         @@ -86,9 +86,10 @@ module RelatonW3c 
     | 
|
| 
       86 
86 
     | 
    
         
             
                # @return [RelatonBib::TypedTitleStringCollection] title
         
     | 
| 
       87 
87 
     | 
    
         
             
                #
         
     | 
| 
       88 
88 
     | 
    
         
             
                def parse_title
         
     | 
| 
       89 
     | 
    
         
            -
                   
     | 
| 
       90 
     | 
    
         
            -
             
     | 
| 
       91 
     | 
    
         
            -
             
     | 
| 
      
 89 
     | 
    
         
            +
                  content = if @sol.respond_to?(:title) then @sol.title.to_s
         
     | 
| 
      
 90 
     | 
    
         
            +
                            else document_versions.max_by { |dv| dv.date.to_s }.title.to_s
         
     | 
| 
      
 91 
     | 
    
         
            +
                            end
         
     | 
| 
      
 92 
     | 
    
         
            +
                  t = RelatonBib::TypedTitleString.new content: content
         
     | 
| 
       92 
93 
     | 
    
         
             
                  RelatonBib::TypedTitleStringCollection.new [t]
         
     | 
| 
       93 
94 
     | 
    
         
             
                end
         
     | 
| 
       94 
95 
     | 
    
         | 
| 
         @@ -99,7 +100,6 @@ module RelatonW3c 
     | 
|
| 
       99 
100 
     | 
    
         
             
                #
         
     | 
| 
       100 
101 
     | 
    
         
             
                def parse_link
         
     | 
| 
       101 
102 
     | 
    
         
             
                  link = @sol.respond_to?(:link) ? @sol.link : @sol.version_of
         
     | 
| 
       102 
     | 
    
         
            -
             
     | 
| 
       103 
103 
     | 
    
         
             
                  [RelatonBib::TypedUri.new(type: "src", content: link.to_s)]
         
     | 
| 
       104 
104 
     | 
    
         
             
                end
         
     | 
| 
       105 
105 
     | 
    
         | 
| 
         @@ -109,9 +109,7 @@ module RelatonW3c 
     | 
|
| 
       109 
109 
     | 
    
         
             
                # @return [Arra<RelatonBib::DocumentIdentifier>] docidentifier
         
     | 
| 
       110 
110 
     | 
    
         
             
                #
         
     | 
| 
       111 
111 
     | 
    
         
             
                def parse_docid
         
     | 
| 
       112 
     | 
    
         
            -
                   
     | 
| 
       113 
     | 
    
         
            -
             
     | 
| 
       114 
     | 
    
         
            -
                  id = pub_id(@sol.link)
         
     | 
| 
      
 112 
     | 
    
         
            +
                  id = @sol.respond_to?(:link) ? pub_id(@sol.link) : pub_id(@sol.version_of)
         
     | 
| 
       115 
113 
     | 
    
         
             
                  [RelatonBib::DocumentIdentifier.new(type: "W3C", id: id, primary: true)]
         
     | 
| 
       116 
114 
     | 
    
         
             
                end
         
     | 
| 
       117 
115 
     | 
    
         | 
| 
         @@ -221,10 +219,16 @@ module RelatonW3c 
     | 
|
| 
       221 
219 
     | 
    
         
             
                def parse_relation
         
     | 
| 
       222 
220 
     | 
    
         
             
                  if @sol.respond_to?(:link)
         
     | 
| 
       223 
221 
     | 
    
         
             
                    relations + editor_drafts
         
     | 
| 
       224 
     | 
    
         
            -
                  else 
     | 
| 
      
 222 
     | 
    
         
            +
                  else
         
     | 
| 
      
 223 
     | 
    
         
            +
                    document_versions.map { |r| create_relation(r.link.to_s, "hasEdition") }
         
     | 
| 
       225 
224 
     | 
    
         
             
                  end
         
     | 
| 
       226 
225 
     | 
    
         
             
                end
         
     | 
| 
       227 
226 
     | 
    
         | 
| 
      
 227 
     | 
    
         
            +
                #
         
     | 
| 
      
 228 
     | 
    
         
            +
                # Create relations
         
     | 
| 
      
 229 
     | 
    
         
            +
                #
         
     | 
| 
      
 230 
     | 
    
         
            +
                # @return [Array<RelatonBib::DocumentRelation>] relations
         
     | 
| 
      
 231 
     | 
    
         
            +
                #
         
     | 
| 
       228 
232 
     | 
    
         
             
                def relations # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
         
     | 
| 
       229 
233 
     | 
    
         
             
                  {
         
     | 
| 
       230 
234 
     | 
    
         
             
                    "doc:obsoletes" => { type: "obsoletes" },
         
     | 
| 
         @@ -234,14 +238,16 @@ module RelatonW3c 
     | 
|
| 
       234 
238 
     | 
    
         
             
                    ":previousEdition" => { type: "editionOf" },
         
     | 
| 
       235 
239 
     | 
    
         
             
                  }.reduce([]) do |acc, (predicate, tp)|
         
     | 
| 
       236 
240 
     | 
    
         
             
                    acc + relation_query(predicate).map do |r|
         
     | 
| 
       237 
     | 
    
         
            -
                       
     | 
| 
       238 
     | 
    
         
            -
                      bib = W3cBibliographicItem.new formattedref: fr
         
     | 
| 
       239 
     | 
    
         
            -
                      tp[:description] = RelatonBib::FormattedString.new content: tp[:description] if tp[:description]
         
     | 
| 
       240 
     | 
    
         
            -
                      RelatonBib::DocumentRelation.new(**tp, bibitem: bib)
         
     | 
| 
      
 241 
     | 
    
         
            +
                      create_relation(r.rel.to_s, tp[:type], tp[:description])
         
     | 
| 
       241 
242 
     | 
    
         
             
                    end
         
     | 
| 
       242 
243 
     | 
    
         
             
                  end
         
     | 
| 
       243 
244 
     | 
    
         
             
                end
         
     | 
| 
       244 
245 
     | 
    
         | 
| 
      
 246 
     | 
    
         
            +
                #
         
     | 
| 
      
 247 
     | 
    
         
            +
                # Parse editor drafts relation
         
     | 
| 
      
 248 
     | 
    
         
            +
                #
         
     | 
| 
      
 249 
     | 
    
         
            +
                # @return [Array<RelatonBib::DocumentRelation>] relation
         
     | 
| 
      
 250 
     | 
    
         
            +
                #
         
     | 
| 
       245 
251 
     | 
    
         
             
                def editor_drafts # rubocop:disable Metrics/MethodLength
         
     | 
| 
       246 
252 
     | 
    
         
             
                  sse = SPARQL.parse(%(
         
     | 
| 
       247 
253 
     | 
    
         
             
                    PREFIX : <http://www.w3.org/2001/02pd/rec54#>
         
     | 
| 
         @@ -250,15 +256,17 @@ module RelatonW3c 
     | 
|
| 
       250 
256 
     | 
    
         
             
                    WHERE { <#{@sol.link}> :ED ?rel . }
         
     | 
| 
       251 
257 
     | 
    
         
             
                  ))
         
     | 
| 
       252 
258 
     | 
    
         
             
                  @fetcher.data.query(sse).map do |s|
         
     | 
| 
       253 
     | 
    
         
            -
                     
     | 
| 
       254 
     | 
    
         
            -
                    bib = W3cBibliographicItem.new formattedref: fr
         
     | 
| 
       255 
     | 
    
         
            -
                    desc = RelatonBib::FormattedString.new content: "Editor's draft"
         
     | 
| 
       256 
     | 
    
         
            -
                    RelatonBib::DocumentRelation.new(
         
     | 
| 
       257 
     | 
    
         
            -
                      type: "hasDraft", description: desc, bibitem: bib,
         
     | 
| 
       258 
     | 
    
         
            -
                    )
         
     | 
| 
      
 259 
     | 
    
         
            +
                    create_relation(s.rel.to_s, "hasDraft", "Editor's draft")
         
     | 
| 
       259 
260 
     | 
    
         
             
                  end
         
     | 
| 
       260 
261 
     | 
    
         
             
                end
         
     | 
| 
       261 
262 
     | 
    
         | 
| 
      
 263 
     | 
    
         
            +
                #
         
     | 
| 
      
 264 
     | 
    
         
            +
                # Query for relations
         
     | 
| 
      
 265 
     | 
    
         
            +
                #
         
     | 
| 
      
 266 
     | 
    
         
            +
                # @param [String] predicate relation type
         
     | 
| 
      
 267 
     | 
    
         
            +
                #
         
     | 
| 
      
 268 
     | 
    
         
            +
                # @return [RDF::Query::Solutions] query result
         
     | 
| 
      
 269 
     | 
    
         
            +
                #
         
     | 
| 
       262 
270 
     | 
    
         
             
                def relation_query(predicate)
         
     | 
| 
       263 
271 
     | 
    
         
             
                  sse = SPARQL.parse(%(
         
     | 
| 
       264 
272 
     | 
    
         
             
                    PREFIX : <http://www.w3.org/2001/02pd/rec54#>
         
     | 
| 
         @@ -270,19 +278,43 @@ module RelatonW3c 
     | 
|
| 
       270 
278 
     | 
    
         
             
                  @fetcher.data.query(sse).order_by(:rel)
         
     | 
| 
       271 
279 
     | 
    
         
             
                end
         
     | 
| 
       272 
280 
     | 
    
         | 
| 
       273 
     | 
    
         
            -
                 
     | 
| 
       274 
     | 
    
         
            -
             
     | 
| 
       275 
     | 
    
         
            -
             
     | 
| 
       276 
     | 
    
         
            -
             
     | 
| 
       277 
     | 
    
         
            -
             
     | 
| 
       278 
     | 
    
         
            -
             
     | 
| 
       279 
     | 
    
         
            -
                  @ 
     | 
| 
       280 
     | 
    
         
            -
                     
     | 
| 
       281 
     | 
    
         
            -
             
     | 
| 
       282 
     | 
    
         
            -
             
     | 
| 
      
 281 
     | 
    
         
            +
                #
         
     | 
| 
      
 282 
     | 
    
         
            +
                # Query document versions relations
         
     | 
| 
      
 283 
     | 
    
         
            +
                #
         
     | 
| 
      
 284 
     | 
    
         
            +
                # @return [RDF::Query::Solutions] query results
         
     | 
| 
      
 285 
     | 
    
         
            +
                #
         
     | 
| 
      
 286 
     | 
    
         
            +
                def document_versions # rubocop:disable Metrics/MethodLength
         
     | 
| 
      
 287 
     | 
    
         
            +
                  @document_versions ||= begin
         
     | 
| 
      
 288 
     | 
    
         
            +
                    sse = SPARQL.parse(%(
         
     | 
| 
      
 289 
     | 
    
         
            +
                      PREFIX : <http://www.w3.org/2001/02pd/rec54#>
         
     | 
| 
      
 290 
     | 
    
         
            +
                      PREFIX dc: <http://purl.org/dc/elements/1.1/>
         
     | 
| 
      
 291 
     | 
    
         
            +
                      PREFIX doc: <http://www.w3.org/2000/10/swap/pim/doc#>
         
     | 
| 
      
 292 
     | 
    
         
            +
                      PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
         
     | 
| 
      
 293 
     | 
    
         
            +
                      SELECT ?link ?title ?date
         
     | 
| 
      
 294 
     | 
    
         
            +
                      WHERE { ?link doc:versionOf <#{@sol.version_of}> ; dc:title ?title ; dc:date ?date }
         
     | 
| 
      
 295 
     | 
    
         
            +
                    ))
         
     | 
| 
      
 296 
     | 
    
         
            +
                    @fetcher.data.query(sse)
         
     | 
| 
       283 
297 
     | 
    
         
             
                  end
         
     | 
| 
       284 
298 
     | 
    
         
             
                end
         
     | 
| 
       285 
299 
     | 
    
         | 
| 
      
 300 
     | 
    
         
            +
                #
         
     | 
| 
      
 301 
     | 
    
         
            +
                # Create relation
         
     | 
| 
      
 302 
     | 
    
         
            +
                #
         
     | 
| 
      
 303 
     | 
    
         
            +
                # @param [String] url relation URL
         
     | 
| 
      
 304 
     | 
    
         
            +
                # @param [String] type relation type
         
     | 
| 
      
 305 
     | 
    
         
            +
                # @param [String, nil] desc relation description
         
     | 
| 
      
 306 
     | 
    
         
            +
                #
         
     | 
| 
      
 307 
     | 
    
         
            +
                # @return [RelatonBib::DocumentRelation] <description>
         
     | 
| 
      
 308 
     | 
    
         
            +
                #
         
     | 
| 
      
 309 
     | 
    
         
            +
                def create_relation(url, type, desc = nil)
         
     | 
| 
      
 310 
     | 
    
         
            +
                  id = pub_id(url)
         
     | 
| 
      
 311 
     | 
    
         
            +
                  fref = RelatonBib::FormattedRef.new content: id
         
     | 
| 
      
 312 
     | 
    
         
            +
                  docid = RelatonBib::DocumentIdentifier.new(type: "W3C", id: id, primary: true)
         
     | 
| 
      
 313 
     | 
    
         
            +
                  bib = W3cBibliographicItem.new formattedref: fref, docid: [docid]
         
     | 
| 
      
 314 
     | 
    
         
            +
                  dsc = RelatonBib::FormattedString.new content: desc if desc
         
     | 
| 
      
 315 
     | 
    
         
            +
                  RelatonBib::DocumentRelation.new(type: type, bibitem: bib, description: dsc)
         
     | 
| 
      
 316 
     | 
    
         
            +
                end
         
     | 
| 
      
 317 
     | 
    
         
            +
             
     | 
| 
       286 
318 
     | 
    
         
             
                #
         
     | 
| 
       287 
319 
     | 
    
         
             
                # Parse formattedref
         
     | 
| 
       288 
320 
     | 
    
         
             
                #
         
     | 
    
        data/lib/relaton_w3c/version.rb
    CHANGED
    
    
| 
         @@ -103,6 +103,8 @@ 
     | 
|
| 
       103 
103 
     | 
    
         
             
              name: Web Services Architecture Working Group
         
     | 
| 
       104 
104 
     | 
    
         
             
            'https://www.w3.org/2011/webappsec':
         
     | 
| 
       105 
105 
     | 
    
         
             
              name: Web Application Security Working Group
         
     | 
| 
      
 106 
     | 
    
         
            +
            'https://www.w3.org/groups/wg/webappsec':
         
     | 
| 
      
 107 
     | 
    
         
            +
              name: Web Application Security Working Group
         
     | 
| 
       106 
108 
     | 
    
         
             
            'https://www.w3.org/Social/WG':
         
     | 
| 
       107 
109 
     | 
    
         
             
              name: Social Web Working Group
         
     | 
| 
       108 
110 
     | 
    
         
             
            'https://www.w3.org/XML/Core':
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: relaton-w3c
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1.11. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.11.6
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Ribose Inc.
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: exe
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2022- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2022-06-01 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: equivalent-xml
         
     |