| 4 | import java.util.Calendar; |
| 5 | import java.util.Date; |
| 6 | import java.util.HashSet; |
| 7 | |
| 8 | import jp.riken.accc.db.rdf.crawler.dataStructure.sparql.URICollection; |
| 9 | |
| 10 | import org.apache.jena.riot.RDFDataMgr; |
| 11 | |
| 12 | import com.hp.hpl.jena.rdf.model.Literal; |
| 13 | import com.hp.hpl.jena.rdf.model.Model; |
| 14 | import com.hp.hpl.jena.rdf.model.NodeIterator; |
| 15 | import com.hp.hpl.jena.rdf.model.Property; |
| 16 | import com.hp.hpl.jena.rdf.model.RDFNode; |
| 17 | import com.hp.hpl.jena.rdf.model.Resource; |
| 55 | Property sd_default_dataset = model.getProperty(URICollection.PROPERTY_SD_DEFAULT_DATA_SET); |
| 56 | nit = model.listObjectsOfProperty(sd_default_dataset); |
| 57 | Resource defaultDataSet = null; |
| 58 | if( nit.hasNext() ){ |
| 59 | RDFNode node = nit.next(); |
| 60 | defaultDataSet = node.asResource(); |
| 61 | } |
| 62 | // log |
| 63 | Property sbm_crawlLog = model.getProperty(URICollection.PROPERTY_SB_CRAWL_LOG); |
| 64 | nit = model.listObjectsOfProperty(sbm_crawlLog); |
| 65 | Resource crawlLogBlankNode = null; |
| 66 | if( nit.hasNext() ){ |
| 67 | RDFNode node = nit.next(); |
| 68 | crawlLogBlankNode = node.asResource(); |
| 69 | } |
| 70 | // start |
| 71 | Property sbm_startTime = model.getProperty(URICollection.PROPERTY_SB_CRAWL_START_TIME); |
| 72 | nit = model.listObjectsOfProperty(sbm_startTime); |
| 73 | startDateTime = null; |
| 74 | if( nit.hasNext() ){ |
| 75 | Literal startTimeLit = null; |
| 76 | RDFNode node = nit.next(); |
| 77 | startTimeLit = node.asLiteral(); |
| 78 | startDateTime = ((com.hp.hpl.jena.datatypes.xsd.XSDDateTime)(startTimeLit.getValue())).asCalendar(); |
| 79 | } |
| 80 | // end |
| 81 | Property sbm_endTime = model.getProperty(URICollection.PROPERTY_SB_CRAWL_END_TIME); |
| 82 | nit = model.listObjectsOfProperty(sbm_endTime); |
| 83 | endDateTime = null; |
| 84 | if( nit.hasNext() ){ |
| 85 | Literal endTimeLit = null; |
| 86 | RDFNode node = nit.next(); |
| 87 | endTimeLit = node.asLiteral(); |
| 88 | endDateTime = ((com.hp.hpl.jena.datatypes.xsd.XSDDateTime)(endTimeLit.getValue())).asCalendar(); |
| 89 | } |
| 90 | |