Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions osf/metadata/osf_gathering.py
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,8 @@ def gather_user_basics(focus):
if isinstance(focus.dbmodel, osfdb.OSFUser):
yield (RDF.type, FOAF.Person) # note: assumes osf user accounts represent people
yield (FOAF.name, focus.dbmodel.fullname)
yield (FOAF.givenName, focus.dbmodel.given_name)
yield (FOAF.familyName, focus.dbmodel.family_name)
_social_links = focus.dbmodel.social_links
# special cases abound! do these one-by-one (based on OSFUser.SOCIAL_FIELDS)
yield (DCTERMS.identifier, _social_links.get('github'))
Expand Down
8 changes: 4 additions & 4 deletions osf/metadata/serializers/google_dataset_json_ld.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ def metadata_as_dict(self) -> dict:

def format_creators(basket):
creator_data = []
for creator in basket.focus.dbmodel.contributors.all():
for creator_iri in basket[DCTERMS.creator]:
creator_data.append({
'@type': 'Person',
'name': creator.fullname,
'givenName': creator.given_name,
'familyName': creator.family_name
'name': next(basket[creator_iri:FOAF.name]),
'givenName': next(basket[creator_iri:FOAF.givenName]),
'familyName': next(basket[creator_iri:FOAF.familyName]),
})
return creator_data

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"@context": "https://schema.org",
"@type": "Dataset",
"creator": [],
"dateCreated": "2123-05-04",
"dateModified": "2123-05-04",
"description": "No description was included in this Dataset collected from the OSF",
"identifier": [
"http://localhost:5000/w3ibb"
],
"keywords": [],
"license": [],
"name": "my-file.blarg",
"publisher": {
"@type": "Organization",
"name": "Center For Open Science"
},
"url": "http://localhost:5000/w3ibb"
}
2 changes: 2 additions & 0 deletions osf_tests/metadata/expected_metadata_files/file_basic.turtle
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
<http://localhost:5000/w1ibb> a dcterms:Agent,
foaf:Person ;
dcterms:identifier "http://localhost:5000/w1ibb" ;
foaf:givenName "Person" ;
foaf:familyName "McNamington" ;
foaf:name "Person McNamington" .

<http://localhost:5000> a dcterms:Agent,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"@context": "https://schema.org",
"@type": "Dataset",
"creator": [],
"dateCreated": "2123-05-04",
"dateModified": "2123-05-04",
"description": "No description was included in this Dataset collected from the OSF",
"identifier": [
"http://localhost:5000/w3ibb"
],
"keywords": [],
"license": [],
"name": "my-file.blarg",
"publisher": {
"@type": "Organization",
"name": "Center For Open Science"
},
"url": "http://localhost:5000/w3ibb"
}
2 changes: 2 additions & 0 deletions osf_tests/metadata/expected_metadata_files/file_full.turtle
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
<http://localhost:5000/w1ibb> a dcterms:Agent,
foaf:Person ;
dcterms:identifier "http://localhost:5000/w1ibb" ;
foaf:givenName "Person" ;
foaf:familyName "McNamington" ;
foaf:name "Person McNamington" .

<http://localhost:5000> a dcterms:Agent,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"@context": "https://schema.org",
"@type": "Dataset",
"creator": [
{
"@type": "Person",
"familyName": "McNamington",
"givenName": "Person",
"name": "Person McNamington"
}
],
"dateCreated": "2123-05-04",
"dateModified": "2123-05-04",
"description": "No description was included in this Dataset collected from the OSF",
"identifier": [
"https://doi.org/11.pp/FK2osf.io/w4ibb_v1",
"http://localhost:5000/w4ibb"
],
"keywords": [],
"license": [],
"name": "this is a preprint title!",
"publisher": {
"@type": "Organization",
"name": "Center For Open Science"
},
"url": "http://localhost:5000/w4ibb"
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@
<http://localhost:5000/w1ibb> a dcterms:Agent,
foaf:Person ;
dcterms:identifier "http://localhost:5000/w1ibb" ;
foaf:givenName "Person" ;
foaf:familyName "McNamington" ;
foaf:name "Person McNamington" .

<http://localhost:8000/v2/providers/preprints/preprovi/subjects/> a skos:ConceptScheme ;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"@context": "https://schema.org",
"@type": "Dataset",
"creator": [
{
"@type": "Person",
"familyName": "McNamington",
"givenName": "Person",
"name": "Person McNamington"
}
],
"dateCreated": "2123-05-04",
"dateModified": "2123-05-04",
"description": "No description was included in this Dataset collected from the OSF",
"identifier": [
"https://doi.org/11.pp/FK2osf.io/w4ibb_v1",
"http://localhost:5000/w4ibb"
],
"keywords": [],
"license": [],
"name": "this is a preprint title!",
"publisher": {
"@type": "Organization",
"name": "Center For Open Science"
},
"url": "http://localhost:5000/w4ibb"
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@
<http://localhost:5000/w1ibb> a dcterms:Agent,
foaf:Person ;
dcterms:identifier "http://localhost:5000/w1ibb" ;
foaf:givenName "Person" ;
foaf:familyName "McNamington" ;
foaf:name "Person McNamington" .

<http://localhost:8000/v2/providers/preprints/preprovi/subjects/> a skos:ConceptScheme ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
],
"descriptions": [
{
"description": "this is a project description!",
"description": "this is a project description! it describes the project and is more than fifty characters long",
"descriptionType": "Abstract"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<rights>No license</rights>
</rightsList>
<descriptions>
<description descriptionType="Abstract">this is a project description!</description>
<description descriptionType="Abstract">this is a project description! it describes the project and is more than fifty characters long</description>
</descriptions>
<fundingReferences/>
<relatedIdentifiers>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"@context": "https://schema.org",
"@type": "Dataset",
"creator": [
{
"@type": "Person",
"familyName": "McNamington",
"givenName": "Person",
"name": "Person McNamington"
}
],
"dateCreated": "2123-05-04",
"dateModified": "2123-05-04",
"description": "this is a project description! it describes the project and is more than fifty characters long",
"identifier": [
"http://localhost:5000/w2ibb",
"https://doi.org/10.70102/FK2osf.io/w2ibb"
],
"keywords": [],
"license": [
{
"@type": "CreativeWork",
"name": [
"No license"
],
"url": []
}
],
"name": "this is a project title!",
"publisher": {
"@type": "Organization",
"name": "Center For Open Science"
},
"url": "http://localhost:5000/w2ibb"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
dcterms:created "2123-05-04" ;
dcterms:creator <http://localhost:5000/w1ibb> ;
dcterms:dateCopyrighted "2252" ;
dcterms:description "this is a project description!" ;
dcterms:description "this is a project description! it describes the project and is more than fifty characters long" ;
dcterms:hasVersion <http://localhost:5000/w5ibb> ;
dcterms:identifier "http://localhost:5000/w2ibb",
"https://doi.org/10.70102/FK2osf.io/w2ibb" ;
Expand Down Expand Up @@ -94,6 +94,8 @@
<http://localhost:5000/w1ibb> a dcterms:Agent,
foaf:Person ;
dcterms:identifier "http://localhost:5000/w1ibb" ;
foaf:givenName "Person" ;
foaf:familyName "McNamington" ;
foaf:name "Person McNamington" .

<http://localhost:5000> a dcterms:Agent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
],
"descriptions": [
{
"description": "this is a project description!",
"description": "this is a project description! it describes the project and is more than fifty characters long",
"descriptionType": "Abstract",
"lang": "en"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<rights rightsURI="https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode">CC-By Attribution-NonCommercial-NoDerivatives 4.0 International</rights>
</rightsList>
<descriptions>
<description descriptionType="Abstract" xml:lang="en">this is a project description!</description>
<description descriptionType="Abstract" xml:lang="en">this is a project description! it describes the project and is more than fifty characters long</description>
</descriptions>
<fundingReferences>
<fundingReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"@context": "https://schema.org",
"@type": "Dataset",
"creator": [
{
"@type": "Person",
"familyName": "McNamington",
"givenName": "Person",
"name": "Person McNamington"
}
],
"dateCreated": "2123-05-04",
"dateModified": "2123-05-04",
"description": "this is a project description! it describes the project and is more than fifty characters long",
"identifier": [
"http://localhost:5000/w2ibb",
"https://doi.org/10.70102/FK2osf.io/w2ibb"
],
"keywords": [],
"license": [
{
"@type": "CreativeWork",
"name": [
"CC-By Attribution-NonCommercial-NoDerivatives 4.0 International"
],
"url": [
"https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode"
]
}
],
"name": "this is a project title!",
"publisher": {
"@type": "Organization",
"name": "Center For Open Science"
},
"url": "http://localhost:5000/w2ibb"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
dcterms:created "2123-05-04" ;
dcterms:creator <http://localhost:5000/w1ibb> ;
dcterms:dateCopyrighted "2250-2254" ;
dcterms:description "this is a project description!"@en ;
dcterms:description "this is a project description! it describes the project and is more than fifty characters long"@en ;
dcterms:hasVersion <http://localhost:5000/w5ibb> ;
dcterms:identifier "http://localhost:5000/w2ibb",
"https://doi.org/10.70102/FK2osf.io/w2ibb" ;
Expand Down Expand Up @@ -123,6 +123,8 @@
<http://localhost:5000/w1ibb> a dcterms:Agent,
foaf:Person ;
dcterms:identifier "http://localhost:5000/w1ibb" ;
foaf:givenName "Person" ;
foaf:familyName "McNamington" ;
foaf:name "Person McNamington" .

<http://localhost:5000> a dcterms:Agent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
],
"descriptions": [
{
"description": "this is a project description!",
"description": "this is a project description! it describes the project and is more than fifty characters long",
"descriptionType": "Abstract"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<rights>No license</rights>
</rightsList>
<descriptions>
<description descriptionType="Abstract">this is a project description!</description>
<description descriptionType="Abstract">this is a project description! it describes the project and is more than fifty characters long</description>
</descriptions>
<fundingReferences/>
<relatedIdentifiers>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"@context": "https://schema.org",
"@type": "Dataset",
"creator": [
{
"@type": "Person",
"familyName": "McNamington",
"givenName": "Person",
"name": "Person McNamington"
}
],
"dateCreated": "2123-05-04",
"dateModified": "2123-05-04",
"description": "this is a project description! it describes the project and is more than fifty characters long",
"distribution": [
{
"@type": "DataDownload",
"contentUrl": "http://localhost:7777/v1/resources/w5ibb/providers/osfstorage/?zip=",
"encodingFormat": "URL"
}
],
"identifier": [
"http://localhost:5000/w5ibb"
],
"keywords": [],
"license": [
{
"@type": "CreativeWork",
"name": [
"No license"
],
"url": []
}
],
"name": "this is a project title!",
"publisher": {
"@type": "Organization",
"name": "Center For Open Science"
},
"url": "http://localhost:5000/w5ibb"
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
dcterms:created "2123-05-04" ;
dcterms:creator <http://localhost:5000/w1ibb> ;
dcterms:dateCopyrighted "2252" ;
dcterms:description "this is a project description!" ;
dcterms:description "this is a project description! it describes the project and is more than fifty characters long" ;
dcterms:identifier "http://localhost:5000/w5ibb" ;
dcterms:isVersionOf <http://localhost:5000/w2ibb> ;
dcterms:modified "2123-05-04" ;
Expand Down Expand Up @@ -77,6 +77,8 @@
<http://localhost:5000/w1ibb> a dcterms:Agent,
foaf:Person ;
dcterms:identifier "http://localhost:5000/w1ibb" ;
foaf:givenName "Person" ;
foaf:familyName "McNamington" ;
foaf:name "Person McNamington" .

<http://localhost:5000> a dcterms:Agent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
],
"descriptions": [
{
"description": "this is a project description!",
"description": "this is a project description! it describes the project and is more than fifty characters long",
"descriptionType": "Abstract"
}
],
Expand Down
Loading
Loading