Comments (3)
@mpadge I've slightly improved the code, first by fetching DC rdf vocabulary by default, (previously done at each DC element creation), secondly by simplifying each DC element class by aligning with the R6 class writing convention used in the package, for what concern native DC elements (for which we don't really need to look into all class inheritance). Together with that, i've provided setters for lists of elements . See #14
from atom4r.
Yes, this is well known issue that I have to look into very soon. I had already improved this in similar package methods (eg geometa) and I have to see if this can be applied here. I didn't know about 'memoise' and I will look into it, thanks for that. Also something you have to know is that the 'add' methods check if there is alread a value, and will return FALSE if already available, but since some elements consist in complex objects (and not simple string values) the comparison is done by comparing the out xml.
An immediate approach, faster, that is actually implemented in the decode
function, is not to use the util adders (and then much less convenient), but directly set the fields with the appropriate elements. Example:
dc <- DCEntry$new()
dc[["contributor"]] <- lapply(c("Bob", "Peter", "Bunny"), function(x){DCContributor$new( value = x)})
On this basis, I will support new setters as talked in #14
from atom4r.
Great stuff - thanks!
from atom4r.
Related Issues (20)
- Standardize R6 class R documentation
- DCElement classes not listed when namespace not loaded HOT 17
- DC XML decoding consolidation
- Package github-pages with pkgdown
- Issue with XML package in Github r-lib v2 actions HOT 5
- Support new setter methods for list of elements HOT 1
- Accessors/getters for DCElement objects HOT 1
- Missing DCMI Elements HOT 2
- bug in "updated" timestamp HOT 2
- Fetch vocabulary data by default
- Add readDCEntry util function
- Include local xsd schema to avoid internet resource unavailability
- validate method fails after 'setUpdated' method called HOT 2
- Provide simple method to export a DCEntry as data.frame
- Issue with registerAtomSchema example
- Data testing - atom4R / SWORD action broken in recent Dataverse
- CRAN reports package startup messages (related to rdflib) cannot be suppressed HOT 1
- Evaluate upgrade from httr to httr2 for API requests
- Evaluate migration from XML to xml2 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from atom4r.