Opening Up a port on RedHat

By default RedHat comes with strict configuration for protecting you from hackers. If you want to open up certain ports for network traffic you will need to use iptables command.  Here is how you might open tcp port 3030 for network traffic

$ sudo iptables -I INPUT -p tcp -m tcp --dport 3030 -j ACCEPT
$ sudo service iptables save # saves rules to /etc/sysconfig/iptables

Alternatively you can use  firewall tui tool

$ sudo system-config-firewall-tui

Replacing URIs with labels in RDF object fields using sparql

Here is how it is done with an example from Linked Movie Database

prefix movie: <>
prefix rdfs: <>

select ?s ?p ?o
       <> ?p ?o1 .
       optional {?o1 rdfs:label ?o.}
       BIND (<> as ?s)
       <> ?p ?o .
       optional {?o rdfs:label ?label.}
       BIND (<> as ?s)
order by ?p
limit 25

Algorithms, Part I — Social Network Connectivity (With Union-Find)

Nice blog post about “Social network connectivity” problem that appears in Coursera Algorithms I (

Data Nest

Q: Given a social network containing N members and a log file containing M timestamps at which times pairs of members formed friendships, design an algorithm to determine the earliest time at which all members are connected (i.e., every member is a friend of a friend of a friend … of a friend). Assume that the log file is sorted by timestamp and that friendship is an equivalence relation. The running time of your algorithm should be MlogN or better and use extra space proportional to N.

(Java Code on github at the bottom of the post. )

My thoughts and solutions:

When solving dynamic connectivity problems (like whether there is a path between two nodes but we don’t care what the exact path is), we can try using the Union-Find algorithm. And this is a typical application of union-find in social network.

This question asks if we can determine the earliest time at which all…

View original post 391 more words

It is about conditional independence

I have been contemplating the reason why learning the weights of ER inference rules separately or jointly, essentially leads to the same weights given the same ground data (evidence and ground truth) as shown in the slides today. To understand the reason behind this I had to dig back to my notes when I was still learning about Markov Networks back in February 2014. While stratification might play a part in this, the actual reason is that the query predicates in my rules are independent from each other given the evidence predicates in the ground Markov Networks. As you recall the ER inference rules has the following form:

Evid1(X) ^ Evid2(X) ^ Evid3(X) => QUERY1(X)

Evid1(X) ^ !Evid2(X) ^ Evid4(X) => QUERY2(X)

Given a domain of values for X, in the ground Markov Network paths from nodes of QUERY1(X) are always conditionally independent from nodes of QUERY2(X) given the nodes of Evid(X), Evid2(X), Evid3(X), and Evid4(X). As a result of this, the ground atoms of QUERY1 and QUERY2 never appear together in the same potential function in the factorized probability density function. Thus the optimization process always optimizes the weights for such rules independently from each other. And as a consequence of this weights are always the same whether they learned together or individually.

On dbpedia-owl vs. dbprop namespaces

If you know about DBPedia then you will know that properties in DBPedia resources have two namespaces:  dbpedia-owl vs. dbprop. The dbprop name space is for properties extracted from the infobox directly.  The dbpedia-owl name space is for mapped properties.  If you are looking for consistent data in your project, then you should consider the use of dbpedia-owl name space properties.