from au.edu.usq.fascinator.common.nie import InformationElement rdfPayload = object.getPayload("aperture.rdf") rdfModel = pyUtils.getRdfModel(rdfPayload) #Seems like aperture only encode the spaces. Tested against special characters file name #and it's working safeOid = oid.replace(" ", "%20") #under windows we need to add a slash if not safeOid.startswith("/"): safeOid = "/" + safeOid rdfId = "file:%s" % safeOid #Set write to False so it won't write to the model paginationTextDocument = PaginatedTextDocument(rdfModel, rdfId, False) informationElement = InformationElement(rdfModel, rdfId, False) id3Audio = ID3Audio(rdfModel, rdfId, False) #1. get title only if no title returned by ICE if titleList == []: allTitles = informationElement.getAllTitle(); while (allTitles.hasNext()): title = allTitles.next().strip() if title != "": titleList.append(title) allTitles = id3Audio.getAllTitle() while (allTitles.hasNext()): title = allTitles.next().strip() if title != "": titleList.append(title)
descriptionList = [] creatorList = [] creationDate = [] contributorList = [] formatList = [] fulltext = [] subjectList = [] relationDict = {} rdfPayload = object.getMetadata(); if rdfPayload is not None: rdfModel = indexer.getRdfModel(rdfPayload) #Set write to False so it won't write to the model informationElement = InformationElement(rdfModel, object.getId().replace("/content",""), False) #1. get title allTitles = informationElement.getAllTitle(); while (allTitles.hasNext()): title = allTitles.next() titleList.append(title) print "**********************" ,title print(rdfModel); #2. get creator #allCreators = informationElement.getAllCreator(); #while (allCreators.hasNext()): # thing = allCreators.next() # contacts = Contact(rdfModel, thing.getResource(), False)