1 /*******************************************************************************
2 * Copyright (c) 2019 Association for Decentralized Information Management
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Semantum Oy - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.db.common.request;
14 import java.util.Collections;
17 import org.simantics.db.ReadGraph;
18 import org.simantics.db.Resource;
19 import org.simantics.db.exception.DatabaseException;
21 import gnu.trove.set.hash.THashSet;
24 * @author Tuukka Lehtonen
25 * @since 1.41.0, 1.35.2
27 public class ResourceSetURIs extends UnaryRead<Set<Resource>, Set<String>> {
29 public ResourceSetURIs(Set<Resource> set) {
34 public Set<String> perform(ReadGraph graph) throws DatabaseException {
35 if (parameter == null || parameter.isEmpty())
36 return Collections.emptySet();
38 Set<String> result = new THashSet<String>(parameter.size());
39 for (Resource r : parameter) {
40 String uri = graph.getPossibleURI(r);