Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-docs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Platform
Development
swh-docs
Commits
a9597cec
Commit
a9597cec
authored
1 month ago
by
Renaud Boyer
Browse files
Options
Downloads
Patches
Plain Diff
metadata reference
parent
1cfe8571
No related branches found
No related tags found
No related merge requests found
Pipeline
#14326
failed
1 month ago
Stage: external
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/deposit/howto/prepare.rst
+3
-9
3 additions, 9 deletions
docs/deposit/howto/prepare.rst
docs/deposit/references/metadata.rst
+109
-1
109 additions, 1 deletion
docs/deposit/references/metadata.rst
with
112 additions
and
10 deletions
docs/deposit/howto/prepare.rst
+
3
−
9
View file @
a9597cec
...
...
@@ -6,7 +6,6 @@ Prepare your metadata and artifacts
A deposit is constituted of a metadata file and optionally one or more software
artefacts.
The metadata file
-----------------
...
...
@@ -42,14 +41,9 @@ swh:deposit
This namespace is specific to our implementation of the SWORD v2 protocol, it's used
to describe what kind of deposit the you are doing:
- a first code deposit for an ``ORIGIN_URL`` not yet archived by SWH
- a new code deposit (i.e. another version of the software) for an existing
``ORIGIN_URL``
- a metadata-only deposit for a ``SWHID`` or an ``ORIGIN_URL``
.. tab-set::
.. tab-item:: Initial
code
deposit
``create_origin``
.. tab-item:: Initial deposit
.. code-block:: xml
...
...
@@ -59,7 +53,7 @@ to describe what kind of deposit the you are doing:
</swh:create_origin>
</swh:deposit>
.. tab-item:: New version
code
deposit
``add_to_origin``
.. tab-item:: New version deposit
.. code-block:: xml
...
...
@@ -69,7 +63,7 @@ to describe what kind of deposit the you are doing:
</swh:add_to_origin>
</swh:deposit>
.. tab-item:: Metadata-only deposit
``reference``
.. tab-item:: Metadata-only deposit
.. code-block:: xml
...
...
This diff is collapsed.
Click to expand it.
docs/deposit/references/metadata.rst
+
109
−
1
View file @
a9597cec
...
...
@@ -90,6 +90,115 @@ Or, equivalently:
Note that in both these examples, ``codemeta:name`` is used even though
the property is actually ``http://schema.org/name``.
swh:deposit
~~~~~~~~~~~
This namespace is specific to our implementation of the SWORD v2 protocol, it's used
to describe what kind of deposit the you are doing.
A first code deposit for an ``ORIGIN_URL`` not yet archived by SWH using
``<swh:create_origin>``:
.. code-block:: xml
<swh:deposit>
<swh:create_origin>
<swh:origin url="ORIGIN_URL" />
</swh:create_origin>
</swh:deposit>
A new code deposit (i.e. another version of the software) for an existing
``ORIGIN_URL``:
.. code-block:: xml
<swh:deposit>
<swh:add_to_origin>
<swh:origin url="ORIGIN_URL" />
</swh:add_to_origin>
</swh:deposit>
A metadata-only deposit for a ``SWHID`` or an ``ORIGIN_URL`` using ``<swh:reference>``:
.. code-block:: xml
<swh:deposit>
<swh:reference>
<swh:object swhid="SWHID_CONTEXT" />
<!-- or -->
<swh:object swhid="SWHID" />
<!-- or -->
<swh:origin url="ORIGIN_URL" />
</swh:reference>
</swh:deposit>
To indicate where the metadata is coming from, deposit clients can use a
``<swhdeposit:metadata-provenance>`` element in ``<swhdeposit:deposit>`` whose content
is the object the metadata is coming from, preferably using the ``http://schema.org/``
namespace.
For example, when the metadata is coming from Wikidata, then the
``<swhdeposit:metadata-provenance>`` should be the page of a Q-entity, such as
``https://www.wikidata.org/wiki/Q16988498`` (not the Q-entity
``http://www.wikidata.org/entity/Q16988498`` itself, as the Q-entity **is** the
object described in the metadata)
Or when the metadata is coming from a curated repository like HAL, then
``<swhdeposit:metadata-provenance>`` should be the HAL project.
In particular, Software Heritage expects the ``<swhdeposit:metadata-provenance>`` object
to have a ``http://schema.org/url`` property, so that it can appropriately link
to the original page.
For example, to deposit metadata on GNU Hello:
.. code:: xml
<?xml version="1.0"?>
<entry xmlns="http://www.w3.org/2005/Atom"
xmlns:schema="http://schema.org/">
<!-- ... -->
<swh:deposit>
<swh:metadata-provenance>
<schema:url>https://www.wikidata.org/wiki/Q16988498</schema:url>
</swh:metadata-provenance>
</swh:deposit>
<!-- ... -->
</entry>
Here is a more complete example of a metadata-only deposit on version 2.9 of GNU Hello,
to show the interaction with other fields,
.. code:: xml
<?xml version="1.0"?>
<entry xmlns="http://www.w3.org/2005/Atom"
xmlns:swh="https://www.softwareheritage.org/schema/2018/deposit"
xmlns:schema="http://schema.org/"
xmlns:codemeta="https://doi.org/10.5063/SCHEMA/CODEMETA-2.0">
<swh:deposit>
<swh:reference>
<swh:object swhid="swh:1:dir:9b6f93b12a500f560796c8dffa383c7f4470a12f;origin=https://ftp.gnu.org/gnu/hello/;visit=swh:1:snp:1abd6aa1901ba0aa7f5b7db059250230957f8434;anchor=swh:1:rev:3d41fbdb693ba46fdebe098782be4867038503e2" />
</swh:reference>
<swh:metadata-provenance>
<schema:url>https://www.wikidata.org/wiki/Q16988498</schema:url>
</swh:metadata-provenance>
</swh:deposit>
<codemeta:name>GNU Hello</codemeta:name>
<codemeta:id>http://www.wikidata.org/entity/Q16988498</codemeta:id>
<codemeta:url>https://www.gnu.org/software/hello/</codemeta:url>
<!-- is part of the GNU project -->
<codemeta:isPartOf>http://www.wikidata.org/entity/Q7598</codemeta:isPartOf>
</entry>
Properties
----------
...
...
@@ -122,7 +231,6 @@ here for clarity.
* - codemeta:license
- The license(s) of the software
See the `full CodeMeta terms list <https://codemeta.github.io/terms/>`_ for a complete
reference of the available properties.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment