Blog

Peculiar Java JSON serializer problems

Finally, in my Semantic Web developer career, I got to that point when I had to do some work with JSON in Java. And as it goes, typically one needs to read some JSON, from an API, and make it available in a POJO (deserialize) and vice-versa (serialize).
The only requirement I had, was to avoid using annotations of any kind, such as @JsonProperty or @JsonDeserialize. Let’s take as an example a JSON object describing a person:

Please notice the @name property and that the degree property is a nested JSON object which can contain a different number of sub-properties, not known in advance.

First, we deserialize the above JSON into a Person POJO, then some data gets changed, and then it gets serialized back to a JSON object.

The POJO of the above example JSON is called Person.java and looks like this:

The focus is now on the serializing of this POJO.

Since I could not use annotations (@JsonProperty or @JsonDeserialize), I had to write a custom serializer or adapter (depending on which JSON library is used). This is where the peculiarities started.

My solution is written for both libraries: Jackson and JSON-B with Yasson. Next, I will exemplify them.

Let’s start with Jackson.

I pulled in Jackson version 2.13.4 from Maven and started with a Custom Serializer. The custom serializer needs to override the serialize method of the extended StdSerializer<Person> class. In the serialize method is where the customization happens:

Above, I am attempting to write the degree property, which in the POJO is of type Map<String, Object>, out as a string. This ends up being serialized as a JSON as follows:

did solve the @name property but the degree property is quite wrong! It is a String.

So how can this be improved with Jackson?

The solution is to use writePOJOField(). The exact and correct code looks like follows:

Awesome! Solved it for Jackson. Find the full code on GitHub.

Let’s see the solution also using JSON-B.

I have the same requirement: to not use any annotations. For this, I pulled in the JSON-B 1.0.2 version from Maven central and Yasson 1.0.3.

In the case of JSON-B, I needed to write an adapter to deal with the @name property. As goes, the adapter needs to override the adaptToJson (serialize) and adaptFromJson (deserialize) methods from the JsonbAdapter<Person, JsonObject> interface. So, the first go at it looks like the following (and I only focus on the adaptToJson method here):

If we take a look at the serialized JSON, we have again the same problem as with Jackson. The @name property is ok but the degree property is wrong again! The generated JSON looks like follows:

So how can this be done any better?
While in Jackson we had the brilliant writePOJOField method, JSON-B does not have such a method. My idea was for the adaptToJson method to use a helper method called addRightJsonType. So the correct adaptToJson is:

And the helper method addRightJsonType is a recursive method, that tries to catch all possible types of the entry value and deal with it accordingly:

Find the complete code on GitHub, which includes also the code for adaptFromJson method.

Conclusion

When I set out to serialize JSON in Java, little did I know that this task will come with some peculiarities. Writing a Jackson serializer or a JSON-B adapter means one needs to specify in detail how each property is to be handled. There are no shortcuts like using .toString() on a Map<String, Object> degree property. For some reason, I initially thought that by simply omitting it completely, it would still magically know how to deal with it 😅.

I also see how Jackson, by having a dedicated writePOJOField method, can be considered the most mature Java JSON parsing library. I also say this, because while searching online for solutions, other libraries also had the same problems as Yasson: no dedicated method to do this simple task.

Remark: for code simplicity, some if statements were omitted in the above code. See the full code on GitHub.

My personal opinion about Solid

I was thinking hard about how to explain Solid best. I like explanation videos. And because I am not talented at creating them and because someone already did a great job, I simply share one I like.

What is Solid?

Why a new Web in the first place?

As the Web is today, there are a few problems. The ones that bother me the most are:

Openness and accessibility

I have a Facebook account. If I want to share a social media update with a friend who does not have Facebook, I need to make it public and thus available for everyone to see it. That is not open nor accessible! Who creates this rule? The service provider, Facebook. Facebook owns my social circle.

Censorship and privacy

The truth is, my data, in whatever service it is on, could be sold to companies I would not know about it maybe. Everyone knows by now ‘if the service is free you are paying with your data. The service I have my data on can chose to do whatever because they are the authority. They can decide tomorrow that all data that contains the word ‘poop’ is going to be censored and deleted. And if I want to continue using their service, if I am not already banned, I need to sign their new Terms & Conditions.

What do people say about Solid?

Looking online at the general concerns about Solid I try to give my personal 5 cents about them and thus complete the image of what Solid is and can become.

How are data-thirsty companies going to buy into Solid?

At first, they will not. Not as long as their business model is based on monetizing user’s data. However, if they are smart, they will have/already have solutions in place to keep their business successful without owning so much data.

Recently I looked into the Amazon business case. One can see that their business is shifting or at least they have a strategy in place to help them be resilient in the face of such a data privacy change. I think their strategy is to become the ultimate service/experience provider in retail. They will not care where the data will be stored since their competitive advantage will be to offer the best service. For example, Amazon can provide the ultimate shopping experience based on tech (see Amazon Go). Don’t get stuck on the Amazon Prime account – that could well be your WebID. And do not get stuck on payment. Your WebID could contain your preferred payment method which your bank trusts and ultimately allows the transaction. In the end, you could be using Amazon Go which just happens to be, in the future, the go-to system in all shops…

And why would Amazon Go be the best system in place? The concept itself is not based on data, on your data. It is based on shopper needs which right now seems to be about ‘time’: ‘no line, no checkout’. Yes the ML and AI are based on data but that data will continue to be available as research data or Amazon could buy it from you.

If you notice, Solid could shift the focus from a business model based on the heaps of data to a business model based on best service quality.

How are data-thirsty companies going to buy into Solid? Take Two.

Because of YOU!

If we start to have choices that are based on the best service provider, best safe Pod host, best UX and accessibility, best experience, the data collecting giants will be left behind. They will have no choice but to change strategy and get in line with what the little people want. We might be little but we are billions, we are the market.

What keeps companies from simply copying your data? And keeping it?

They can do that now. And they could maybe do that in the future too until I, the user, pull the plug and with that, they will get no more up-to-date data about me. Current business models driven by data mean that the data is up to date, near real-time. This is very important because if they have my data from last year it will be majorly outdated when it comes to saying: my book purchase preferences, or fashion or whatever! I argue that the value of data is in its freshness.

And also, I hope, there will be policies and laws in place that will not allow this. Because if the market asks for the best quality in a service provider and we hear about privacy concerns we will deregister, cut the data plug and move to the next most secure service provider.

How about security concerns of Pods being individually hacked?

This is a good valid point! The premise is that a hacker would target individual Pods. Hmm… might not pay off. Let’s say that a hacker can hack more Pods at the same time because of a loophole in the tech. Pretty much what is happening right now! So how is that a bigger concern than how it is now?

My final thoughts

I think Solid will co-exist in parallel with the Web we have today. Nothing will change drastically and fast! We will keep having Social Media accounts, Amazon accounts, Google accounts, and data all over the place. However, we will have a new choice more privacy-sensitive. Diversity and inclusion is all about giving people choice.

My first (official) month in the Solidverse

or how to start a new chapter of your life

In this post, I report on how it was to start a new chapter of my life, what I did and how it felt. For a technical take on the Solidverse, there will be a follow-up post.

First things first, why a new chapter?

Job hunting usually triggers a new chapter, doesn’t it? I started looking for a job in the domain of Semantic Web. I send in a CV at Inrupt even though there was no open positions. The whole process took about 3 months. This gave me enough time to consider if I should accept the position offered to me or not. The reason why it took so long is related to the hiring process and my struggle to come back after what felt like a startup failure (read about My year of entrepreneurship).

Why Solid?

I very much agree with what the Solid Project website says: “your data your choice”. It is my first job where we all work for a greater purpose bigger than just revenue. The point is: the future is still so much bigger when it comes to the world wide web. Sir Tim Berners-Lee and the Inrupt team are spearheading a new technology, Solid, which empowers individuals and opens new value creation opportunities. Instead of waiting for the future to happen, I decided I want to be part of shaping it. I got a position as a Software Engineer on the open-source SolidOS project guided by Sir Tim Berners-Lee.

Down the rabbit hole

Everything was new… and it felt like a tremendous change. Who is not scared, a bit, by change?

The start

Inrupt is a startup and one needs to get useful. In startups, getting told what to work on is not the norm. So I started with writing my job description. This was the first exercise where I needed to think about how to do my job and what I want to work towards. Being 10 years in the industry did help! Typically, for me, the plan goes as follows:

  • First month and a half: acquire knowledge about code, processes, and people.
  • Following months kick-off/embed yourself in a feature/sub-project where you think you can contribute. Then focus to deliver.

There were a lot of new things for me: new programming language, new development environment, new OS, new laptop, new working culture (all remote), different timezones, open-source, new ecosystem, new people, new chat applications, new processes, new autonomy in a company, new hair color 😏. The only thing that stayed the same was my desk at home, luckily 😅 (which changed already a month before). And the fact that I already know Semantic Web.

The first official week, I felt overwhelmed by the autonomy I have. This is not for everyone! I was a bit spinning I gotta admit, the first day before I anchored myself in my usual fallback solution: create a todo list 😎. Spinning for me means: fussing around being unfocused, not knowing what to do because either there are too many tasks or because one does not know how to start, on the what to focus. A todo list always helps me. What is your fallback solution?

The second week, I started to feel a burdening imposter syndrome. You know, the feeling which we all have when we are new to something. It is the feeling of being discovered as a no-good and fired on the spot 😱. I suppose it was all normal especially because my environment involves working with people with a lot of experience from high-profile companies. Or people with years of business and developer experience. And, well, there was the ‘creator of the web boss’ things which, I gotta admit, was intimidating at first. However, reality is nothing like that.

If you ever had impostor syndrome you know what I mean 🥺. I got over it because the people I work with are just amazing, supportive, and understanding. They told me about their impostor syndrome and I did not feel judged, for a second, for my experience, background, culture, gender, and so on. And that right there made all the difference!

The middle

Compared to my previous times of starting a new job, I did not focus only on reading and learning. Instead, I decided to bang my head by taking on a code feature and work it out. Bang my head means: write code before reading the entire documentation or knowing the entire code architecture or whatever.

My new approach was so much fun!!! It worked because:

  • My reading and learning focused on basics that helped me be productive – building code with node, javascript basics, npm packaging, visual studio code shortcuts.
  • I know how to ‘divide and conquer’ a task, split it into subtasks and achieve small goals.
  • I got great feedback on the way, through pull requests.
  • And most AWESOME: I got a buddy who introduced me to SolidOS code, to the communication, and to the people (thank you Sharon!).

And what do you know: I did my first Pull Requests on open source, I learned a ton about the code, and I found tasks where I can be useful moving forward.

Towards the end of the month, I felt more on top of the code stack and I could focus again on what I wanted/needed to do after the learning phase.

  • Slowly, I started to gather information about a new feature I want to kick off.
  • Talked to/found people who can help me implement it.
  • Exchanged some ideas and wrote up a bit of documentation.

The productive

What helped me go from getting started to be productive in a nutshell:

  • Have a buddy or ask for one.
  • Have a plan in place like 1.5 months learn then kick off smth.
  • Don’t get demoralized that one is not productive in the first month when only learning should be the goal – make a post-it if you forget “learning is the goal”.
  • Start learning about tech stack parts that make you productive – set up the environment, know how to build, use watch, and so on.
  • Lean on colleagues to help with overcoming impostor syndrome and not feeling like the new person – proactively plan coffee chats.
  • Divide and conquer every task – don’t get stuck in being overwhelmed by how big a task is and feel the ‘done’ effect when a small part has been achieved.
  • Talk to people and listen.

And most important:

  • Be kind to yourself in the process of change! Accept that you will have bad days and non productive days and days where not much will work. ‘Those too shall pass”.

The beautiful part about it was that even though I went in this endeavor with low energy, I did not get lost in stress but through kindness and patience, I was more productive than I thought I could be.

What’s next

Now I am off to my last MBA course (on leadership) so I can close that chapter of my life too. I am careful lately about my energy level and try to finish a project before starting new big ones. The startup year exhausted me there 😓.

Regarding Solid, oh!, I have so many cool things I want to do. The Solidverse captivated me completely! I felt welcomed and useful and valued. I am off to a great new chapter of my life, full of code and creativity, and collaborative work!

My year of entrepreneurship

Preamble

In spring 2019 I applied and received a scholarship for an MBA at the Technical University of Vienna. I quit my job in autumn, same year, and travelled for a month before starting the MBA and a new job. The pandemic arrived a few month later and my job was a flop. What to do?

Intro

I decided I wanted for my MBA master thesis to write a business plan, the business plan to my own startup. So I took the path of entrepreneurship to learn it while doing it and to make the most of my MBA. Of course, at the beginning, the intention was to be successful and create my own work place and job description while also doing something good in the world. Now, after more than a year, I know it was an excellent learning adventure because it was not successful in the sense of creating a business.

The details about the entrepreneurship path, which includes Lean Design Thinking and our six ideas that were generated, are detailed in my master thesis. But the change that took place in me and the learning and self discovery, well that is a different story. Part of it I will try and write about it here.

Getting to the hard points

Taking part in several course and startup events to learn.

I tried a lot of startup opportunities offered in the Viennese community (and abroad) in 2020/2021. Some were better than others. Next I will mention some of them maybe it will help you.

First there was the 8-week startup course by RBL1, US based. I wanted to see what people in US learn in entrepreneurship. And I wanted to see what US startups were working on. Plus, the course was in beta version and I did not have to pay for it. It was interesting. It gave me the basics but I wanted to learn more.

Afterwards we got into the Impact Hub social accelerator for six month. This program was face to face, as much as possible, and it really conveyed a feeling of community. All the participating team were working on SDG problem. The mindset was amazing. We learned from one another and the workshops were tailored for starting startup like ours.

In parallel, we also did the WeDO5 good startup school where we learned about a different approach: the lean startup innovation methodology. And it was all about validation, validation, validation which we soooo underestimated.

We took part in the Circle17 Impathon where we worked on a proposed challenge brought to the program by the Austrian Development Bank. This was an intense long weekend, excellently organized! Everything was collaboratively done in Miro, remote and we had great fun!

At the Hacking4SDG startup course, organized by WeDo5 again, we had an intensive learning journey. We had the pressure to meet Alexander Osterwalder and Steve Blank. This course was all about validation, validation and validation again. Which we finally started to understand.

For the year 2021, we joined the Women AI Accelerate program and the SDG Innovation Lab. At this point, we were seven people in the team and we could split up in the courses which took place over several months. The Women AI Accelerate consisted of about 40 women interested in startups. The content was excellent! Each diverse topic, from law to AI programming to Public Relations, was delivered by top female and male experts. Some of the content was better than my MBA content!
For sake of completion of the list: we also took part in Startup Live in February 2021. And I want to mention the Vienna Business Agency which were absolutely lovely (compared to other Austrian institutions) and it offers great courses for entrepreneurs.

Next I will talk about what we did not join or what did not work for us.

We did not get into INITS in Vienna because we did not have a joint venture with a University or such. The UGP looked over the incomplete business plan and after two sessions, rejected me from their support and program. Then, we did get into Founder’s Institute but decided at that point, start of 2021, that we could not commit to the intense program and its expectation.

And in March 2021 we got the delayed answer from FFG that we got the Impact Innovation grant we have applied for in October 2020.

Conclusions:

There are a lot of programs and events out there. Each have their different levels of knowledge and expectations. But not all of them are good. What they all have in common: they demand your time. And your time is really valuable! Make wise decisions and inform yourself beforehand. And when possible, try to find out what you need and what fits to your state of startup you are in before joining. Have goals for each one.

Desperately trying to make sense of my personality in the hope I can work better together with my co-founder.

Some of the time in the co-founding team was dedicated to us, our communication, our mentoring each other and getting to know each other. It was hard to try keep this up but we managed I would say. This was not the problem.

We started with the MBTI personality test. I mean I even read the book about it, several times. And I tried to explain what it all means, to my co-founder… how I embody the INFJ type indicator. Well… that was not quite enough. Our friction problems were unfortunately not simply solved with this know how. Then we did some two more personality type tests, I am afraid I do not remember their names because they were not so good. And in the end we also learned about DISC. DISC is interesting! It resonated with me a lot. And it is probably quite useful if one would not be a ‘chameleon’. It turns out I can adapt to all four types of DISC when need be. And still…

One of the igniting reasons, the biggest reason for me, the startup failed, is because the team fell apart. I tried to think about it to learn why it did in the hope to avoid it next time around. Well… I suppose, like in marriage or any relationship: when it is a bit harder than it should be, at the beginning already, it is a sign this is not it. And if one learns to listen to the gut feeling more instead of being afraid to be a solo entrepreneur, one could avoid sooner the unavoidable.

Conclusion:

Personality types do not replace the gut feeling you are trying to avoid. They can also not explain what is going wrong 100% in your communication or misalignment. Instead of spending time here and there, just spend time with yourself and ask yourself truly: Is this what I want? Is this feeling good? Are we aligned? If more than one answer is a “no” then maybe you should call it out: next!

Austrian services to found a business almost killed me.

Oh wow! This which I expected to be easy, turned out to be soooo annoyingly hard. There is either too much or too little information online. Calling blindly WKO made matters worse.

To the point: we did not know what legal form we could create in our situation and to get the information was tedious. We did no know if we need a lawyer first or an accountant or what. To this day, I do not know why it was so hard! But I was disappointed! Even the equity split discussions were easier than this.

Conclusion:

The accountant knows more than you think and probably you need to go first to her. Not everyone will be kind and helpful, brace yourself.

Knowing when to CALL IT A DAY.

At the end, I had to do a very hard decision in my life: say ‘no’ to a 150k grant. Why this was necessary I will explain next.

We were decided to be three co-founders and to found a GmbH. We had a 30% equal split and 10% employee equity with a four year vesting period and a 25% cliff after one year. We even figured out we needed an accountant and we got a draft for a formal founder’s agreement. And then, the team fell apart. One founder backed out and the other two as well (including me). I want to say this was not the reason but it was the ignition.

I always said (at least to myself) I do not want to go this path solo. I wanted a partner, eye level, to share motivation, enthusiasm, responsibility and risk, equally. However, ‘equally’ is a funny thing! Yes, we did split equity equally but I started to have doubts that I was getting into business with someone on the same eye level. Doubts started creping in, in my bones. And what do you have as an entrepreneur when you start to not believe in your journey? Not much I tell you.

To make matters worse, I started to have anxiety in the form of shortness of breath already back in February 2021, almost every day. And that was my body telling me already back then, that things are not ok. I ignored my gut feeling and then it started to manifest physically.

Conclusion:

Never, never ignore gut feelings. They are the first signal about something being wrong. Not even team coaching can fix a founders relationship which is not meant to be, if problems are there from quite an incipient phase. Startups should be fun! When one forgets the fun and it is stress 24/7… well… I don’t know.

Some good takeaways

  1. You can only learn while going threw it. And you will learn more than you ever thought you can.
  2. Go threw it! You cannot imagine how many things you will learn: about yourself and about entrepreneurship.
  3. There is a wonderful new world with welcoming people awaiting in the entrepreneurship ecosystem.
  4. Take your time to choose your co-founder.
  5. Try to have a north star and not to loose your way (your values and/or purpose).

Job Seekers: you need to know what recruiters say about Cultural Fit

I’ve been interviewing lately job seekers and recruiters alike, asking questions about the hiring process. Next I want to outline my findings on the topic of Cultural Fit when it comes to hiring people who are not for leadership positions.

First: what is cultural fit? To keep it super short – it is that sweet spot where your personal values fit/go together with the team values you will be working in. Some example of such values:

  • Personal value: I like to work goal oriented -> team value: we do not micromanage
  • Personal value: I like team work -> team value: we work collaboratively and like when people giving input
  • Personal value: I like to learn new things -> team value: learning on the job is expected

To exemplify the hiring process structure of a company, from my job seeker perspective, I super simplified structure is:

  • post job position
  • scan of received CVs
  • interview process
  • hiring offer

So where, in the above mentioned parts, does the company check the cultural fit?

From what I discovered, usually the earliest, cultural fit is checked at the (drum roll) – interview process

So why is this important for you to know and be aware of?

  1. Your SKILLS that you put on the CV are the ones that get you in the door and ONLY those! If there is an automatic process that scans the CVs, the personality is out the window. If a headhunter is handling your job offers, usually only the experienced head hunters (mostly hiring for high level positions) ALSO consider cultural fit.
  2. Your CV structure and the way you write talk about your cultural fit as well. These aspects are 100% checked by every hiring decision maker (once you manage to get them to see it). Typos show you do not care enough about the company.
  3. If anyone uses your picture, or name, or age, or any other such personal information on your CV to check cultural fit -> alert alert you are dealing with unconscious bias, privilege to the point of discrimination. They definitely are doing it WRONG!
  4. The company will ask you so called usual questions like: what is your perfect work environment? I mean I get it BUT can we agree that THESE types of questions are just plain BORING and maybe a more natural flowing conversation is more in the CULTURAL ADD trend? I mean, I personally make a difference between a good recruiting experience and a BAD one based on such questions!
  5. It is mega important that at the interview process you ask YOUR questions to check YOUR cultural fit expectations. And it is ok to ask:
    • Can I talk to an employee that does/has/is in your company? (especially if the people in the interview are not representative enough for you)
    • Do you offer shadowing for this role?
    • Is this a culture in which I can be flexible/mentored/informal/silly/funny/tattooed/be sometimes late to work/work in a quite place/wear only black/take unpaid leave/have pink hair/sporty/not drinking alcohol and so on…
    • Side note: maybe recruiters can even give the interviewee a list of such questions as preparation, so that I know it is ok to ask and I will not be judged or disqualified because of them! (I admit I do not ask candidly all of them because I fear I will be met with a “what you are late to work?” look. Taking about bringing my authentic self to work when I cannot even do that in the interview lol)

And for the go I want to leave you with a quote:

If someone is incompetent it is OK but

if someone is incompatible it is a disaster.

8 times more likely to achieve better business outcomes

Who does not want that?

EVERYONE wants that! And more:

  • twice as likely to meet or exceed financial targets
  • three times as likely to be high-performing
  • six times as likely to be innovative and agile

How does a company achieve this, you may ask? SUPER simple!

By creating an inclusive environment.

And this is where the cookie crumbles!

  • “I do not know what inclusive means”
  • “It is not aligned with business goals”
  • “I do not believe this works”
  • “We do not have time for this right now”

It turns out is is not so hard! Like Marlow’s pyramid you need to start with the pyramid base and add until you reach the TOP. The good news is: it only has 3 steps.

Inclusive culture 3 steps

I worked in IT companies all my professional life (10 years) so here are my suggestions for IT companies:

COMFORTABLE

  • Improve your Performance Interviews to be FAIR (actually helps drive equal pay)
    • fair means: have a worked out mathematical formula. It is not so important what that formula is as much as it is important that YOUR employees knowing there IS ONE!!! (it is a darn good start)

CONNECTION

Only and only if you have worked out the previous point continue working on this one. Remember it is a pyramid.

  • Offer opportunities for different social activities, and NO, going to a beer is not inclusive and soooo not enough.
    • Have you tried: hiking, escape the room, beach volleyball, cooking, helping out at a shelter or volunteering together for a better cause? You get the point…
    • Do not be shy to invite also people from other departments! It really really really helps!

CONTRIBUTION

Only and only if you have worked out the previous point continue working on this one. Remember it is a pyramid.

If you think comfort and connection was hard to achieve, you better give up now.

  • Are employees really involved in your decisions?
    • Have you asked them what would be a good work from home guideline or did you just slap it on them?
    • Have you asked them if the interface makes any sense to a woman? How about a child? How about a visually impaired person?
    • Have you asked them what your company values mean to them? Do you even have any? (NO? perfect! you have the amazing opportunity to make them collaboratively! You have values already? Can you afford to change any or add?)
  • Do you value the people who drive your business?
    • Do you, as the CEO, ever compliment them on a small contribution (in person)?
    • Do you have a down to earth, real life (NOT about business) (ones will say VULNERABLE) conversation with your employees?
    • Do you ever talk about the purpose of a task? Do you listen when they struggle with motivation? Do they even TELL YOU?

These are just some ideas I know would have helped me stay in my work place. Anyway, the more simple ones.

Still skeptical I see… Don’t take my word for it!!! Please read the Deloitte Belonging article. Just hot off the press (15 May 2020).

Make time to understand the implications you read there! If you just plan to skim through then don’t bother.

“8 times more likely to achieve better business outcomes

I really really don’t believe it is so hard. The only reason why I think it is not implemented yet is: “the day to day business is simply done differently in my company”.

Disclosure: quotes are not quotes from people I know. They are just my left shoulder talking to the right shoulder, trying to argument both sides 🙂

Cookie icon by Icons8

Exclamation Mark icon by Icons8

#hackthecrisisat

This weekend I decided to stop complaining about my throat and head ache over the week. And I stopped feeling useless. And I stopped feeling like work is everything I got. I decided to join an online hackathon!

Yup.. we are in the middle of it. It will finish tomorrow. And it feels great!!! My confidence, chipped away at work, is back! I felt valued and appreciated and grateful that my “generalist” skills (i call it so because I have confidence problems lately (Impostor Syndrome)) are useful to someone 🙂

My personal goal from the hackathon of learning something new and contributing was already achieved! I did not think it would be so easy actually. I loved to listed to ideas and find out about resources and have the opportunity to meet other people who know and like RDF.

Concretely: what at the beginning was a pile of ideas and wishes and divers points of view, I managed to converge to a concrete goal, a focus in the team. All the great ideas needed to be part of something achievable and deliverable in 2 days. I also jumped on installing SemanticMedaWiki on a EC2 AWS…. much like I learned from hosting my own website. (ieii happy about this one). Yup and I got to learn about SemanticMediaWiki.

The project is not over. Tomorrow is the great showdown with pitching and all… And I really want to get to know the input for the business model and the structure of the pitch. All super cool topics I am interested in lately.

In all this excitement I even forgot to mention what the project is about. Original idea:

Platform Eutopia
There exists no platform where one can get an overview about all the problems or bottlenecks we are facing at the moment in connection with the corona crisis and the possible solutions for those. And also with the people and connections that are already working on the problems.

More about the outcome:

See here the final project pitch presentation I ever did: https://www.youtube.com/watch?v=25yVp74U4ho&feature=youtu.be

Project website: https://evolution-circle.wixsite.com/website and the SemanticMediaWiki: http://54.93.194.43/wiki/Eutopia

Reference: https://hackthecrisis.bubbleapps.io/

P.s There are a bunch of hackathons on this topic all over the world. Not too late to join one, for example the upcoming global one: https://covid-global-hackathon.devpost.com/submissions

And more:

https://wirvsvirushackathon.devpost.com/submissions
https://changemakers-day-hackaton.devpost.com/submissions
https://endcoronavirus-org-hackathon.devpost.com/submissions
https://hackfromhome.devpost.com/submissions
https://freshworks-fights-covid.devpost.com/submissions
https://coronawiki.net/index.php?title=ALL_Projects
https://coronavz.com/

Lets recall transaction processing (Java with Spring) – part 2

So lets get back to the overview of transactions in Java with Spring Framework.

Bean-managed transactions can be:

  • container-managed transactions or declarative transaction management
  • application-managed transactions or programmatic transaction management

Declarative transaction management can be XML-based or annotation-based. A disadvantage of declarative transactions is: when a method is executing, it can be associated either with a single transaction or no transaction at all.

Programmatic transaction management gives more liberty. Take as example this pseudocode from Java EE 6 Tutorial (quite old but makes the point):

begin transaction
...
    update table-a
...
    if (condition-x)
   commit transaction
    else if (condition-y)
   update table-b
   commit transaction
    else
   rollback transaction
   begin transaction
   update table-c
   commit transaction

This fine-grained programmatic dependency of when to commit or rollback can only be achieved without declarative transactions.

Transaction Propagation

Not mentioned so obvious is the fact of what is the DEFAULT propagation in Spring transactions.

  • The default propagation is REQUIRED
Propagation types and their behaviour
PROPAGATION TYPE no current transaction there’s a current transaction
MANDATORY throw exception use current transaction
NEVER don’t create a transaction, run method outside any transaction throw exception
NOT_SUPPORTED don’t create a transaction, run method outside any transaction suspend current transaction, run method outside any transaction
SUPPORTS don’t create a transaction, run method outside any transaction use current transaction
REQUIRED(default) create a new transaction use current transaction
REQUIRES_NEW create a new transaction suspend current transaction, create a new independent transaction
NESTED create a new transaction create a new nested transaction

Table is from ninjalj’s blog.

So lets see what this means in the context of a database connection and what the other propagation types.

And because I never went in too much detail here, I recommend to read Marco Behler’s blog to get the full picture.

A cross-RDF Graph Database investigation: the case of the missing context!

What is a graph in RDF?

RDF Graph Databases, also known as Triplestores, are a subset of Graph Databases where data is represented in triples. A simple triple consists of a subject, a predicate and an object aka subject-predicate-object. The predicate is the edge in the data graph that connects the subject to the object nodes. If we add context or graph information to a triple, we end up having the following structure: graph-subject-predicate-object. And when we talk about a graph in an RDF Graph Database, we always refer to it as the context. This type of triple, in turn, is named a quad.

The graph exists to structure and represent your data better because the triples with the same graph have the same context. The existence of the graph is one of the main differences between a property graph database and an RDF graph database. Yes, you can store your graph information in a property graph database too, but the RDF store is designed from the ground up with this in mind.

In the end, the choice of the database type is a matter of performance and how you want your data to be represented best for your use case.

What happens if there is no graph? 

One can insert data in the RDF Graph Database that does not contain the graph information. These simple triples are stored in the so called “unnamed graph” or “default graph” of the database. We want to see how to access this graph and we know that the DEFAULT SPARQL keyword is usually used in such cases.

Now that we specified what the DEFAULT graph is in relation to an RDF Graph Database, we will take a look at different triplestores and their specific implementation of it. We will look at some basic actions like data insert, delete and query. 

The triplestores we evaluated are: RDF4J 2.4, Stardog 6.1.1, GraphDB 8.8, Virtuoso  v7.2.2.1, AllegroGraph  6.4.6, MarkLogic 9.0, Apache JENA TDB, Oracle Spatial and Graph 18c. From now on when we mention one of them, we refer to the versions listed here. We did not change any configurations upon installation, so our observations relate to the default setup. 

Learnings

Data insert observations

The insert data SPARQL query used is

INSERT DATA {

<http://example.org/picasso> <http://example.org/paints> <http://example.org/guernica>

}

This query inserts a triple which has to graph information. The triple is stored in the DEFAULT graph of each RDF Graph Database. However there is a difference from store to store of what the DEFAULT graph represents. 

In Stardog, the DEFAULT graph keywords does not exist and instead one needs to use <tag:stardog:api:context:default>. All triples land here. 

Apache JENA TDB uses <urn:x-arq:DefaultGraph\> as default graph and the triples land here. You can use the DEFAULT keyword to query them.

Virtuoso has an internal default graph but the big difference is that a user cannot access it by using the DEFAULT keyword. The triples without graph information are added to this internal default graph.

Select data observations

The SPARQL query for selecting data used is:

SELECT * WHERE {

?s ?p ?o

}

For most of the triplestores what happens is that the data retrieved is coming from all graphs, including the DEFAULT graph. Basically it does not take into account any specific graph. The exceptions are:

Stradog retrieves data only from its internal default graph <tag:stardog:api:context:default>.

For Virtuoso you always need a graph otherwise you receive: “No default graph specified in the preamble”.

Delete data observations

The SPARQL query used to delete a triple is:

DELETE {

?s ?p ?o

} WHERE {

<http://example.org/picasso> <http://example.org/paints> ?o

}

Generally the triples that match the pattern are deleted from ALL graphs it exist in. Exceptions from this behaviour we found in:

Stradog deletes the triple only in the defined default graph. 

MarkLogic and Apache JENA TDB behaves the same. It deletes the triples that match the pattern only from the internal default graph. 

In Virtuoso one always needs to specify a graph to delete data. 

We also want to remark how a SPARQL query looks like when the DEFAULT keyword is present. The query to select data would look like:

SELECT * FROM DEFAULT WHERE {

?s ?p ?o

}

Additional known configurations 

In Stardog there is a configuration property which lets you choose which behaviour you like better. Through the query.all.graphs = true parameter, when you query without a graph, it will look in all graphs – default and named graphs – exactly like in the case of RDF4J. And if the property is set to false, it will only query the internal default graph. 

Additionally, if for some reason, you really need a graph in your SPARQL query even when you only need data from the DEFAULT graph, in Stardog you can write it as: FROM <tag:stardog:api:context:default>. And if you want to query all graphs, you can also do FROM <tag:stardog:api:context:all>.

In Virtuoso we learned that you always need to specify a graph when you query. So how do we work with the DEFAULT graph than?

There is a specific syntax for Virtuoso which lets you define/set your graph at the beginning of the query:

define input:default-graph-uri <graph_name>

INSERT DATA

{<http://example.org/picasso> <http://example.org/paints> <http://example.org/guernica>

}

Read more about it in the Virtuoso documentation.

AllegroGraph also provides some configurations. The defaultDatasetBehavior can be used directly in the SPARQL query to determine if  :all, :default or :rdf should be used when no graphs name is specified in the query. 

Or one can fix the default graph name with the default-graph-uris option (or the default-dataset-behavior) upon the run-sparql command.

In MarkLogic when working with REST or XQuery one has the default-graph-uri and a named-graph-uri parameters available, like mentioned in the SPARQL 1.1 Protocol recommendation to specify the graph.

In Apache JENA TDB all named graphs can be called  with <urn:x-arq:UnionGraph>. The configuration parameter tdb:unionDefaultGraph can be added to switch the default graph to the union of all graphs. And the default graph can be specifically called with <urn:x-arq:DefaultGraph\>

Conclusion

RDF Graph Databases are built from the group up with the context of your data in mind. Knowing your graphs and triplestore setup is, from my point of view, a basic knowledge for both developers but also data engineers. Always start with the question: “what setup do I need for my use case?”

Cross-RDF Graph Database behavior – the DEFAULT graph 

Triple store behavior on new installWRITE triples without graphSELECT triple without graphDELETE triple without graph
RDF4J 2.4Triples are added to DEFAULT graph.Retrieves data from ALL graphs including the DEFAULT graph.Deletes triples that match the pattern, from ALL graphs.
Stardog 6.1.1Triples are added to <tag:stardog:api:context:default>  graph which acts as the DEFAULT graph.It retrieves data only from the <tag:stardog:api:context:default> graph.It tries to delete the triple in the defined default graph. 
AllegroGraph  6.4.6Triples are added to an internal DEFAULT graph.Retrieves data from ALL graphs including the DEFAULT graph.Deletes triples that match the pattern, from ALL graphs.
MarkLogic 9.0Triples are added to an internal DEFAULT graph.Retrieves data from ALL graphs including the DEFAULT graph.It tries to delete the data in the internal DEFAULT graph.
GraphDB 8.8Triples are added to DEFAULT graph.Retrieves data from ALL graphs including the DEFAULT graph. Deletes triples that match the pattern, from ALL graphs.
Virtuoso v7.2.2.1Triples are added to an internal DEFAULT graph.You always need a graph otherwise you receive: “No default graph specified in the preamble”You always need to specify a graph to delete data.
Apache JENA TDBTriples are added to <urn:x-arq:DefaultGraph\>  graph which acts as the DEFAULT graph.It retrieves data only from the <urn:x-arq:DefaultGraph\> graph.It tries to delete the triple in the specified default graph. 
Oracle Spatial and Graph 18cTriples are added to an internal DEFAULT graph.Retrieves data from ALL graphs including the DEFAULT graph.Deletes triples that match the pattern, from ALL graphs.
Triple store behavior on new installWRITE triples without graphSELECT triple without graphDELETE triple without graph

Volunteering & me – part 2

In the previous post about volunteering & me I was mentioning the communities I was part of in the past years and what I was doing there. In this post I want to put down all the training I benefited from (received and given for free) in these communities and more. Here goes:

  1. Leadership & Management 2009 AIESEC
  2. Effective communication 2010 AIESEC
  3. Public speaking 2010 AIESEC
  4. Product Management 2010 AIESEC
  5. Global competency model 2010 AIESEC
  6. Entrepreneurship 2010 AIESEC
  7. Become a trainer 2010 AIESEC
  8. Communication & presentation skills 2010 AIESEC
  9. Audience management 2010 AIESEC
  10. Needs assessment 2010 AIESEC
  11. Delivery methods 2010 AIESEC
  12. Preparing a session 2010 AIESEC
  13. Briefing & debriefing 2010 AIESEC
  14. First given training on “Presentation skills” 2010 AIESEC
  15. Goal setting 2010 AIESEC
  16. Ar of Feedback 2010 AIESEC
  17. All about coaching 2010 AIESEC
  18. Management & leadership 2011 BEST
  19. Effective meetings 2010 BEST
  20. Communication weekend training 2011 BEST
  21. Giving and receiving Feedback 2011 BEST
  22. Knowledge Management training 2011 BEST
  23. Entrepreneurship course 2011 at TU Vienna
  24. Myer-Briggs Type Indicator training 2011 BEST
  25. Strategic planning 2011 BEST
  26. Motivation 2011 BEST
  27. Delegation 2011 BEST
  28. Leadership styles 2011 BEST
  29. Coaching course 2011 TU Vienna
  30. Effective meetings delivered by P&G 2012 BEST
  31. Critical thinking 2012 TU Vienna
  32. Creativity (6 hat concept) 2012 TU Vienna
  33. Startup weekend training – pitch training 2013 Ideen Triebwerk Graz
  34. Growth hacking 2014 ABC BEST
  35. Pitching training 2014 ABC BEST
  36. 360 community management 2014 GDG
  37. Presentation skills GDG
  38. Fund raising BEST
  39. Unconscious bias at Google GDG
  40. Motivation GDG
  41. Design thinking GDG

And then I lost track of them.

I also started delivering on my own on topics that are dear to me: Impostor syndrome and Unconscious bias (and also some technical talks all mentioned in the previous post).

And lately, here in Vienna, I like to go to workshops offered by PWN . I joined so far:

  • Financial sustainability
  • Salary negotiations
  • Finding your purpose

If you look at my list you could say I did an entire school of social skills on the side of university. Well yes. Some of the courses were at university but the most are not offered there, so you gotta do self development somewhere else. This is what organizations are about: self development! Becoming a better you, exchanging ideas, becoming a “change agent”.

During all these training, I got to meet amazing people and I got amazing feedback that helped me improve and have a healthier and open mind, be more tolerant.

So what? you might ask.
Truth is, it is a personal story of how one can make use of such a rich palette of knowledge. Using it in the right moment and in the right way is a challenge for me too at times. This does not mean that the teams I work in always has effective meetings nor that feedback is my main tool to communicate. Not at all! Especially in professional life, where unfortunately, social skills STILL come last, (I am not saying EVERYWHERE but majority) it is much harder to establish yourself as… ultimately as a leader. It all adds up in the end. These training gave me the skills to be a good leader!

I leave a link to an interesting post here as a q.e.d: https://www.inc.com/marcel-schwantes/why-do-people-quit-their-jobs-exactly-heres-entire-reason-in-3-simple-words.html