Project

General

Profile

« Previous | Next » 

Revision 51706

Trying to map to ckan licenses

View differences:

ResourceReader.java
8 8
import com.google.common.collect.Lists;
9 9
import eu.dnetlib.parthenos.CRM;
10 10
import eu.dnetlib.parthenos.CRMpe;
11
import eu.dnetlib.parthenos.catalogue.CatalogueLicense;
11 12
import org.apache.commons.logging.Log;
12 13
import org.apache.commons.logging.LogFactory;
13 14
import org.apache.jena.assembler.AssemblerHelp;
......
90 91
		return "";
91 92
	}
92 93

  
94
	public CatalogueLicense getCatalogueLicense(final Resource resource){
95
		if(resource.hasProperty(CRM.P16_used_specific_object)) {
96
			Resource obj = resource.getPropertyResourceValue(CRM.P16_used_specific_object);
97
			if (obj.hasProperty(CRM.P2_has_type)) {
98
				String license = getLabel(obj.getPropertyResourceValue(CRM.P2_has_type));
99
				return CatalogueLicense.getCatalogueLicenseFor(license);
100
			}
101
		}
102
		return CatalogueLicense.NotSpecified;
103
	}
104

  
93 105
	public Iterator<String> getRDFClassNames(final Resource resource){
94 106
		StmtIterator it = resource.listProperties(RDF.type);
95 107
		return Iterators.transform(it, f -> f.getResource().getLocalName());

Also available in: Unified diff