occupation location

merge-requests/30/head
Bob Mottram 2021-05-17 11:04:26 +01:00
parent d71c2b5d21
commit 8e679aa08a
2 changed files with 9 additions and 6 deletions

View File

@ -619,7 +619,7 @@ def personUpgradeActor(baseDir: str, personJson: {},
{ {
'@type': 'Occupation', '@type': 'Occupation',
'name': occupationName, 'name': occupationName,
'location': { 'occupationLocation': {
'@type': 'VirtualLocation', '@type': 'VirtualLocation',
'url': personDomain 'url': personDomain
}, },
@ -633,9 +633,12 @@ def personUpgradeActor(baseDir: str, personJson: {},
ocItem = personJson['hasOccupation'][index] ocItem = personJson['hasOccupation'][index]
if ocItem.get('hasOccupation'): if ocItem.get('hasOccupation'):
ocItem = ocItem['hasOccupation'] ocItem = ocItem['hasOccupation']
if not ocItem.get('location'): if ocItem.get('location'):
del ocItem['location']
updateActor = True
if not ocItem.get('occupationLocation'):
personDomain = personJson['id'].split('/users/')[0] personDomain = personJson['id'].split('/users/')[0]
ocItem['location'] = { ocItem['occupationLocation'] = {
"@type": "VirtualLocation", "@type": "VirtualLocation",
"url": personDomain "url": personDomain
} }

View File

@ -146,9 +146,9 @@ def _setActorRole(actorJson: {}, roleName: str) -> bool:
"hasOccupation": { "hasOccupation": {
"@type": "Occupation", "@type": "Occupation",
"name": roleName, "name": roleName,
'location': { "occupationLocation": {
'@type': 'VirtualLocation', "@type": "VirtualLocation",
'url': actorDomain "url": actorDomain
}, },
"occupationalCategory": { "occupationalCategory": {
"@type": "CategoryCode", "@type": "CategoryCode",