From fde373077a4009d714681d49f7fab5d7f604fdb1 Mon Sep 17 00:00:00 2001 From: Dan Brickley Date: Wed, 5 Feb 2020 21:21:42 +0100 Subject: [PATCH] move V6 patch and medical, usageinfo drafts into master (#2456) * Reinstated 301 redirect to https * Fixed typo: Recommendation not Recommended. * Add in tweaks to OPTIONS request response headers * Drafting implementation of MediaReview for discussion. /cc #2450 * Updated mediaAuthenticityCategory label. * Added disclaimer. /cc #2450 * updated so that label matches id. * usageInfo and acquireLicensePage properties #2454 Co-authored-by: Richard Wallis --- data/ext/pending/issue-2450.rdfa | 62 +++++++++++ data/ext/pending/issue-2454.rdfa | 28 +++++ handlers-secure.yaml | 176 +++++++++++++++++++++++++++++++ runpythonpostprepare.sh | 13 ++- scripts/deployschema.org.sh | 1 + sdopythonapp | 2 +- 6 files changed, 280 insertions(+), 2 deletions(-) create mode 100644 data/ext/pending/issue-2450.rdfa create mode 100644 data/ext/pending/issue-2454.rdfa create mode 100644 handlers-secure.yaml diff --git a/data/ext/pending/issue-2450.rdfa b/data/ext/pending/issue-2450.rdfa new file mode 100644 index 0000000000..f53a65c4ad --- /dev/null +++ b/data/ext/pending/issue-2450.rdfa @@ -0,0 +1,62 @@ +
+ +
+ Subclass of: Review + MediaReview + (editorial work in progress, this definition is incomplete and unreviewed) + A [[MediaReview]] is a more specialized form of Review dedicated to the evaluation of media content online, typically in the context of fact-checking and misinformation. + For more general reviews of media in the broader sense, use [[UserReview]], [[CriticReview]] or other [[Review]] types. + issue-2450 + #2450 + +
+ + + in ClaimReview we use .itemReviewed pointing to a /Claim here, should we point to the VideoObject or the page that embeds it? + we want to point to these for each MediaObject: URL(s) + Original Media URL(s) + Original Media Context + MediaObject has /contentUrl + (we wouldn't use /mainEntity or /mainEntityOfPage because the video is no being described). + --> + + +
+ Category: issue-2450 + MediaManipulationRatingEnumeration + (editorial work in progress, this definition is incomplete and unreviewed) MediaManipulationRatingEnumeration classifies a number of ways in which a media item (video, image, audio) can be manipulated, taking into account the context within which they are published or presented. + Subclass of: Enumeration + + Source: #2450 +
+ + + +
+ Category: issue-2450 + AuthenticContent + AuthenticMediaObject: An unaltered image that is presented in an accurate way. + + Source: #2450 +
+
+ Category: issue-2450 + MissingContext + MissingContext: ... + + Source: #2450 +
+ + + + +
+ Category: issue-2450 + mediaAuthenticityCategory + Indicates a MediaManipulationRatingEnumeration classification of a media object (in the context of how it was published or shared). + domainIncludes: MediaReview + rangeIncludes: MediaManipulationRatingEnumeration + + Source: #2450 +
+ +
diff --git a/data/ext/pending/issue-2454.rdfa b/data/ext/pending/issue-2454.rdfa new file mode 100644 index 0000000000..5aed3d1039 --- /dev/null +++ b/data/ext/pending/issue-2454.rdfa @@ -0,0 +1,28 @@ +
+ +
+ usageInfo + The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options. + +This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses. + Domain: CreativeWork + Range: CreativeWork + Range: URL + Category: issue-2454 + + Source: #2454 +
+ +
+ acquireLicensePage + Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item. + Domain: CreativeWork + Range: CreativeWork + Range: URL + Category: issue-2454 + issue-894.rdfa: + + Source: #2454 +
+ +
diff --git a/handlers-secure.yaml b/handlers-secure.yaml new file mode 100644 index 0000000000..5d80650f83 --- /dev/null +++ b/handlers-secure.yaml @@ -0,0 +1,176 @@ + +handlers: + +- url: /robots.txt + static_files: site/docs/robots.txt + upload: site/docs/robots.txt + application_readable: True + mime_type: text/plain + secure: always + redirect_http_response_code: 301 + + +- url: /favicon.ico + static_files: site/docs/favicon.ico + upload: site/docs/favicon.ico + application_readable: True + mime_type: image/x-icon + secure: always + redirect_http_response_code: 301 + + +# To avoid: "Could not guess mimetype for docs/schemaorg.owl. Using application/octet-stream." +- url: /docs/schema_org_rdfa.html + static_files: site/data/schema.rdfa + upload: site/data/schema.rdfa + application_readable: True + mime_type: text/html + secure: always + redirect_http_response_code: 301 + +- url: /docs/jsonldcontext.json.* + script: sdoapp.app + secure: always + redirect_http_response_code: 301 + +- url: /docs/full.*.html + script: sdoapp.app + secure: always + redirect_http_response_code: 301 + +- url: /docs/schemas.html + script: sdoapp.app + secure: always + redirect_http_response_code: 301 + +- url: /docs/developers.html + script: sdoapp.app + secure: always + redirect_http_response_code: 301 + +- url: /docs/tree.json.* + script: sdoapp.app + secure: always + redirect_http_response_code: 301 + +- url: /admin/refresh + login: required + script: sdoapp.app + secure: always + redirect_http_response_code: 301 + +# Use for /docs when PAGESTOREMODE not set to CLOUDSTORE +#- url: /docs + #static_dir: docs + #application_readable: True + +# Use for /docs when PAGESTOREMODE set to CLOUDSTORE +- url: /docs + script: sdoapp.app + secure: always + redirect_http_response_code: 301 + +- url: /admin + static_dir: admin + application_readable: True + secure: always + redirect_http_response_code: 301 + +#- url: / +# static_files: static/index.html +# upload: static/index.html +# application_readable: True + +- url: /search_files + static_dir: static/search_files + secure: always + redirect_http_response_code: 301 + +- url: /version/latest/.* + script: sdoapp.app + secure: always + redirect_http_response_code: 301 + +- url: /(version/[^/]*/)$ + script: sdoapp.app + secure: always + redirect_http_response_code: 301 + +- url: /(version/([^/]*))$ + script: sdoapp.app + secure: always + redirect_http_response_code: 301 + +- url: /version/ + script: sdoapp.app + secure: always + redirect_http_response_code: 301 + +- url: /version/(.*/.*\.rdfa) + mime_type: text/html + static_files: site/data/releases/\1 + upload: site/data/releases/(.*/.*\.rdfa) + application_readable: True + secure: always + redirect_http_response_code: 301 + +- url: /version/(.*/.*\.ttl) + mime_type: application/x-turtle + static_files: site/data/releases/\1 + upload: site/data/releases/(.*/.*\.ttl) + application_readable: True + secure: always + redirect_http_response_code: 301 + +- url: /version/(.*/.*\.jsonld) + mime_type: application/ld+json + static_files: site/data/releases/\1 + upload: site/data/releases/(.*/.*\.jsonld) + application_readable: True + secure: always + redirect_http_response_code: 301 + +- url: /version/(.*/.*\.rdf) + mime_type: application/rdf+xml + static_files: site/data/releases/\1 + upload: site/data/releases/(.*/.*\.rdf) + application_readable: True + secure: always + redirect_http_response_code: 301 + +- url: /version/(.*/.*\.nt) + mime_type: application/n-triples + static_files: site/data/releases/\1 + upload: site/data/releases/(.*/.*\.nt) + application_readable: True + secure: always + redirect_http_response_code: 301 + +- url: /version/(.*/.*\.nq) + mime_type: application/n-quads + static_files: site/data/releases/\1 + upload: site/data/releases/(.*/.*\.nq) + application_readable: True + secure: always + redirect_http_response_code: 301 + +- url: /version/(.*/.*\.csv) + mime_type: text/csv + static_files: site/data/releases/\1 + upload: site/data/releases/(.*/.*\.csv) + application_readable: True + secure: always + redirect_http_response_code: 301 + +- url: /version/*/* + static_dir: site/data/releases/ + application_readable: True + secure: always + redirect_http_response_code: 301 + +- url: /.* + script: sdoapp.app + secure: always + redirect_http_response_code: 301 + + diff --git a/runpythonpostprepare.sh b/runpythonpostprepare.sh index 8d6f62c20c..90d8601ff5 100755 --- a/runpythonpostprepare.sh +++ b/runpythonpostprepare.sh @@ -5,6 +5,17 @@ set -u PWD="`pwd`" PROG="`basename $0`" + +if [ ${SECUREHTTP+"false"} ] #If $SECUREHTTP is set, use the handlers-secure.yaml +then + echo "$PROG: Copying handlers-secure.yaml to handlers.yaml - https 301 redirect" + cp ./handlers-secure.yaml sdopythonapp/site/handlers.yaml +else + echo "$PROG: Copying handlers.yaml to handlers.yaml - http or https" + cp ./handlers.yaml sdopythonapp/site/handlers.yaml +fi +echo + if [ -d "sdopythonapp/site/docs" ] #If we have a local fileset to play with (ie. Not remote) then echo @@ -17,4 +28,4 @@ then cp docs/robots.txt sdopythonapp/site/docs/robots.txt fi echo -fi \ No newline at end of file +fi diff --git a/scripts/deployschema.org.sh b/scripts/deployschema.org.sh index 2d7cbb6602..4eb674efcf 100755 --- a/scripts/deployschema.org.sh +++ b/scripts/deployschema.org.sh @@ -57,5 +57,6 @@ then fi +export SECUREHTTP="YES" #ensure we end up with a handlers.yaml with https redirects sdopythonapp/runscripts/runpythondeploy.sh $EXE $MIG -p schemaorgae -y schemaorg.yaml diff --git a/sdopythonapp b/sdopythonapp index c520eaa32f..15b27f5e60 160000 --- a/sdopythonapp +++ b/sdopythonapp @@ -1 +1 @@ -Subproject commit c520eaa32f71103a5d721b6a5ade9de20f77c092 +Subproject commit 15b27f5e6003e0bb18784f6ab5031181fd162bcb