archesproject / arches

Arches is a web platform for creating, managing, & visualizing geospatial data. Arches was inspired by the needs of the Cultural Heritage community, particularly the widespread need of organizations to build & manage cultural heritage inventories
GNU Affero General Public License v3.0
212 stars 143 forks source link

Concepts fail to match on import #4420

Closed azaroth42 closed 5 years ago

azaroth42 commented 5 years ago

Cut and pasting the output of a resource with a completely unambiguous model (e.g. only one P2_has_type reference to an E55_Type) the concept matching algorithm does not find any matching node.

The JSON being supplied:

{"@context": "https://linked.art/ns/v1/linked-art.json",  
  "classified_as": [
    {
        "id": "http://localhost:8000/concepts/86be632e-0dad-4d88-b5da-3d65875d6239",
        "type": "Type",
        "label": "Painting"
    }
  ],
  "note": "String 2", 
  "number_of_parts": 10, 
  "type": "ManMadeObject"}

Results in the output:

finding value
{u'http://www.w3.org/2000/01/rdf-schema#label': [{'@value': u'Painting'}], '@id': u'http://localhost:8000/concepts/86be632e-0dad-4d88-b5da-3d65875d6239', '@type': [u'http://www.cidoc-crm.org/cidoc-crm/E55_Type']}
Trying to get a label from the concept node.
FAILED TO FIND MATCHING LABEL 'Painting'@None FOR CONCEPT '86be632e-0dad-4d88-b5da-3d65875d6239' in ES
Attempting a match from label via the DB:
('value found! : ', '43d75450-7282-4754-af63-02e13032b73a')
finding value
{'@value': u'String 2'}
('value found! : ', u'String 2')
finding value
{'@value': 10}
('value found! : ', 10)

And the error condition:

['A node in the supplied data does not match any node in the target graph. ']

Tagging @benosteen and @robgaston

apeters commented 5 years ago

I believe that this should be handled by the to_rdf/from_rdf methods in the datatype class that @benosteen developed

azaroth42 commented 5 years ago

Fixed in branch, closing.