src/main/java/SDOImport.java
public static Map<String, Set<String>> loadbuildMLocations(String resource, String endpoint, String master_graph) {
        Map<String, Set<String>> data = new HashMap<String, Set<String>>();
        try {
            String querystr = "";
            if (!resource.isEmpty()) {
                querystr = "SELECT ?resource ?location WHERE { GRAPH <" + master_graph + "> {?resource <http://data.duraark.eu/vocab/buildm/addressLocality> ?location. FILTER (regex(?resource, \"" + resource + "\", \"i\"))}}";
            } else {
                querystr = "SELECT ?resource ?location WHERE { GRAPH <" + master_graph + "> {?resource <http://data.duraark.eu/vocab/buildm/addressLocality> ?location}}";
            }
            QueryEngineHTTP query = new QueryEngineHTTP(endpoint, querystr);

            ResultSet rst = query.execSelect();
            while (rst.hasNext()) {
                QuerySolution qs = rst.next();
                RDFNode resource_node = qs.get("?resource");
                RDFNode location_node = qs.get("?location");

                String resource_uri = "<" + resource_node.asResource().getURI() + ">";
                String location = location_node.isResource() ? "<" + location_node.asResource().getURI() + ">" : "\"" + location_node.asLiteral().getString() + "\"";

                if (location.contains("/")) {
                    location = location.substring(location.lastIndexOf("/") + 1).trim();
                }

                if (!data.containsKey(resource_uri)) {
                    data.put(resource_uri, new HashSet<String>());
                }
                data.get(resource_uri).add(location);
            }
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }

        return data;
    }
/**
     * Loads the set of buildM instances that match the resource URI (in case this is given). As a result we get the
     * resources, and their address locality, such that we can match them to the existing crawls.
     *
     * @param resource
     * @param endpoint
     * @return
     */
Loads the set of buildM instances that match the resource URI (in case this is given). As a result we get the
resources, and their address locality, such that we can match them to the existing crawls.

@param resource
@param endpoint
@return
Loads the set of buildM instances that match the resource URI ( in case this is given ) . As a result we get the resources and their address locality such that we can match them to the existing crawls . @param resource @param endpoint @return
public static Map<String, Set<String>> loadbuildMLocations(String resource, String endpoint, String master_graph) {
        Map<String, Set<String>> data = new HashMap<String, Set<String>>();
        try {
            String querystr = "";
            if (!resource.isEmpty()) {
                querystr = "SELECT ?resource ?location WHERE { GRAPH <" + master_graph + "> {?resource <http://data.duraark.eu/vocab/buildm/addressLocality> ?location. FILTER (regex(?resource, \"" + resource + "\", \"i\"))}}";
            } else {
                querystr = "SELECT ?resource ?location WHERE { GRAPH <" + master_graph + "> {?resource <http://data.duraark.eu/vocab/buildm/addressLocality> ?location}}";
            }
            QueryEngineHTTP query = new QueryEngineHTTP(endpoint, querystr);
            ResultSet rst = query.execSelect();
            while (rst.hasNext()) {
                QuerySolution qs = rst.next();
                RDFNode resource_node = qs.get("?resource");
                RDFNode location_node = qs.get("?location");
                String resource_uri = "<" + resource_node.asResource().getURI() + ">";
                String location = location_node.isResource() ? "<" + location_node.asResource().getURI() + ">" : "\"" + location_node.asLiteral().getString() + "\"";
                if (location.contains("/")) {
                    location = location.substring(location.lastIndexOf("/") + 1).trim();
                }
                if (!data.containsKey(resource_uri)) {
                    data.put(resource_uri, new HashSet<String>());
                }
                data.get(resource_uri).add(location);
            }
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
        return data;
    }
public static Map < String , Set < String > > loadbuildMLocations ( String resource , String endpoint , String master_graph ) { Map < String , Set < String > > data = new HashMap < String , Set < String > > ( ) ; try { String querystr = "" ; if ( ! resource . isEmpty ( ) ) { querystr = "SELECT ?resource ?location WHERE { GRAPH <" + master_graph + "> {?resource <http://data.duraark.eu/vocab/buildm/addressLocality> ?location. FILTER (regex(?resource, \"" + resource + "\", \"i\"))}}" ; } else { querystr = "SELECT ?resource ?location WHERE { GRAPH <" + master_graph + "> {?resource <http://data.duraark.eu/vocab/buildm/addressLocality> ?location}}" ; } QueryEngineHTTP query = new QueryEngineHTTP ( endpoint , querystr ) ; ResultSet rst = query . execSelect ( ) ; while ( rst . hasNext ( ) ) { QuerySolution qs = rst . next ( ) ; RDFNode resource_node = qs . get ( "?resource" ) ; RDFNode location_node = qs . get ( "?location" ) ; String resource_uri = "<" + resource_node . asResource ( ) . getURI ( ) + ">" ; String location = location_node . isResource ( ) ? "<" + location_node . asResource ( ) . getURI ( ) + ">" : "\"" + location_node . asLiteral ( ) . getString ( ) + "\"" ; if ( location . contains ( "/" ) ) { location = location . substring ( location . lastIndexOf ( "/" ) + 1 ) . trim ( ) ; } if ( ! data . containsKey ( resource_uri ) ) { data . put ( resource_uri , new HashSet < String > ( ) ) ; } data . get ( resource_uri ) . add ( location ) ; } } catch ( Exception e ) { System . out . println ( e . getMessage ( ) ) ; } return data ; }
Loads the set of buildM instances that match the resource URI (in case this is given).
Loads the set of buildM instances that match the resource URI ( in case this is given ) .