The smart grid revolution demands a huge effort in redesigning and enhancing current power networks, as well as integrating emerging scenarios such as distributed generation, renewable energies or the electric vehicle. This novel situation will cause a huge flood of data that can only be handled, processed and exploited in real-time with the help of cutting-edge ICT (Information and Communication Technologies). We present here a new architecture that, contrary to the previous centralised and static model, distributes the intelligence all over the grid by means of individual intelligent nodes controlling a number of electric assets. The nodes own a profile of the standard smart grid ontology stored in the knowledge base with the inferred information about their environment in RDF triples. Since the system does not have a central registry or a service directory, the connectivity emerges from the view of the world semantically encoded by each individual intelligent node (i.e., profile + inferred information). We have described a use-case both with and without real-time requirements to illustrate and validate this novel approach.