Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicated groups in group hierarchy (when data contains both skos:member _and_ isothes:subGroup) #385

Closed
tfrancart opened this issue Dec 11, 2015 · 4 comments

Comments

@tfrancart
Copy link
Contributor

Hello

I have duplicated groups in the group hierarchy :

duplicated-groups

The data I am working on uses both skos:member and isothes:subGroup to create the group hierarchy, this may be the cause of the problem.
Similarly, groups are declared with both a skos:Collection type, an isothes:ConceptGroup type, and possibly a third class - subclass of isothes:ConceptGroup :

both-skos_member_and_isothes_subgroup

A DISTINCT is probably needed in the query that retrieves subgroups.

I am using v1.3-maintenance branch.

@tfrancart
Copy link
Contributor Author

Problem lies in listConceptGroups methods, the ?children variable contains duplicated children because it relies on both skos:member and isothes:subGroup :

SELECT ?group (GROUP_CONCAT(STR(?child)) as ?children) ?label ?members ?notation
WHERE {
 $gc {
   ?group a <$groupClass> .
   OPTIONAL { ?group skos:member|isothes:subGroup ?child .
              ?child a <$groupClass> }
   BIND(EXISTS{?group skos:member ?submembers} as ?members)
   OPTIONAL { ?group skos:prefLabel ?label }
   OPTIONAL { ?group rdfs:label ?label }
   FILTER (langMatches(lang(?label), '$lang'))
   OPTIONAL { ?group skos:notation ?notation }
 }
}
GROUP BY ?group ?label ?members ?notation
ORDER BY lcase(?label)

Could the property to be used be externalised in the vocabularies config file, just like the group class is ?

@osma osma added the bug label Dec 11, 2015
@osma
Copy link
Member

osma commented Dec 11, 2015

Does it help if you change the expression to (GROUP_CONCAT(DISTINCT STR(?child)) as ?children) ?

@tfrancart
Copy link
Contributor Author

Indeed, this fixes the problem. Do you think this modification can be included in 1.3-maintenance as well as 1.4 ?

Thanks a lot

@osma
Copy link
Member

osma commented Dec 11, 2015

Fixed on both master and v1.3-maintenance.

1.4 will be released soon though, then we will stop maintaining v1.3-maintenance.

@osma osma added this to the 1.4 milestone Dec 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants