[dspace-tech] Determining File Format in the RESTapi

2019-04-18 Thread Jose Blanco
I'm wondering if someone could point me to the code that does this

URLConnection.guessContentTypeFromName(name)

In this line of code

https://github.com/DSpace/DSpace/blob/master/dspace-rest/src/main/java/org/dspace/rest/BitstreamResource.java#L716

I want to know the login behind this.

Thank you!
-Jose

-- 
All messages to this mailing list should adhere to the DuraSpace Code of 
Conduct: https://duraspace.org/about/policies/code-of-conduct/
--- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.


Re: [dspace-tech] swordv2 file format

2019-04-18 Thread alaw
VTechWorks has Elements with Repository Tools 2, which uses Swordv2. We 
have not used the Swordv2 deposit tool that you describe. A typical 
Elements deposit, http://hdl.handle.net/10919/88983, yields a PDF with 
Format="Adobe PDF" in the Original bundle and an XML file with 
Format="Unknown" in the SWORD bundle.

When I deposit a test SWORD zip package from the command line, I use the 
first command that you list, -H "Content-Type: *application/zip*".

-Anne

On Wednesday, April 17, 2019 at 2:32:09 PM UTC-4, Jose Blanco wrote:
>
> Tim,
>
> I am using a tool developed by Symplectic Elements that sends Swordv2 
> packages to our dev site for deposit.  They have a UI interface where you 
> deposit items, much like the one in dspace.  Once the item is deposited, 
> you can send it over to our dev instance via swordv2. The item I created at 
> their site has a little metadata and a docx file.  When the item lands at 
> our site everything looks good, but the file format is Unknown.  Now, I 
> don't know how they bundle things up for sword and send it off, and the 
> dspace log file presently does not tell me much.  I can see in the log file 
> that it thinks the format is Unknown, but not sure why.  We do have docx in 
> the fileextensions table, and if I deposit that same docx file using dspace 
> UI interface, the format is Microsoft Word as expected.  
>
> Now, I do know that if I send this command to our site:
>
> curl -i --data-binary "*@/tmp/example.zip*" -H "Content-Disposition: 
> filename=*jose.zip*" -H "Content-Type: *application/zip*" -H 
> "X-Packaging: http://purl.org/net/sword-types/METSDSpaceSIP;-H 
> "X-No-Op: false" -H "X-Verbose: true" 
> https://dev.deepblue.lib.umich.edu/swordv2/collection/TEMP-BOGUS/324071 
> -u some...@umich.edu 
>
> it will deposit a file by the name of jose.zip and the format will be zip 
> file
>
> But if I change the command to:
>
> curl -i --data-binary "@*/tmp/example.zip*" -H "Content-Disposition: 
> filename=*jose.zip*" -H "Content-Type: *application/pdf*" -H 
> "X-Packaging: http://purl.org/net/sword-types/METSDSpaceSIP;-H 
> "X-No-Op: false" -H "X-Verbose: true" 
> https://dev.deepblue.lib.umich.edu/swordv2/collection/TEMP-BOGUS/324071 
> -u some...@umich.edu 
>
> It will deposit a file by the name of jose.zip and format will be PDF 
> file, even though the file is actually a zip file, and when you try to open 
> it you encounter and error. The -H tells it the Format ( mimetype ).
>
> I don't know how they are sending me the package, but I have asked them.
>
> Thank you!
> -Jose
>
>
> On Wed, Apr 17, 2019 at 12:05 PM Tim Donohue  > wrote:
>
>> Hi Jose,
>>
>> I think we'd need more information on where you are encountering this 
>> error.  From my understanding with SWORDv2, the expectation is that the 
>> *package* you deposit is a ZIP file that contains both a metadata file and 
>> one or more binaries.  An example is at:  
>> https://github.com/DSpace/DSpace/blob/master/dspace-sword/example/example.zip
>>   
>> (This same example is for SWORDv1 and v2).
>>
>> Once SWORDv2 validates the Zip, it should extract the binaries and 
>> *validate them against your bitstream registry*.  So, as Mark noted, if you 
>> have a "docx" file in your bitstreamformat registry, then SWORDv2 should 
>> see that in the same way that any other input mechanism does.
>>
>> If you are depositing a Word doc directly, it looks like SWORDv2 tries to 
>> use the "BinaryContentIngester" class, which also looks to be using the 
>> bitstreamformat registry.   
>> https://github.com/DSpace/DSpace/blob/master/dspace-swordv2/src/main/java/org/dspace/sword2/BinaryContentIngester.java
>>
>> It's currently unclear to me how you are trying to deposit to SWORDv2.  
>> Are you depositing a Zip?  Are you trying to deposit a Word document 
>> directly?  Where is the error message appearing and what is the exact error?
>>
>> If you provide a bit more info, perhaps we could narrow down what is 
>> going on.
>>
>> Tim
>>
>> On Wed, Apr 17, 2019 at 9:59 AM Jose Blanco > > wrote:
>>
>>> This is what it seems like to me too.  Thank you for your input.
>>>
>>> On Wed, Apr 17, 2019 at 10:40 AM Mark H. Wood >> > wrote:
>>> >
>>> > On Wed, Apr 17, 2019 at 09:43:51AM -0400, Jose Blanco wrote:
>>> > > Mark, Are you sure this is the way it works for swordv2?  I know this
>>> > > is the way it works when uploading files via the UI, but I don't 
>>> think
>>> > > this is the way sword does it.  At least I'm not seeing this.  I do
>>> > > have docx inthe fileextension table.
>>> >
>>> > We don't use SWORDv2 here, so I don't know a lot about it, but from
>>> > reading some of the code and the specification, it seems that the
>>> > packaging declares the type of a bitstream?  So is the client telling
>>> > the server that this file is an unknown type?
>>> >
>>> > I think you need a SWORD expert here, and I am not one of those.
>>> >
>>> > > On Wed, Apr 17, 2019 at 9:22 AM Mark H. Wood >> > wrote:
>>> > > >
>>> 

Re: [dspace-tech] How to implement Linked Data in Dspace

2019-04-18 Thread Terry Brady
Jhon,

I have not worked with the RDF service outside of Docker.

Here are a few things to try.

   - Have you confirmed that the "dspace" dataset exists in Fuseki?
   - If you run "rdfizer -c -v", do you see any data added to that
   dataset?  If not, what errors appear?
   - Do you see any errors trying to access the RDF service?

I will ask on Slack if anyone else can add to this thread.

Terry

On Tue, Apr 16, 2019 at 12:04 PM  wrote:

> Hi Terry
>
> Thanks for your email.
>
> I have set up Dspace and fuseki (they work independently), I am using
> Windows, and I need to connect them. I have followed the indications of
> this page
> https://wiki.duraspace.org/display/DSDOC6x/Linked+%28Open%29+Data, but
> the connection does not work
>
> Do you know where I can find a step by step manual in order to do this?
>
> thanks
>
>
>
> El miércoles, 10 de abril de 2019, 10:20:53 (UTC-5), Terry Brady escribió:
>>
>> See
>> https://github.com/DSpace-Labs/DSpace-Docker-Images/blob/master/docker-compose-files/dspace-compose/ComposeFiles.md#add-the-rdf-service-dspace6-and-dspace7
>> for testing the service in Docker.
>>
>> On Wed, Apr 10, 2019 at 12:28 AM  wrote:
>>
>>> I am working in a Linked Data project. I am to connect Dspace and
>>> Fuseki, and export data en ttl file in order to query this data from Fuseki
>>>
>>> Do you know how I can to connect Dspace and Fuseki?
>>>
>>> Thanks
>>>
>>> --
>>> All messages to this mailing list should adhere to the DuraSpace Code of
>>> Conduct: https://duraspace.org/about/policies/code-of-conduct/
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "DSpace Technical Support" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to dspac...@googlegroups.com.
>>> To post to this group, send email to dspac...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/dspace-tech.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>> --
>> Terry Brady
>> Applications Programmer Analyst
>> Georgetown University Library Information Technology
>> https://github.com/terrywbrady/info
>> 425-298-5498 (Seattle, WA)
>>
> --
> All messages to this mailing list should adhere to the DuraSpace Code of
> Conduct: https://duraspace.org/about/policies/code-of-conduct/
> ---
> You received this message because you are subscribed to the Google Groups
> "DSpace Technical Support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dspace-tech+unsubscr...@googlegroups.com.
> To post to this group, send email to dspace-tech@googlegroups.com.
> Visit this group at https://groups.google.com/group/dspace-tech.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Terry Brady
Applications Programmer Analyst
Georgetown University Library Information Technology
https://github.com/terrywbrady/info
425-298-5498 (Seattle, WA)

-- 
All messages to this mailing list should adhere to the DuraSpace Code of 
Conduct: https://duraspace.org/about/policies/code-of-conduct/
--- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.


Re: [dspace-tech] email not working

2019-04-18 Thread Ze Victor Harry
well i have zipped the file using WinRAR archiver and  uploaded it  using
admin UI and it shows a success message but the file is not visible in the
collection where i uploaded to though it is available in this directory
C:\dspace\imports\batchuploads\815db41a-13ae-4d41-9ae7-50f9eff7c949 .i
think it is because i haven't the metadata using simple archive format that
is because i am unable to understand how to use simple archive format in
windows even if i read this article
https://wiki.duraspace.org/display/DSDOC6x/Importing+and+Exporting+Items+via+Simple+Archive+Format.
can you tell me in clear  steps how to use SAF in windows

On Wed, Apr 17, 2019 at 4:45 PM Mark H. Wood  wrote:

> On Wed, Apr 17, 2019 at 02:32:24PM +0300, Ze Victor Harry wrote:
> > thanx Mark for the respond. my setting was wright it was Gmail the
> problem.
> > gmail was asking to "turn less secure app on" and it worked after turning
> > it on though i don't think it is a good idea for security.
>
> I agree that that is not good for security.  I've left a comment on
> Google's rather inadequate explanation, asking for a link to the
> specification of what they expect from us, so that we can perhaps
> improve DSpace to avoid this problem in the future.
>
> > may i ask you how
> > to batch import in windows? i posted the question but no one seems to
> > reply,i have read all the dspace documentation but how to install SAF and
> > how to use it part is not clear i am stack with this for days
>
> I don't use DSpace on Windows, but if you would tell us exactly how it
> is failing, perhaps someone here can help.
>
> Of course instead of "./safbuilder.sh" a Windows user would use
> ".\safbuilder.bat", and instead of 'sudo' one would need to be logged
> in as the DSpace account to use 'bin/dspace.bat import'.
>
> --
> Mark H. Wood
> Lead Technology Analyst
>
> University Library
> Indiana University - Purdue University Indianapolis
> 755 W. Michigan Street
> Indianapolis, IN 46202
> 317-274-0749
> www.ulib.iupui.edu
>
> --
> All messages to this mailing list should adhere to the DuraSpace Code of
> Conduct: https://duraspace.org/about/policies/code-of-conduct/
> ---
> You received this message because you are subscribed to the Google Groups
> "DSpace Technical Support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dspace-tech+unsubscr...@googlegroups.com.
> To post to this group, send email to dspace-tech@googlegroups.com.
> Visit this group at https://groups.google.com/group/dspace-tech.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
All messages to this mailing list should adhere to the DuraSpace Code of 
Conduct: https://duraspace.org/about/policies/code-of-conduct/
--- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.


[dspace-tech] Re: Using SAF Builder for uploading multiple chapters of 1 item

2019-04-18 Thread alaw
Arunendra,

Each row of the CSV is for one item, not file. Therefore list all the files 
for that item in the first column of that row.

Anne

On Thursday, April 18, 2019 at 2:02:09 AM UTC-4, Arunendra M. Biswas wrote:
>
> If I am not wrong, the csv contains the metadata of each file, to be 
> uploaded, in the folder.When I am uploading one out of 10 chapters of a 
> book, I may need not enter metadata against those chapters as I have 
> already entered metadata while submitting the first entry for the book.
> How can I upload this chapter by SAFBuilder then?
>
> On Wednesday, April 17, 2019 at 12:36:36 PM UTC+5:30, Arunendra M. Biswas 
> wrote:
>>
>> Suppose, I want to upload 2 thesis, ThesisA and ThesisB, each which has 
>> been scanned into 5 separate chapters in pdf format, such as 
>> A.1,A.2,A.3,A.4,A.5 and B.1,B.2,B.3,B.4,B.5.
>> How can I upload these using SAF Builder?
>>
>

-- 
All messages to this mailing list should adhere to the DuraSpace Code of 
Conduct: https://duraspace.org/about/policies/code-of-conduct/
--- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.


[dspace-tech] Re: Export site via packager fails

2019-04-18 Thread Liviu Petcu
Hi,

We found it was a bitstream duplication... Here's the solution: 
http://dspace.2283337.n4.nabble.com/Error-when-exporting-site-because-of-ID-quot-bitstream-2-quot-already-exists-td4680373.html


miercuri, 17 aprilie 2019, 23:27:55 UTC+3, Liviu Petcu a scris:
>
> Hi,
> We tried to export the site (DSpace 6.0) as follows:
> /dspace/bin/dspace packager -a -d -t AIP -e user@repo -i 123456789/0 
> 123456789-0.zip 
>
> The result was the following error:
>
> Exception: Error exporting METS for DSpace Object, type=ITEM, 
> handle=123456789/5547, dbID=c1f08fcd-bf21-4aee-8085-998f6d00040f
> org.dspace.content.packager.PackageValidationException: Error exporting 
> METS for DSpace Object, type=ITEM, handle=123456789/5547, 
> dbID=c1f08fcd-bf21-4aee-8085-998f6d00040f, Reason: 
> edu.harvard.hul.ois.mets.helper.MetsException: ID "bitstream_1" already 
> exists
> at 
> org.dspace.content.packager.AbstractMETSDisseminator.disseminate(AbstractMETSDisseminator.java:292)
> at 
> org.dspace.content.packager.DSpaceAIPDisseminator.disseminate(DSpaceAIPDisseminator.java:165)
> at 
> org.dspace.content.packager.AbstractPackageDisseminator.disseminateAll(AbstractPackageDisseminator.java:102)
> at 
> org.dspace.content.packager.AbstractPackageDisseminator.disseminateAll(AbstractPackageDisseminator.java:137)
> at 
> org.dspace.content.packager.AbstractPackageDisseminator.disseminateAll(AbstractPackageDisseminator.java:158)
> at 
> org.dspace.content.packager.AbstractPackageDisseminator.disseminateAll(AbstractPackageDisseminator.java:149)
> at 
> org.dspace.content.packager.AbstractPackageDisseminator.disseminateAll(AbstractPackageDisseminator.java:149)
> at 
> org.dspace.content.packager.AbstractPackageDisseminator.disseminateAll(AbstractPackageDisseminator.java:169)
> at org.dspace.app.packager.Packager.disseminate(Packager.java:645)
> at org.dspace.app.packager.Packager.main(Packager.java:464)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at 
> org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:229)
> at 
> org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:81)
> Caused by: edu.harvard.hul.ois.mets.helper.MetsException: ID "bitstream_1" 
> already exists
> at 
> edu.harvard.hul.ois.mets.helper.MetsValidator.validate(MetsValidator.java:68)
> at 
> edu.harvard.hul.ois.mets.helper.MetsVElement.validate(MetsVElement.java:68)
> at 
> edu.harvard.hul.ois.mets.helper.MetsValidator.validate(MetsValidator.java:78)
> at 
> edu.harvard.hul.ois.mets.helper.MetsVElement.validate(MetsVElement.java:68)
> at 
> edu.harvard.hul.ois.mets.helper.MetsValidator.validate(MetsValidator.java:78)
> at 
> edu.harvard.hul.ois.mets.helper.MetsVElement.validate(MetsVElement.java:68)
> at 
> edu.harvard.hul.ois.mets.helper.MetsValidator.validate(MetsValidator.java:78)
> at 
> edu.harvard.hul.ois.mets.helper.MetsVElement.validate(MetsVElement.java:68)
> at 
> org.dspace.content.packager.AbstractMETSDisseminator.writeZipPackage(AbstractMETSDisseminator.java:400)
> at 
> org.dspace.content.packager.AbstractMETSDisseminator.disseminate(AbstractMETSDisseminator.java:271)
> ... 15 more
>
> I checked the item with handle=123456789/5547 and it seems to be okay. 
> Will anyone have any idea how to solve it? Thank you.
>

-- 
All messages to this mailing list should adhere to the DuraSpace Code of 
Conduct: https://duraspace.org/about/policies/code-of-conduct/
--- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.


[dspace-tech] Re: Using SAF Builder for uploading multiple chapters of 1 item

2019-04-18 Thread Arunendra M. Biswas
If I am not wrong, the csv contains the metadata of each file, to be 
uploaded, in the folder.When I am uploading one out of 10 chapters of a 
book, I may need not enter metadata against those chapters as I have 
already entered metadata while submitting the first entry for the book.
How can I upload this chapter by SAFBuilder then?

On Wednesday, April 17, 2019 at 12:36:36 PM UTC+5:30, Arunendra M. Biswas 
wrote:
>
> Suppose, I want to upload 2 thesis, ThesisA and ThesisB, each which has 
> been scanned into 5 separate chapters in pdf format, such as 
> A.1,A.2,A.3,A.4,A.5 and B.1,B.2,B.3,B.4,B.5.
> How can I upload these using SAF Builder?
>

-- 
All messages to this mailing list should adhere to the DuraSpace Code of 
Conduct: https://duraspace.org/about/policies/code-of-conduct/
--- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.