Project

General

Profile

« Previous | Next » 

Revision 8718

attribute the datapackage to the creator (using orcid if we can find it). https://projects.ecoinformatics.org/ecoinfo/issues/6267
https://projects.ecoinformatics.org/ecoinfo/issues/6423

View differences:

src/edu/ucsb/nceas/metacat/annotation/DatapackageSummarizer.java
107 107
		ObjectProperty annotatedByProperty = m.getObjectProperty(oa + "annotatedBy");
108 108
		Property identifierProperty = m.getProperty(dcterms + "identifier");
109 109
		Property conformsToProperty = m.getProperty(dcterms + "conformsTo");
110
		Property wasAttributedTo = m.getProperty(prov + "wasAttributedTo");
110 111
		Property nameProperty = m.getProperty(foaf + "name");
111 112
		Property rdfValue = m.getProperty(rdf + "value");
112 113
		
......
123 124
		Resource fragmentSelectorClass =  m.getOntClass(oa + "FragmentSelector");
124 125
		Resource entityClass =  m.getResource(prov + "Entity");
125 126
		Resource personClass =  m.getResource(prov + "Person");
126
		
127
				
127 128
		// these apply to every attribute annotation
128 129
		Individual meta1 = m.createIndividual(ont.getURI() + "#meta", entityClass);
129 130
		meta1.addProperty(identifierProperty, metadataPid.getValue());
130 131

  
131
		// who should we attribute the annotation to?
132
		Individual p1 = m.createIndividual(ont.getURI() + "#person", personClass);
132
		// decide who should be credited with the package
133
		Individual p1 = null;
133 134
		
134
		// add an orcid annotation if we can find one from their system
135
		// look up creators from the EML metadata
135 136
		List<String> creators = dataPackage.getCreators();
136 137
		//creators = Arrays.asList("Matthew Jones");
137
		if (creators != null && creators.size() > 0) {
138
		if (creators != null && creators.size() > 0) {	
139
			// use an orcid if we can find one from their system
140
			String orcidUri = OrcidService.lookupOrcid(null, null, creators.toArray(new String[0]));
141
			if (orcidUri != null) {
142
				p1 = m.createIndividual(orcidUri, personClass);
143
				p1.addProperty(identifierProperty, orcidUri);
144
			} else {
145
				p1 = m.createIndividual(ont.getURI() + "#person", personClass);
146
			}
147
			// include the name we have in the metadata
138 148
			p1.addProperty(nameProperty, creators.get(0));
139
			String orcidId = OrcidService.lookupOrcid(null, null, creators.toArray(new String[0]));
140
			if (orcidId != null) {
141
				p1.addProperty(identifierProperty, orcidId);
142
			}
143 149
		}
144 150
		
151
		// attribute the package to this creator if we have one
152
		if (p1 != null) {
153
			meta1.addProperty(wasAttributedTo, p1);
154
		}
155
		
145 156
		// loop through the tables and attributes
146 157
		int entityCount = 1;
147 158
		Entity[] entities = dataPackage.getEntityList();
......
193 204
					a1.addProperty(hasTargetProperty, t1);
194 205
					t1.addProperty(hasSourceProperty, meta1);
195 206
					t1.addProperty(hasSelectorProperty, s1);
196
					a1.addProperty(annotatedByProperty, p1);
207
					//a1.addProperty(annotatedByProperty, p1);
197 208
					
198 209
					// describe the measurement in terms of restrictions
199 210
					if (standard != null) {

Also available in: Unified diff