Project

General

Profile

« Previous | Next » 

Revision 8839

Add PROV relationships to the Solr schema. Populate the fields using the RdfXmlSubprocessor

View differences:

RdfXmlSubprocessor.java
20 20
import java.io.IOException;
21 21
import java.io.InputStream;
22 22
import java.net.MalformedURLException;
23
import java.net.URI;
24
import java.net.URISyntaxException;
23 25
import java.util.ArrayList;
24 26
import java.util.Arrays;
25 27
import java.util.Date;
......
129 131
    	// read the annotation
130 132
		InputStream source = toInputStream(rdfXmlDocument);
131 133
    	String name = indexDocument.getIdentifier();
134
    	
135
    	//Check if the identifier is a valid URI and if not, make it one by prepending "http://"
136
    	URI nameURI = new URI(name);
137
    	String scheme = nameURI.getScheme();
138
    	if((scheme == null) || (scheme.isEmpty())){
139
    		name = "http://" + name;
140
    	}
141
    	
132 142
    	boolean loaded = dataset.containsNamedModel(name);
133 143
		if (!loaded) {
134 144
			OntModel ontModel = ModelFactory.createOntologyModel();

Also available in: Unified diff