Bug #3278
DataPackage.serializePackage() method doesn't work very well.
100%
Description
Here is the what i did:
DataPackage dataPackage = new DataPackage(packageId);
dataPackage.insertRelationship(metadataId, dataIds);
String resourceMap = dataPackage.serializePackage();
System.out.println("the resource map is"+resourceMap);
My science meadata id is:doi:10.5063/AA/tao.1.1
data id is: doi:10.5063/AA/tao.1.1
But in the output of string, i can't find the relationship between the metadata id and the data id:
the resource map is
2012-09-27T11:43:38.165-07:00/dcterms:modified
resource-map:eea3f44d-bd9c-4c50-88ed-dd51407b0d40/dcterms:identifier
/rdf:Description
Java libclient/foaf:name
/rdf:Description
dc:titleDataONE Aggregation/dc:title
/rdf:Description
/rdf:RDF
History
#1 Updated by Jing Tao over 12 years ago
Here is a correct copy of the resource map:
ore:isAggregatedByhttps://cn.dataone.org/cn/v1/resolve/resourceMap_tao.1.1#aggregation/ore:isAggregatedBy
doi:10.5063/AA/tao.2.1/dcterms:identifier
/rdf:Description
Java libclient/foaf:name
/rdf:Description
ore:isAggregatedByhttps://cn.dataone.org/cn/v1/resolve/resourceMap_tao.1.1#aggregation/ore:isAggregatedBy
doi:10.5063/AA/tao.1.1/dcterms:identifier
/rdf:Description
dc:titleDataONE Aggregation/dc:title
/rdf:Description
2012-06-22T20:55:41-0700/dcterms:modified
resourceMap_tao.1.1/dcterms:identifier
/rdf:Description
/rdf:RDF
#2 Updated by Ben Leinfelder over 12 years ago
I think you need to have called DataPacakge.add(D1Object) before you serialize the ORE.
Your data and metadata ids are the same?
Your second RDF file looks good -- how did you end up with that?
#3 Updated by Jing Tao over 12 years ago
Good catch. Yeah, i made a mistake to put the same id for both metadata and data. I corrected it and the result didn't change.
The second RDF was got from the KNB metacat. It is a example and i didn't make it.
I don't think it is necessary to call DataPacakge.add(D1Object) before you serialize the ORE. I went over the code a little bit. The serializePackage method uses the class field metadataMap, but the add method mainly involves the class field objectStore. I have a feeling that insertRelationship(metadataId, dataIds) has a bug. This method modifies the field metadataMap.
#4 Updated by Rob Nahf over 12 years ago
- Target version set to Sprint-2012.39-Block.5.4
- Tracker changed from Task to Bug
- Status changed from New to Closed
found a bug in the insertRelationship method, where the new relationship wasn't added for new metadataIds.
#5 Updated by Rob Nahf over 12 years ago
- % Done changed from 0 to 100