EHRI / ehri-rest

Web service and business logic for managing EHRI collection metadata.
European Union Public License 1.2
3 stars 7 forks source link

Circular relationship created by CVOC importer... #115

Closed mikesname closed 9 years ago

mikesname commented 9 years ago

The CVOC importer has seemingly created a circular relationship between:

https://portal.ehri-project.eu/admin/keywords/ehri-skos-tema-557

and

https://portal.ehri-project.eu/admin/keywords/ehri-skos-tema-1106

(Each term has the other as both a broader and narrower term.)

The source data looks okay. I'm presuming this isn't the only one thus affected. Also possible: the direction of the broader/narrower relationship was reversed in previous versions and an update added this relationship without removing the other.

This should be fixable in the prod DB via Cypher.

mikesname commented 9 years ago

This is related to #114 .

mikesname commented 9 years ago

According to the following Cypher, these are the only circular-related items:

START n1 = node:entities("__ISA__:cvocConcept")
MATCH n1<-[r1:narrower]-b,
      b<-[r2:narrower]-n2
WHERE ID(n1) = ID(n2)
RETURN n1.__ID__
{
  "columns": [
    "n1.__ID__"
  ],
  "data": [
    [
      "ehri-skos-tema-1106"
    ],
    [
      "ehri-skos-tema-557"
    ]
  ]
}
mikesname commented 9 years ago

Cycled fixed on production.