Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Wikidata, SPARQL, and RDF in general. And I guess semi-relatedly things like Prolog? I recently decided to fiddle with Wikidata, and it is fascinating to be able to query for any part of a statement, not just the value!

In SPARQL you write statements in the form

    <thing> <relation> <thing>
But the cool part is that any of those three parts can be extracted, so you can ask things like "what are the cities in <country>", or "what country harbors the city <city>", but most importantly, "how does <city> relate to <country>".

For example, if you wanted to find out all the historical monuments in state capitals of a country (using my home country as an example, also pseudocode for your time's sake):

    fetch ?monumentName, ?cityName given
    ?monument "is called" ?monumentName.
    ?monument "is located within" ?city.
    ?city "is capital of" ?state.
    ?city "is called" ?cityName.
    ?city "is located within" "Brazil".


I've built a few solutions with graph databases (cypher is my query language preference, oddly) and use an RDF/OWL ontology for some personal documentation projects, and what I think holds it back in production is it is too powerful.

"Too powerful" doesn't seem like a thing until you realize it undermines DBA's skill investments, means business level people have to learn something and solve their own problems instead of managing them, disrupts the analyst level conversations that exist in powerBI and excel, seems like an extravagent performance hit with an unclear value prop to devops people, and gives unmanageable godlike powers to the person who operates it. (this unmanagability aspect might be what holds graph products back too)

If you don't believe me, the list of companies who use them also get a rep for having uncanny powers because of their graphs, FB, twitter, palantir, uber, etc.

Using ML to parse and normalize data to fit categories in RDF graphs is singularity-level tech, imo and where that exists today, I'd bet it's mostly secret.


It's very fascination field with a lot of potential, but we're still far from that singularity, unfortunately.

I'm interested in this field and find it fascinating but we're still in it's early dark ages.

when it comes to Knowledge representation and reasoning there's too much emphasis on the representation part and less on the reasoning part, but even this representation part is not a solved problem.


I'm super excited about RDF as well. It's going to be the next big thing as we finally start connecting our machines and data sources together in semantically meaningful ways. I added relationships to CE because of this: https://concise-encoding.org/#relationships

    c1
    {
        // Marked base resource identifiers used for concatenation.
        "resources" = [
            &people:@"https://springfield.gov/people#"
            &mp:@"https://mypredicates.org/"
            &mo:@"https://myobjects.org/"
        ]

        // Map-encoded relationships (the map is the subject)
        $people:"homer_simpson" = {

            /* $mp refers to @"https://mypredicates.org/""
             * $mp:"wife" concatenates to @"https://mypredicates.org/wife"
             */
            $mp:"wife" = $people:"marge_simpson"

            // Multiple relationship objects
            $mp:"regrets" = [
                $firing
                $forgotten_birthday
            ]
        }

        "relationship statements" = [
            &marge_birthday:($people:"marge_simpson" $mp:"birthday" 1956-10-01)
            &forgotten_birthday:($people:"homer_simpson" $mp:"forgot" $marge_birthday)
            &firing:($people:"montgomery_burns" $mp:"fired" $people:"homer_simpson")

            // Multiple relationship subjects
            ([$firing $forgotten_birthday] $mp:"contribute" $mo:"marital_strife")
        ]
    }
RDF is gonna be so awesome when it finally hits the mainstream!


Time travelers unite! Is JSON-LD the modern incarnation of semantic web? Which organizations are contributing to, or using, concise-encoding?


Did you forget the /s? This sounds like you just read the first chapter of a book on the semantic web (SW) from the 90s and how great ontologies are and how they'll CHANGE EVERYTHING. The SW folks have been hyping this stuff for years. It sounds great until you begin to see the practical realities around it and it starts to look a little less, shall we say, "magical" and more like a huge pain in the ass.


Wow... haven't seen such a mean spirited and openly hostile reply in some time. You don't seem to engage much, so please take some time to familiarize yourself with the guidelines: https://news.ycombinator.com/newsguidelines.html


FWIW I didn't read it as mean and hostile. It's just the reality - semantic web is here for 20+ years with very little penetrating mainstream. And huge amounts of efforts spent on the technology, filling the databases and creating tooling. What do you think is needed so that people actually use it and it solves some problems for them?


Yes, much like AI was here for 40+ years with very little penetration into the mainstream.

Technologies like this remain stagnant until the landscape is ready for them. In this case, the advent of AI and big data is what will make relationship data important. "Semantic web" as in human edited XML/HTML with semantic data embedded was never going to happen and was silly from the get-go. But RDF-style semantic data transferred between machines that infer meaning is an absolute certainty.

It's one of those things that's forever a joke until suddenly it's not. There's a fortune of oil out there, but we have to get past the steam age first (and that'll come sooner than you think).


> Technologies like this remain stagnant until the landscape is ready for them.

So true it should have a name, like kstenerud's Law or something.


I agree with you.

Not that I have looked recently, what I see missing is a 'northwid' or 'contoso' database. As well as some MOOC with a gentle ramping up of skills.

If you know of a good MOOC on RDF I would love to know about it.


I am a huge fan of triples to represent things.

I've even written an engine that takes triples and renders web apps.

This is effectively a todo MVC as triples:

  var template = {
    "predicates": [
  "NewTodo leftOf insertButton",
  "Todos below insertButton",
                "Todos backedBy todos",
                "Todos mappedTo todos",
                "Todos key .description",
  "Todos editable $item.description",
  "insertButton on:click insert-new-item",
  "insert-new-item 0.pushes {\"description\": \"$item.NewTodo.description\"}",
  "insert-new-item 0.pushTo $item.todos",
  "NewTodo backedBy NewTodo",
  "NewTodo mappedTo editBox",
  "NewTodo editable $item.description",
  "NewTodo key .description"
    ],
    "widgets": {
        "todos": {
            "predicates": [
                "label hasContent .description"
            ]
        },
 "editBox": {
      "predicates": [
         "NewItemField hasContent .description"
      } 
 }
    },
    "data": {
 "NewTodo": {
      "description": "Hello world"
 },
        "todos": [
            {
                "description": "todo one"
            },
            {
                "description": "todo two"
            },
            {
                "description": "todo three"
            }
        ]
    }
}

See https://elaeis.cloud-angle.com/?p=71 and https://github.com/samsquire/additive-guis


Wikidata, SPARQL, and RDF in general. And I guess semi-relatedly things like Prolog?

I couldn't agree more. I know a lot of this kind of "semantic web" stuff has some pretty vocal detractors and that adoption seems limited, but I still think there is a ton of "meat on this bone". There's just too much potential awesomeness here for this stuff to not be used. I think this is an example of where incremental refinement is the name of the game. As computers get faster, as we get more data, as algorithms improve, etc. we'll get closer and closer to the tipping point where these technologies really start to reveal their potential.


A small addendum because I forgot to actually show something cool:

Another example, demonstrating the querying for the relation part, would be to find Leonardo DaVinci's family members: (again in pseudocode so you don't need to dwell in the syntax)

    fetch ?kinName, ?linkName given
    ?link "is called" ?linkName.
    ?kin "is called" ?kinName.
    "Leonardo DaVinci" ?link ?kin.
    ?link "is" "familial".
Line 3 was the "mindblow" moment for me, you can ask how two objects are related without knowing either one! (though I did know one of them in this example, Leonardo)


I've been considering writing a graph database on top of SPARQL and RDF. Beyond the official docs (which are pretty good), can you recommend any other resources for easily getting the hang of SPARQL?


I worked in a semweb company ~10 years ago - https://jena.apache.org/ as a general starting point is a useful library. I remember distinctly OWLIM https://www.w3.org/2001/sw/wiki/Owlim as a great triple store.


I cannot! I have just recently learned about it and am doing so for leisure, not for skill. I'm sorry I couldn't be of much use.

In fact I would love to know if someone else does have any other resources too :)


can you recommend any other resources for easily getting the hang of SPARQL?

I'll second the recommendation of Jena (and associated sub-project Fuseki). If you know Java (or any JVM language) you can use the Jena API directly for manipulating the triplestore, and submitting SPARQL queries. If you don't want to do that, Fuseki exposes an HTTP based API that you can interact with from any environment you prefer.


I studied SPARQL in university, about 10 years ago. I checked on it recently and found out nothing has changed. Needless to say, I am not hopeful about its feature.


datomic is the only database that i know that does this, afaik.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: