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',
'name': occupationName,
'location': {
'occupationLocation': {
'@type': 'VirtualLocation',
'url': personDomain
},
@ -633,9 +633,12 @@ def personUpgradeActor(baseDir: str, personJson: {},
ocItem = personJson['hasOccupation'][index]
if ocItem.get('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]
ocItem['location'] = {
ocItem['occupationLocation'] = {
"@type": "VirtualLocation",
"url": personDomain
}

View File

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